samsung: misc: use board specific functions to set env board info
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Fri, 6 Jun 2014 10:40:27 +0000 (12:40 +0200)
committerPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 6 Aug 2014 12:10:25 +0000 (14:10 +0200)
This change adds setup of environmental board info using
get_board_name() and get_board_type() functions for config
CONFIG_BOARD_TYPES.

This is useful in case of running many boards with just one config.

Change-Id: I75bb4c0bccc7d27f9f4254b223000a4ff4dadd73
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Piotr Wilczek <p.wilczek@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
---
Changes v2:
- set_board_info: move the bdtype pointer to avoid unused pointer
  compilation warning

Changes v3:
- samsung: misc: change get_board_type_fdt() to get_board_type()
- samsung: misc: set env $boardname using get_board_* functions
  for CONFIG_BOARD_TYPES
- update commit msg

Changes v5:
- misc.c: set_bard_info(): remove a call to get_board_name()

board/samsung/common/misc.c

index cc4de9872fabbb52d9263d1729a62f329338e820..260c0fcb2af4e88ca1ab801c88ea778c611d5e46 100644 (file)
@@ -78,8 +78,16 @@ 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 = "";
+       const char *bdname = CONFIG_SYS_BOARD;
+
+#ifdef CONFIG_BOARD_TYPES
+       bdtype = get_board_type();
+       sprintf(info, "%s%s", bdname, bdtype);
+       setenv("boardname", info);
+#endif
+       snprintf(info, ARRAY_SIZE(info),  "%s%x-%s%s.dtb",
+                CONFIG_SYS_SOC, s5p_cpu_id, bdname, bdtype);
        setenv("fdtfile", info);
 #endif
 }