Commit 81a1d6173cd255c5c04c332ed69498c6e173515f
Committed by
Stefano Babic
1 parent
59189a8b26
Exists in
v2017.01-smarct4x
and in
48 other branches
mx25pdk: Align the environment with other FSL boards
Allow the boot of a device tree mainline kernel by aligning the environment variables with other FSL boards. Tested NFS boot of a dt 3.14-rc5 kernel. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Acked-by: Stefano Babic <sbabic@denx.de>
Showing 1 changed file with 98 additions and 5 deletions Side-by-side Diff
include/configs/mx25pdk.h
... | ... | @@ -62,6 +62,7 @@ |
62 | 62 | /* No NOR flash present */ |
63 | 63 | #define CONFIG_ENV_OFFSET (6 * 64 * 1024) |
64 | 64 | #define CONFIG_ENV_SIZE (8 * 1024) |
65 | +#define CONFIG_SYS_MMC_ENV_DEV 0 | |
65 | 66 | |
66 | 67 | #define CONFIG_SYS_NO_FLASH |
67 | 68 | #define CONFIG_ENV_IS_IN_MMC |
... | ... | @@ -69,7 +70,7 @@ |
69 | 70 | |
70 | 71 | /* U-Boot general configuration */ |
71 | 72 | #define CONFIG_AUTO_COMPLETE |
72 | -#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ | |
73 | +#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ | |
73 | 74 | /* Print buffer sz */ |
74 | 75 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
75 | 76 | sizeof(CONFIG_SYS_PROMPT) + 16) |
76 | 77 | |
77 | 78 | |
... | ... | @@ -132,13 +133,105 @@ |
132 | 133 | #define CONFIG_LOADADDR 0x81000000 /* loadaddr env var */ |
133 | 134 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
134 | 135 | |
136 | +#define CONFIG_DEFAULT_FDT_FILE "imx25-pdk.dtb" | |
137 | + | |
135 | 138 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
136 | 139 | "script=boot.scr\0" \ |
137 | - "uimage=uImage\0" \ | |
138 | - "netargs=setenv bootargs console=ttymxc0,${baudrate} " \ | |
140 | + "image=zImage\0" \ | |
141 | + "console=ttymxc0\0" \ | |
142 | + "splashpos=m,m\0" \ | |
143 | + "fdt_high=0xffffffff\0" \ | |
144 | + "initrd_high=0xffffffff\0" \ | |
145 | + "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ | |
146 | + "fdt_addr=0x82000000\0" \ | |
147 | + "boot_fdt=try\0" \ | |
148 | + "ip_dyn=yes\0" \ | |
149 | + "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ | |
150 | + "mmcpart=1\0" \ | |
151 | + "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ | |
152 | + "update_sd_firmware_filename=u-boot.imx\0" \ | |
153 | + "update_sd_firmware=" \ | |
154 | + "if test ${ip_dyn} = yes; then " \ | |
155 | + "setenv get_cmd dhcp; " \ | |
156 | + "else " \ | |
157 | + "setenv get_cmd tftp; " \ | |
158 | + "fi; " \ | |
159 | + "if mmc dev ${mmcdev}; then " \ | |
160 | + "if ${get_cmd} ${update_sd_firmware_filename}; then " \ | |
161 | + "setexpr fw_sz ${filesize} / 0x200; " \ | |
162 | + "setexpr fw_sz ${fw_sz} + 1; " \ | |
163 | + "mmc write ${loadaddr} 0x2 ${fw_sz}; " \ | |
164 | + "fi; " \ | |
165 | + "fi\0" \ | |
166 | + "mmcargs=setenv bootargs console=${console},${baudrate} " \ | |
167 | + "root=${mmcroot}\0" \ | |
168 | + "loadbootscript=" \ | |
169 | + "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ | |
170 | + "bootscript=echo Running bootscript from mmc ...; " \ | |
171 | + "source\0" \ | |
172 | + "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ | |
173 | + "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ | |
174 | + "mmcboot=echo Booting from mmc ...; " \ | |
175 | + "run mmcargs; " \ | |
176 | + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | |
177 | + "if run loadfdt; then " \ | |
178 | + "bootz ${loadaddr} - ${fdt_addr}; " \ | |
179 | + "else " \ | |
180 | + "if test ${boot_fdt} = try; then " \ | |
181 | + "bootz; " \ | |
182 | + "else " \ | |
183 | + "echo WARN: Cannot load the DT; " \ | |
184 | + "fi; " \ | |
185 | + "fi; " \ | |
186 | + "else " \ | |
187 | + "bootz; " \ | |
188 | + "fi;\0" \ | |
189 | + "netargs=setenv bootargs console=${console},${baudrate} " \ | |
139 | 190 | "root=/dev/nfs " \ |
140 | - "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ | |
141 | - "bootcmd=run netargs; dhcp ${uimage}; bootm\0" \ | |
191 | + "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ | |
192 | + "netboot=echo Booting from net ...; " \ | |
193 | + "run netargs; " \ | |
194 | + "if test ${ip_dyn} = yes; then " \ | |
195 | + "setenv get_cmd dhcp; " \ | |
196 | + "else " \ | |
197 | + "setenv get_cmd tftp; " \ | |
198 | + "fi; " \ | |
199 | + "${get_cmd} ${image}; " \ | |
200 | + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | |
201 | + "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ | |
202 | + "bootz ${loadaddr} - ${fdt_addr}; " \ | |
203 | + "else " \ | |
204 | + "if test ${boot_fdt} = try; then " \ | |
205 | + "bootz; " \ | |
206 | + "else " \ | |
207 | + "echo WARN: Cannot load the DT; " \ | |
208 | + "fi; " \ | |
209 | + "fi; " \ | |
210 | + "else " \ | |
211 | + "bootz; " \ | |
212 | + "fi;\0" | |
213 | + | |
214 | +#define CONFIG_BOOTCOMMAND \ | |
215 | + "mmc dev ${mmcdev}; if mmc rescan; then " \ | |
216 | + "if run loadbootscript; then " \ | |
217 | + "run bootscript; " \ | |
218 | + "else " \ | |
219 | + "if run loadimage; then " \ | |
220 | + "run mmcboot; " \ | |
221 | + "else run netboot; " \ | |
222 | + "fi; " \ | |
223 | + "fi; " \ | |
224 | + "else run netboot; fi" | |
225 | + | |
226 | +/* Miscellaneous configurable options */ | |
227 | +#define CONFIG_SYS_LONGHELP | |
228 | +#define CONFIG_SYS_HUSH_PARSER | |
229 | +#define CONFIG_AUTO_COMPLETE | |
230 | + | |
231 | +/* Print Buffer Size */ | |
232 | +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) | |
233 | +#define CONFIG_SYS_MAXARGS 16 | |
234 | +#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE | |
142 | 235 | |
143 | 236 | #endif /* __CONFIG_H */ |