提交 dd0edcb2 编写于 作者: S Simon Glass 提交者: Bin Meng

board_r: Move early-timer init later

At present the early timer init happens as soon as driver model is set up.
This makes it impossible to do anything that needs driver model but must
run before devices are probed (as needed with Intel's FSP-S, for example).

In any case it is not a good idea to tie probing of particular drivers too
closely to the DM init.

Create a new function to init the timer and put it a bit later in the
sequence.
Signed-off-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
上级 8aeafb54
...@@ -311,16 +311,24 @@ static int initr_dm(void) ...@@ -311,16 +311,24 @@ static int initr_dm(void)
bootstage_accum(BOOTSTATE_ID_ACCUM_DM_R); bootstage_accum(BOOTSTATE_ID_ACCUM_DM_R);
if (ret) if (ret)
return ret; return ret;
#ifdef CONFIG_TIMER_EARLY
ret = dm_timer_init();
if (ret)
return ret;
#endif
return 0; return 0;
} }
#endif #endif
static int initr_dm_devices(void)
{
int ret;
if (IS_ENABLED(CONFIG_TIMER_EARLY)) {
ret = dm_timer_init();
if (ret)
return ret;
}
return 0;
}
static int initr_bootstage(void) static int initr_bootstage(void)
{ {
bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
...@@ -707,6 +715,7 @@ static init_fnc_t init_sequence_r[] = { ...@@ -707,6 +715,7 @@ static init_fnc_t init_sequence_r[] = {
efi_memory_init, efi_memory_init,
#endif #endif
initr_binman, initr_binman,
initr_dm_devices,
stdio_init_tables, stdio_init_tables,
initr_serial, initr_serial,
initr_announce, initr_announce,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册