summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-03-11 22:06:46 -0700
committerBin Meng <bmeng.cn@gmail.com>2016-03-17 10:27:24 +0800
commitd74d6b444c9f1596c24d492e57af9423efbd113b (patch)
tree20de40deb6f12c7913f0855685bc9dd52abcd2fd /common
parent5a34957c39c9526b88c658b740fc4e9a3012e58b (diff)
downloadu-boot-imx-d74d6b444c9f1596c24d492e57af9423efbd113b.zip
u-boot-imx-d74d6b444c9f1596c24d492e57af9423efbd113b.tar.gz
u-boot-imx-d74d6b444c9f1596c24d492e57af9423efbd113b.tar.bz2
dm: timer: Correct timer init ordering after relocation
Commit 1057e6c 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: 1057e6c (timer: Set up the real timer after driver model is available) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/board_r.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/board_r.c b/common/board_r.c
index 2cb6836..ad02549 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -322,11 +322,13 @@ static int initr_dm(void)
/* 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
+ gd->timer = NULL;
+#endif
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;