[U-Boot] [PATCH 10/15] bootstage: Init as early as possible

Simon Glass sjg at chromium.org
Mon May 22 11:05:31 UTC 2017


At present we don't allow use of bootstage before driver model is running.
This means we cannot time the init of driver model itself.

Now that bootstage requires its own board-specific timer, we can move its
init to earlier in the sequence, both before and after relocation.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 common/board_f.c | 2 +-
 common/board_r.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 96949eba3c..80388c50bc 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -762,6 +762,7 @@ static const init_fnc_t init_sequence_f[] = {
 	trace_early_init,
 #endif
 	initf_malloc,
+	initf_bootstage,	/* uses its own timer, so does not need DM */
 	initf_console_record,
 #if defined(CONFIG_HAVE_FSP)
 	arch_fsp_init,
@@ -770,7 +771,6 @@ static const init_fnc_t init_sequence_f[] = {
 	mach_cpu_init,		/* SoC/machine dependent CPU setup */
 	initf_dm,
 	arch_cpu_init_dm,
-	initf_bootstage,		/* need timer, go after init dm */
 #if defined(CONFIG_BOARD_EARLY_INIT_F)
 	board_early_init_f,
 #endif
diff --git a/common/board_r.c b/common/board_r.c
index a9c6a84ce4..990d87021e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -329,7 +329,6 @@ static int initr_dm(void)
 
 static int initr_bootstage(void)
 {
-	/* We cannot do this before initr_dm() */
 	bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
 
 	return 0;
@@ -728,6 +727,7 @@ static init_fnc_t init_sequence_r[] = {
 #endif
 	initr_barrier,
 	initr_malloc,
+	initr_bootstage,	/* Needs malloc() but has its own timer */
 	initr_console_record,
 #ifdef CONFIG_SYS_NONCACHED_MEMORY
 	initr_noncached,
@@ -739,7 +739,6 @@ static init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_DM
 	initr_dm,
 #endif
-	initr_bootstage,
 #if defined(CONFIG_ARM) || defined(CONFIG_NDS32)
 	board_init,	/* Setup chipselects */
 #endif
-- 
2.13.0.303.g4ebf302169-goog



More information about the U-Boot mailing list