Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sh
[platform/kernel/u-boot.git] / include / configs / beacon-rzg2m.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2020 Compass Electronics Group, LLC
4  */
5
6 #ifndef __BEACON_RZG2M_H
7 #define __BEACON_RZG2M_H
8
9 #include "rcar-gen3-common.h"
10
11 /* Ethernet RAVB */
12 #define CONFIG_BITBANGMII_MULTI
13
14 /* Environment in eMMC, at the end of 2nd "boot sector" */
15 /* #define CONFIG_ENV_OFFSET            (-CONFIG_ENV_SIZE) */
16 #define CONFIG_SYS_MMC_ENV_DEV          1
17 #define CONFIG_SYS_MMC_ENV_PART         2
18
19 #undef CONFIG_EXTRA_ENV_SETTINGS
20
21 #define CONFIG_EXTRA_ENV_SETTINGS               \
22         "usb_pgood_delay=2000\0"        \
23         "script=boot.scr\0" \
24         "image=Image\0" \
25         "console=ttySC0,115200\0" \
26         "fdt_addr=0x48000000\0" \
27         "loadaddr=0x48080000\0" \
28         "boot_fdt=try\0" \
29         "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
30         "initrd_addr=0x43800000\0"              \
31         "mmcdev=0\0" \
32         "mmcpart=1\0" \
33         "mmcrootpart=2\0" \
34         "finduuid=part uuid mmc ${mmcdev}:${mmcrootpart} uuid\0" \
35         "mmcautodetect=yes\0" \
36         "mmcargs=setenv bootargs console=${console} " \
37         " root=PARTUUID=${uuid} rootwait rw ${optargs}\0" \
38         "loadbootscript=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
39         "bootscript=echo Running bootscript from mmc ...; " \
40                 "source\0" \
41         "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
42         "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
43         "mmcboot=echo Booting from mmc ...; " \
44                 "run finduuid; run mmcargs; " \
45                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
46                         "if run loadfdt; then " \
47                                 "booti ${loadaddr} - ${fdt_addr}; " \
48                         "else " \
49                                 "echo WARN: Cannot load the DT; " \
50                         "fi; " \
51                 "else " \
52                         "echo wait for boot; " \
53                 "fi;\0" \
54         "netargs=setenv bootargs ${jh_clk} console=${console} " \
55                 "root=/dev/nfs " \
56                 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
57         "netboot=echo Booting from net ...; " \
58                 "run netargs;  " \
59                 "if test ${ip_dyn} = yes; then " \
60                         "setenv get_cmd dhcp; " \
61                 "else " \
62                         "setenv get_cmd tftp; " \
63                 "fi; " \
64                 "${get_cmd} ${loadaddr} ${image}; " \
65                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
66                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
67                                 "booti ${loadaddr} - ${fdt_addr}; " \
68                         "else " \
69                                 "echo WARN: Cannot load the DT; " \
70                         "fi; " \
71                 "else " \
72                         "booti; " \
73                 "fi;\0"
74
75 #undef CONFIG_BOOTCOMMAND
76
77 #define CONFIG_BOOTCOMMAND \
78         "mmc dev ${mmcdev}; if mmc rescan; then " \
79            "if run loadbootscript; then " \
80                    "run bootscript; " \
81            "else " \
82                    "if run loadimage; then " \
83                            "run mmcboot; " \
84                    "else run netboot; " \
85                    "fi; " \
86            "fi; " \
87         "else booti ${loadaddr} - ${fdt_addr}; fi"
88
89 #endif /* __BEACON_RZG2M_H */