spl: use different BOARD_INIT MACRO for spl and tpl
authorKever Yang <kever.yang@rock-chips.com>
Sat, 20 Jan 2018 10:00:26 +0000 (18:00 +0800)
committerTom Rini <trini@konsulko.com>
Sun, 28 Jan 2018 17:27:29 +0000 (12:27 -0500)
SPL and TPL may not always need spl_board_init() at the same time.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
common/spl/Kconfig
common/spl/spl.c

index d686b1ecbdf6c17d33a07ef0549f1a34c4bf7023..e1b91f5d895c30a55642a6cddf2ef5520e081d23 100644 (file)
@@ -757,6 +757,13 @@ config TPL
 
 if TPL
 
+config TPL_BOARD_INIT
+       bool "Call board-specific initialization in TPL"
+       help
+         If this option is enabled, U-Boot will call the function
+         spl_board_init() from board_init_r(). This function should be
+         provided by the board.
+
 config TPL_LDSCRIPT
         string "Linker script for the TPL stage"
        depends on TPL
index 76c1963611c49c8e6cb572d8b451f4c392262b00..1566acdbc30672eb4a8efe476d21bd6e0ae7ea85 100644 (file)
@@ -407,7 +407,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
        timer_init();
 #endif
 
-#ifdef CONFIG_SPL_BOARD_INIT
+#if CONFIG_IS_ENABLED(BOARD_INIT)
        spl_board_init();
 #endif