diff options
author | Piotr Wilczek <p.wilczek@samsung.com> | 2014-01-22 15:54:32 +0100 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2014-02-07 10:06:24 +0900 |
commit | eee2fab0bddb2c460a96a943d7ed6b0f3718f0fd (patch) | |
tree | 1393e8d8ba7e569fdbe714aaa3dd1f8392304fca /board/samsung | |
parent | d1cbf0a5ad8af65c8c1b9a0c848363de7ede91fe (diff) |
board:samsung:common: set envs with board unified information
This patch sets envs that describe board information.
The following envs are set: soc_id, soc_rev, board_rev.
Based on this information, if CONFIG_OF_LIBFDT is enabled,
the 'fdtfile' env is set as:
fdtfile=${soc_family}${soc_id}-${board}.dtb
The generated envs are intenionally not saved to persistent storage.
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'board/samsung')
-rw-r--r-- | board/samsung/common/misc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 643f957a54..eb157394ad 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -21,6 +21,30 @@ DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG +void set_board_info(void) +{ + char info[64]; + + snprintf(info, ARRAY_SIZE(info), "%d.%d", s5p_cpu_rev & 0x0f, + (s5p_cpu_rev & 0xf0) >> 0x04); + setenv("soc_rev", info); + + snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id); + setenv("soc_id", info); + +#ifdef CONFIG_REVISION_TAG + snprintf(info, ARRAY_SIZE(info), "%x", get_board_rev()); + 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); + setenv("fdtfile", info); +#endif +} +#endif /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */ + #ifdef CONFIG_LCD_MENU static int power_key_pressed(u32 reg) { |