Skip to content
Snippets Groups Projects
Commit d74d6b44 authored by Simon Glass's avatar Simon Glass Committed by Bin Meng
Browse files

dm: timer: Correct timer init ordering after relocation


Commit 1057e6cf broke use of the timer with driver model. If the timer is used
before relocation, then it becomes broken after relocation. This prevents
some x86 boards from booting. Fix it.

Fixes: 1057e6cf (timer: Set up the real timer after driver model is available)

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent 5a34957c
No related branches found
No related tags found
No related merge requests found
...@@ -322,11 +322,13 @@ static int initr_dm(void) ...@@ -322,11 +322,13 @@ static int initr_dm(void)
/* Save the pre-reloc driver model and start a new one */ /* Save the pre-reloc driver model and start a new one */
gd->dm_root_f = gd->dm_root; gd->dm_root_f = gd->dm_root;
gd->dm_root = NULL; gd->dm_root = NULL;
#ifdef CONFIG_TIMER
gd->timer = NULL;
#endif
ret = dm_init_and_scan(false); ret = dm_init_and_scan(false);
if (ret) if (ret)
return ret; return ret;
#ifdef CONFIG_TIMER_EARLY #ifdef CONFIG_TIMER_EARLY
gd->timer = NULL;
ret = dm_timer_init(); ret = dm_timer_init();
if (ret) if (ret)
return ret; return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment