[U-Boot] [PATCH v2 07/11] samsung: misc: set_board_info: check the board type to set fdt file name
Przemyslaw Marczak
p.marczak at samsung.com
Thu Jun 12 11:46:30 CEST 2014
This change adds a call to the get_board_type_fdt() function before setting
the "fdtfile" environment variable.
For CONFIG_BOARD_TYPES below function is called:
- const char *get_board_type_fdt(void) - should return a pointer
to the board type string.
This is useful in case of run many boards with just one config.
Signed-off-by: Przemyslaw Marczak <p.marczak at samsung.com>
Cc: Piotr Wilczek <p.wilczek at samsung.com>
Cc: Minkyu Kang <mk7.kang at samsung.com>
---
Changes v2:
- set_board_info: move the bdtype pointer to avoid unused pointer
compilation warning
---
board/samsung/common/misc.c | 9 +++++++--
include/samsung/misc.h | 3 +++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 9a5d2ac..67e79f2 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -57,8 +57,13 @@ void set_board_info(void)
setenv("board_rev", info);
#endif
#ifdef CONFIG_OF_LIBFDT
- snprintf(info, ARRAY_SIZE(info), "%s%x-%s.dtb",
- CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD);
+ const char *bdtype = "";
+
+#ifdef CONFIG_BOARD_TYPES
+ bdtype = get_board_type_fdt();
+#endif
+ snprintf(info, ARRAY_SIZE(info), "%s%x-%s%s.dtb",
+ CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD, bdtype);
setenv("fdtfile", info);
#endif
}
diff --git a/include/samsung/misc.h b/include/samsung/misc.h
index 3d1d076..914137e 100644
--- a/include/samsung/misc.h
+++ b/include/samsung/misc.h
@@ -36,5 +36,8 @@ void draw_logo(void);
#ifdef CONFIG_DFU_ALT_BOOTLOADER
void set_dfu_alt_boot(int bootmode);
#endif
+#ifdef CONFIG_BOARD_TYPES
+const char *get_board_type_fdt(void);
+#endif
#endif /* __SAMSUNG_MISC_COMMON_H__ */
--
1.9.1
More information about the U-Boot
mailing list