summaryrefslogtreecommitdiff
path: root/include/configs/mx6sabre_common.h
diff options
context:
space:
mode:
authorPeng Fan <Peng.Fan@freescale.com>2015-07-11 11:38:46 +0800
committerStefano Babic <sbabic@denx.de>2015-08-02 10:47:05 +0200
commite6fc8995d6654df23387ccac91543a2206cfcb36 (patch)
tree83fa7c953bd27c07b642be6926fcf26a9211a598 /include/configs/mx6sabre_common.h
parent8d7794615c7672b03b5140dfe2bac65daf7ce5eb (diff)
downloadu-boot-e6fc8995d6654df23387ccac91543a2206cfcb36.tar.gz
imx: mx6sabresd/sabreauto runtime setting fdt_file
Detect the SOC and board variant at runtime and change the dtb name, but not hardcoding the fdt_file env variable. Take the following patch as a reference. Íd58699b157df75f1aa0b363ea9c21add21a0c "mx6cuboxi: Load the correct 'fdtfile' variable" Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'include/configs/mx6sabre_common.h')
-rw-r--r--include/configs/mx6sabre_common.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index e42dfc9045..903ab1860e 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -70,10 +70,12 @@
#define EMMC_ENV ""
#endif
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
#define CONFIG_EXTRA_ENV_SETTINGS \
"script=boot.scr\0" \
"image=zImage\0" \
- "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+ "fdt_file=undefined\0" \
"fdt_addr=0x18000000\0" \
"boot_fdt=try\0" \
"ip_dyn=yes\0" \
@@ -143,9 +145,24 @@
"fi; " \
"else " \
"bootz; " \
- "fi;\0"
+ "fi;\0" \
+ "findfdt="\
+ "if test $fdt_file = undefined; then " \
+ "if test $board_name = SABREAUTO && test $board_rev = MX6Q; then " \
+ "setenv fdt_file imx6q-sabreauto.dtb; fi; " \
+ "if test $board_name = SABREAUTO && test $board_rev = MX6DL; then " \
+ "setenv fdt_file imx6dl-sabreauto.dtb; fi; " \
+ "if test $board_name = SABRESD && test $board_rev = MX6Q; then " \
+ "setenv fdt_file imx6q-sabresd.dtb; fi; " \
+ "if test $board_name = SABRESD && test $board_rev = MX6DL; then " \
+ "setenv fdt_file imx6dl-sabresd.dtb; fi; " \
+ "if test $fdt_file = undefined; then " \
+ "echo WARNING: Could not determine dtb to use; fi; " \
+ "fi;\0" \
+
#define CONFIG_BOOTCOMMAND \
+ "run findfdt;" \
"mmc dev ${mmcdev};" \
"if mmc rescan; then " \
"if run loadbootscript; then " \