Browse Source

arm: udoo: Convert to distro config

Instead of keeping a custom environment, use a more generic approach
by switching to distro config.

Signed-off-by: Dirk Meul <dirk.meul@rwth-aachen.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Meul, Dirk 3 years ago
parent
commit
e18333e501
2 changed files with 25 additions and 89 deletions
  1. 2 0
      configs/udoo_defconfig
  2. 23 89
      include/configs/udoo.h

+ 2 - 0
configs/udoo_defconfig

@@ -9,8 +9,10 @@ CONFIG_SPL_MMC_SUPPORT=y
9 9
 CONFIG_SPL_SERIAL_SUPPORT=y
10 10
 CONFIG_SPL=y
11 11
 CONFIG_SPL_LIBDISK_SUPPORT=y
12
+CONFIG_DISTRO_DEFAULTS=y
12 13
 CONFIG_NR_DRAM_BANKS=1
13 14
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
15
+CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd"
14 16
 CONFIG_BOOTDELAY=3
15 17
 CONFIG_SUPPORT_RAW_INITRD=y
16 18
 CONFIG_BOARD_EARLY_INIT_F=y

+ 23 - 89
include/configs/udoo.h

@@ -45,100 +45,34 @@
45 45
 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
46 46
 
47 47
 #define CONFIG_EXTRA_ENV_SETTINGS \
48
-	"script=boot.scr\0" \
49
-	"image=zImage\0" \
50
-	"console=ttymxc1\0" \
51
-	"splashpos=m,m\0" \
48
+	"console=ttymxc1,115200\0" \
52 49
 	"fdt_high=0xffffffff\0" \
53 50
 	"initrd_high=0xffffffff\0" \
54
-	"fdt_file=undefined\0" \
51
+	"fdtfile=undefined\0" \
55 52
 	"fdt_addr=0x18000000\0" \
56
-	"boot_fdt=try\0" \
53
+	"fdt_addr_r=0x18000000\0" \
57 54
 	"ip_dyn=yes\0" \
58 55
 	"mmcdev=0\0" \
59
-	"mmcpart=1\0" \
60
-	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
61
-	"update_sd_firmware_filename=u-boot.imx\0" \
62
-	"update_sd_firmware=" \
63
-		"if test ${ip_dyn} = yes; then " \
64
-			"setenv get_cmd dhcp; " \
65
-		"else " \
66
-			"setenv get_cmd tftp; " \
67
-		"fi; " \
68
-		"if mmc dev ${mmcdev}; then "	\
69
-			"if ${get_cmd} ${update_sd_firmware_filename}; then " \
70
-				"setexpr fw_sz ${filesize} / 0x200; " \
71
-				"setexpr fw_sz ${fw_sz} + 1; "	\
72
-				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
73
-			"fi; "	\
74
-		"fi\0" \
75
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
76
-		"root=${mmcroot}\0" \
77
-	"loadbootscript=" \
78
-		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
79
-	"bootscript=echo Running bootscript from mmc ...; " \
80
-		"source\0" \
81
-	"loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
82
-	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
83
-	"mmcboot=echo Booting from mmc ...; " \
84
-		"run mmcargs; " \
85
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
86
-			"if run loadfdt; then " \
87
-				"bootz ${loadaddr} - ${fdt_addr}; " \
88
-			"else " \
89
-				"if test ${boot_fdt} = try; then " \
90
-					"bootz; " \
91
-				"else " \
92
-					"echo WARN: Cannot load the DT; " \
93
-				"fi; " \
94
-			"fi; " \
95
-		"else " \
96
-			"bootz; " \
97
-		"fi;\0" \
98
-	"netargs=setenv bootargs console=${console},${baudrate} " \
99
-		"root=/dev/nfs " \
100
-	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
101
-		"netboot=echo Booting from net ...; " \
102
-		"run netargs; " \
103
-		"if test ${ip_dyn} = yes; then " \
104
-			"setenv get_cmd dhcp; " \
105
-		"else " \
106
-			"setenv get_cmd tftp; " \
107
-		"fi; " \
108
-		"${get_cmd} ${image}; " \
109
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
110
-			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
111
-				"bootz ${loadaddr} - ${fdt_addr}; " \
112
-			"else " \
113
-				"if test ${boot_fdt} = try; then " \
114
-					"bootz; " \
115
-				"else " \
116
-					"echo WARN: Cannot load the DT; " \
117
-				"fi; " \
118
-			"fi; " \
119
-		"else " \
120
-			"bootz; " \
121
-		"fi;\0" \
122
-		"findfdt=" \
123
-			"if test $board_rev = MX6Q ; then " \
124
-				"setenv fdt_file imx6q-udoo.dtb; fi; " \
125
-			"if test $board_rev = MX6DL ; then " \
126
-				"setenv fdt_file imx6dl-udoo.dtb; fi; " \
127
-			"if test $fdt_file = undefined; then " \
128
-				"echo WARNING: Could not determine dtb to use; fi; \0"
129
-
130
-#define CONFIG_BOOTCOMMAND \
131
-	   "run findfdt; " \
132
-	   "mmc dev ${mmcdev}; if mmc rescan; then " \
133
-		   "if run loadbootscript; then " \
134
-			   "run bootscript; " \
135
-		   "else " \
136
-			   "if run loadimage; then " \
137
-				   "run mmcboot; " \
138
-			   "else run netboot; " \
139
-			   "fi; " \
140
-		   "fi; " \
141
-	   "else run netboot; fi"
56
+	"mmcrootfstype=ext4\0" \
57
+	"findfdt="\
58
+		"if test ${board_rev} = MX6Q; then " \
59
+			"setenv fdtfile imx6q-udoo.dtb; fi; " \
60
+		"if test ${board_rev} = MX6DL; then " \
61
+			"setenv fdtfile imx6dl-udoo.dtb; fi; " \
62
+		"if test ${fdtfile} = undefined; then " \
63
+			"echo WARNING: Could not determine dtb to use; fi\0" \
64
+	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
65
+	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
66
+	"ramdisk_addr_r=0x13000000\0" \
67
+	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
68
+	BOOTENV
69
+
70
+#define BOOT_TARGET_DEVICES(func) \
71
+	func(MMC, mmc, 0) \
72
+	func(SATA, sata, 0) \
73
+	func(DHCP, dhcp, na)
74
+
75
+#include <config_distro_bootcmd.h>
142 76
 
143 77
 /* Physical Memory Map */
144 78
 #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR