summaryrefslogtreecommitdiffstats
path: root/common/board_r.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-11-28 22:16:35 -0700
committerSimon Glass <sjg@chromium.org>2015-12-01 06:26:12 -0700
commit881c124ab81fddc41e4ecc7409ad3bb5bcbcf5a6 (patch)
tree50c09060b0b4b52db21f42cb03455a86000fd1f8 /common/board_r.c
parent4e51fc2351abbb2ebe42fbedccfec3bba20b1c12 (diff)
downloadtalos-obmc-uboot-881c124ab81fddc41e4ecc7409ad3bb5bcbcf5a6.tar.gz
talos-obmc-uboot-881c124ab81fddc41e4ecc7409ad3bb5bcbcf5a6.zip
dm: timer: Avoid using timer before it is ready
At present bootstage will try to read the timer very early after relocation. When driver model is used to provide the timer, we cannot read it until driver model is ready. Correct this by adding a separate stage for the post-relocation bootstage init. This fixes booting on chromebook_link. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Diffstat (limited to 'common/board_r.c')
-rw-r--r--common/board_r.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/board_r.c b/common/board_r.c
index f7118e8fc4..a41fb547a3 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -109,7 +109,6 @@ static int initr_reloc(void)
{
/* tell others: relocation done */
gd->flags |= GD_FLG_RELOC | GD_FLG_FULL_MALLOC_INIT;
- bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
return 0;
}
@@ -310,6 +309,14 @@ static int initr_dm(void)
}
#endif
+static int initr_bootstage(void)
+{
+ /* We cannot do this before initr_dm() */
+ bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
+
+ return 0;
+}
+
__weak int power_init_board(void)
{
return 0;
@@ -748,6 +755,7 @@ init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_DM
initr_dm,
#endif
+ initr_bootstage,
#if defined(CONFIG_ARM) || defined(CONFIG_NDS32)
board_init, /* Setup chipselects */
#endif
OpenPOWER on IntegriCloud