[PATCH v1 4/4] configs: rcar3: Add shell function to select the linux devicetree

Detlev Casanova detlev.casanova at collabora.com
Fri Jun 16 17:21:22 CEST 2023


This function uses the sysinfo command to determine which linux device
tree is selected for the running board.

Signed-off-by: Detlev Casanova <detlev.casanova at collabora.com>
---
 configs/rcar3_ulcb_defconfig       | 1 +
 include/configs/rcar-gen3-common.h | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configs/rcar3_ulcb_defconfig b/configs/rcar3_ulcb_defconfig
index b8fdb5e3826..bb5f8f742ea 100644
--- a/configs/rcar3_ulcb_defconfig
+++ b/configs/rcar3_ulcb_defconfig
@@ -47,6 +47,7 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_SYSINFO=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_LIST="r8a77950-ulcb-u-boot r8a77960-ulcb-u-boot r8a77965-ulcb-u-boot"
 CONFIG_MULTI_DTB_FIT_LZO=y
diff --git a/include/configs/rcar-gen3-common.h b/include/configs/rcar-gen3-common.h
index 213caa75238..b278eb85a81 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -33,6 +33,13 @@
 /* ENV setting */
 
 #define CFG_EXTRA_ENV_SETTINGS	\
-	"bootm_size=0x10000000\0"
+	"bootm_size=0x10000000\0"					\
+	"set_board_fdt=sysinfo revision board_rev; "			\
+	"sysinfo id board_id; "						\
+	"if test ${board_rev} = 2.1 && test ${board_id} = 0x0b; then "	\
+		"setenv fdtfile renesas/r8a779m1-ulcb.dtb; "		\
+	"elif test ${board_rev} = 2.0 && test ${board_id} = 0x0b; then "\
+		"setenv fdtfile renesas/r8a77951-ulcb.dtb; "		\
+	"fi\0"								\
 
 #endif	/* __RCAR_GEN3_COMMON_H */
-- 
2.39.3



More information about the U-Boot mailing list