Commit 5ac44a55437b2b8e86248ed886e86df9d55a514e

Authored by Simon Glass
Committed by Tom Rini
1 parent 25e7dc6a6a

bootstage: Init as early as possible

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@chromium.org>

Showing 2 changed files with 2 additions and 3 deletions Side-by-side Diff

... ... @@ -765,6 +765,7 @@
765 765 trace_early_init,
766 766 #endif
767 767 initf_malloc,
  768 + initf_bootstage, /* uses its own timer, so does not need DM */
768 769 initf_console_record,
769 770 #if defined(CONFIG_HAVE_FSP)
770 771 arch_fsp_init,
... ... @@ -773,7 +774,6 @@
773 774 mach_cpu_init, /* SoC/machine dependent CPU setup */
774 775 initf_dm,
775 776 arch_cpu_init_dm,
776   - initf_bootstage, /* need timer, go after init dm */
777 777 #if defined(CONFIG_BOARD_EARLY_INIT_F)
778 778 board_early_init_f,
779 779 #endif
... ... @@ -328,7 +328,6 @@
328 328  
329 329 static int initr_bootstage(void)
330 330 {
331   - /* We cannot do this before initr_dm() */
332 331 bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
333 332  
334 333 return 0;
... ... @@ -727,6 +726,7 @@
727 726 #endif
728 727 initr_barrier,
729 728 initr_malloc,
  729 + initr_bootstage, /* Needs malloc() but has its own timer */
730 730 initr_console_record,
731 731 #ifdef CONFIG_SYS_NONCACHED_MEMORY
732 732 initr_noncached,
... ... @@ -738,7 +738,6 @@
738 738 #ifdef CONFIG_DM
739 739 initr_dm,
740 740 #endif
741   - initr_bootstage,
742 741 #if defined(CONFIG_ARM) || defined(CONFIG_NDS32)
743 742 board_init, /* Setup chipselects */
744 743 #endif