[U-Boot] [PATCH] spl: use different BOARD_INIT MACRO for spl and tpl

Kever Yang kever.yang at rock-chips.com
Sat Jan 20 10:00:26 UTC 2018


SPL and TPL may not always need spl_board_init() at the same time.

Signed-off-by: Kever Yang <kever.yang at rock-chips.com>
---

 common/spl/Kconfig | 7 +++++++
 common/spl/spl.c   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 7aae826..3e6f526 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -754,6 +754,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
diff --git a/common/spl/spl.c b/common/spl/spl.c
index ac2c6ca..ec6ac69 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -395,7 +395,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
 
-- 
1.9.1



More information about the U-Boot mailing list