Skip to content
Snippets Groups Projects
Commit 1057e6cf authored by Simon Glass's avatar Simon Glass
Browse files

timer: Set up the real timer after driver model is available


When using the early timer, we need to manually trigger setting up the
real timer. This will not happen automatically. Do this immediately after
starting driver model.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent c95fec31
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <post.h> #include <post.h>
#include <spi.h> #include <spi.h>
#include <status_led.h> #include <status_led.h>
#include <timer.h>
#include <trace.h> #include <trace.h>
#include <video.h> #include <video.h>
#include <watchdog.h> #include <watchdog.h>
...@@ -805,6 +806,11 @@ static int initf_dm(void) ...@@ -805,6 +806,11 @@ static int initf_dm(void)
if (ret) if (ret)
return ret; return ret;
#endif #endif
#ifdef CONFIG_TIMER_EARLY
ret = dm_timer_init();
if (ret)
return ret;
#endif
return 0; return 0;
} }
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <serial.h> #include <serial.h>
#include <spi.h> #include <spi.h>
#include <stdio_dev.h> #include <stdio_dev.h>
#include <timer.h>
#include <trace.h> #include <trace.h>
#include <watchdog.h> #include <watchdog.h>
#ifdef CONFIG_CMD_AMBAPP #ifdef CONFIG_CMD_AMBAPP
...@@ -312,13 +313,22 @@ static int initr_noncached(void) ...@@ -312,13 +313,22 @@ static int initr_noncached(void)
#ifdef CONFIG_DM #ifdef CONFIG_DM
static int initr_dm(void) static int initr_dm(void)
{ {
int ret;
/* 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 ret = dm_init_and_scan(false);
if (ret)
return ret;
#ifdef CONFIG_TIMER_EARLY
gd->timer = NULL; gd->timer = NULL;
ret = dm_timer_init();
if (ret)
return ret;
#endif #endif
return dm_init_and_scan(false);
return 0;
} }
#endif #endif
......
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