diff mbox series

[08/18] include: configs: Update env for selecting right dtb

Message ID 20210506111505.6741-9-lokeshvutla@ti.com
State Accepted
Commit 5af71f265854e7280c07cd4df26250ef54b7dcb2
Delegated to: Lokesh Vutla
Headers show
Series arm: k3-am64: Add initial support for AM64 SK | expand

Commit Message

Lokesh Vutla May 6, 2021, 11:14 a.m. UTC
Now that single defconfig can be used for booting AM64 EVM and SK,
default device tree will not work for selecting dtb for kernel.
Update the env to select right dtb based on eeprom.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 include/configs/am64x_evm.h | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h
index 6fe5c19f12..7c30e50c5f 100644
--- a/include/configs/am64x_evm.h
+++ b/include/configs/am64x_evm.h
@@ -58,10 +58,13 @@ 
 
 /* U-Boot general configuration */
 #define EXTRA_ENV_AM642_BOARD_SETTINGS					\
-	"default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0"	\
 	"findfdt="							\
-		"setenv name_fdt ${default_device_tree};"		\
-		"setenv fdtfile ${name_fdt}\0"				\
+		"if test $board_name = am64x_gpevm; then " \
+			"setenv fdtfile k3-am642-evm.dtb; fi; " \
+		"if test $board_name = am64x_skevm; then " \
+			"setenv fdtfile k3-am642-sk.dtb; fi;" \
+		"if test $fdtfile = undefined; then " \
+			"echo WARNING: Could not determine device tree to use; fi; \0" \
 	"name_kern=Image\0"						\
 	"console=ttyS2,115200n8\0"					\
 	"args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 "	\
@@ -76,7 +79,7 @@ 
 	"bootdir=/boot\0"						\
 	"rd_spec=-\0"							\
 	"init_mmc=run args_all args_mmc\0"				\
-	"get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \
+	"get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
 	"get_overlay_mmc="						\
 		"fdt address ${fdtaddr};"				\
 		"fdt resize 0x100000;"					\