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>
#include <post.h>
#include <spi.h>
#include <status_led.h>
+#include <timer.h>
#include <trace.h>
#include <video.h>
#include <watchdog.h>
if (ret)
return ret;
#endif
+#ifdef CONFIG_TIMER_EARLY
+ ret = dm_timer_init();
+ if (ret)
+ return ret;
+#endif
return 0;
}
#include <serial.h>
#include <spi.h>
#include <stdio_dev.h>
+#include <timer.h>
#include <trace.h>
#include <watchdog.h>
#ifdef CONFIG_CMD_AMBAPP
#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