samsung: board: enable support of multiple board types
This change adds declaration of functions: - set_board_type() - called at board_early_init_f() - get_board_type() - called at checkboard() For supporting multiple board types in a one config - it is welcome to display the current board model. This is what get_board_type() should return. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Minkyu Kang <mk7.kang@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
parent
1fb4dab2a1
commit
d50c41efcd
@ -137,7 +137,9 @@ static int board_uart_init(void)
|
|||||||
int board_early_init_f(void)
|
int board_early_init_f(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
#ifdef CONFIG_BOARD_TYPES
|
||||||
|
set_board_type();
|
||||||
|
#endif
|
||||||
err = board_uart_init();
|
err = board_uart_init();
|
||||||
if (err) {
|
if (err) {
|
||||||
debug("UART init failed\n");
|
debug("UART init failed\n");
|
||||||
@ -147,7 +149,6 @@ int board_early_init_f(void)
|
|||||||
#ifdef CONFIG_SYS_I2C_INIT_BOARD
|
#ifdef CONFIG_SYS_I2C_INIT_BOARD
|
||||||
board_i2c_init(gd->fdt_blob);
|
board_i2c_init(gd->fdt_blob);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return exynos_early_init_f();
|
return exynos_early_init_f();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -280,11 +281,15 @@ int board_mmc_init(bd_t *bis)
|
|||||||
#ifdef CONFIG_DISPLAY_BOARDINFO
|
#ifdef CONFIG_DISPLAY_BOARDINFO
|
||||||
int checkboard(void)
|
int checkboard(void)
|
||||||
{
|
{
|
||||||
const char *board_name;
|
const char *board_info;
|
||||||
|
|
||||||
board_name = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
|
board_info = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
|
||||||
printf("Board: %s\n", board_name ? board_name : "unknown");
|
printf("Board: %s\n", board_info ? board_info : "unknown");
|
||||||
|
#ifdef CONFIG_BOARD_TYPES
|
||||||
|
board_info = get_board_type();
|
||||||
|
|
||||||
|
printf("Model: %s\n", board_info ? board_info : "unknown");
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,5 +33,9 @@ char *get_dfu_alt_system(void);
|
|||||||
char *get_dfu_alt_boot(void);
|
char *get_dfu_alt_boot(void);
|
||||||
void set_dfu_alt_info(void);
|
void set_dfu_alt_info(void);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_BOARD_TYPES
|
||||||
|
void set_board_type(void);
|
||||||
|
const char *get_board_type(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __SAMSUNG_MISC_COMMON_H__ */
|
#endif /* __SAMSUNG_MISC_COMMON_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user