diff options
author | Simon Glass <sjg@chromium.org> | 2016-02-24 09:14:50 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-02-26 08:53:10 -0700 |
commit | 1057e6cfe12bf71394fe02e0939f232417882f90 (patch) | |
tree | ef92c3371d4e199a3b649ac1d347156075a21650 /common/board_r.c | |
parent | c95fec31928d7e2596364ee1d226b52ffd7793f2 (diff) |
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: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common/board_r.c')
-rw-r--r-- | common/board_r.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/common/board_r.c b/common/board_r.c index 6c23865279..52a9b262eb 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -46,6 +46,7 @@ #include <serial.h> #include <spi.h> #include <stdio_dev.h> +#include <timer.h> #include <trace.h> #include <watchdog.h> #ifdef CONFIG_CMD_AMBAPP @@ -312,13 +313,22 @@ static int initr_noncached(void) #ifdef CONFIG_DM static int initr_dm(void) { + int ret; + /* Save the pre-reloc driver model and start a new one */ gd->dm_root_f = gd->dm_root; gd->dm_root = NULL; -#ifdef CONFIG_TIMER + ret = dm_init_and_scan(false); + if (ret) + return ret; +#ifdef CONFIG_TIMER_EARLY gd->timer = NULL; + ret = dm_timer_init(); + if (ret) + return ret; #endif - return dm_init_and_scan(false); + + return 0; } #endif |