summaryrefslogtreecommitdiff
path: root/include/configs/mx6qsabre_common.h
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2013-01-10 09:45:09 +0000
committerStefano Babic <sbabic@denx.de>2013-01-13 11:53:45 +0100
commitbf0c2245a2d8bbf437f6182f7d50b896461a931d (patch)
treec86d36a1c2c8e79a3b1e44706c6bbdf879c1a333 /include/configs/mx6qsabre_common.h
parent6efbe2199008f3a3abadcc59fd9d8e7d51cf816a (diff)
downloadu-boot-imx-bf0c2245a2d8bbf437f6182f7d50b896461a931d.zip
u-boot-imx-bf0c2245a2d8bbf437f6182f7d50b896461a931d.tar.gz
u-boot-imx-bf0c2245a2d8bbf437f6182f7d50b896461a931d.tar.bz2
mx6qsabre{auto, sd}: Add support to dynamically choose between fdt use or not
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
Diffstat (limited to 'include/configs/mx6qsabre_common.h')
-rw-r--r--include/configs/mx6qsabre_common.h41
1 files changed, 38 insertions, 3 deletions
diff --git a/include/configs/mx6qsabre_common.h b/include/configs/mx6qsabre_common.h
index bd2fb10..3229d5a 100644
--- a/include/configs/mx6qsabre_common.h
+++ b/include/configs/mx6qsabre_common.h
@@ -83,6 +83,10 @@
#define CONFIG_EXTRA_ENV_SETTINGS \
"script=boot.scr\0" \
"uimage=uImage\0" \
+ "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+ "fdt_addr=0x11000000\0" \
+ "boot_fdt=try\0" \
+ "ip_dyn=yes\0" \
"console=" CONFIG_CONSOLE_DEV "\0" \
"fdt_high=0xffffffff\0" \
"initrd_high=0xffffffff\0" \
@@ -96,15 +100,46 @@
"bootscript=echo Running bootscript from mmc ...; " \
"source\0" \
"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
- "mmcboot=echo Booting from mmc ...; " \
+ "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
+ "mmcboot=echo Booting from mmc ...; " \
"run mmcargs; " \
- "bootm\0" \
+ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+ "if run loadfdt; then " \
+ "bootm ${loadaddr} - ${fdt_addr}; " \
+ "else " \
+ "if test ${boot_fdt} = try; then " \
+ "bootm; " \
+ "else " \
+ "echo WARN: Cannot load the DT; " \
+ "fi; " \
+ "fi; " \
+ "else " \
+ "bootm; " \
+ "fi;\0" \
"netargs=setenv bootargs console=${console},${baudrate} " \
"root=/dev/nfs " \
"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
"netboot=echo Booting from net ...; " \
"run netargs; " \
- "dhcp ${uimage}; bootm\0" \
+ "if test ${ip_dyn} = yes; then " \
+ "setenv get_cmd dhcp; " \
+ "else " \
+ "setenv get_cmd tftp; " \
+ "fi; " \
+ "${get_cmd} ${uimage}; " \
+ "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
+ "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
+ "bootm ${loadaddr} - ${fdt_addr}; " \
+ "else " \
+ "if test ${boot_fdt} = try; then " \
+ "bootm; " \
+ "else " \
+ "echo WARN: Cannot load the DT; " \
+ "fi; " \
+ "fi; " \
+ "else " \
+ "bootm; " \
+ "fi;\0"
#define CONFIG_BOOTCOMMAND \
"mmc dev ${mmcdev};" \