aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-10-20 21:31:54 -0600
committerBin Meng <bmeng.cn@gmail.com>2019-11-03 07:20:27 +0800
commit096c71e34bac7551aa228bbcb9e1c867ad9e5d07 (patch)
tree66ec4eefc5fa0cadd41cfb0cecde66b0a4a212da
parentc52b5e8e2ce7f4cd3a9116083debd27ef23046d7 (diff)
downloadu-boot-096c71e34bac7551aa228bbcb9e1c867ad9e5d07.zip
u-boot-096c71e34bac7551aa228bbcb9e1c867ad9e5d07.tar.gz
u-boot-096c71e34bac7551aa228bbcb9e1c867ad9e5d07.tar.bz2
x86: timer: Set up the timer in timer_early_get_count()
This function can be called before the timer is set up. Make sure that the init function is called so that it works correctly. This is needed so that bootstage can work correctly in TPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--drivers/timer/tsc_timer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index 919caba..f19d223 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -461,6 +461,8 @@ unsigned long notrace timer_early_get_rate(void)
u64 notrace timer_early_get_count(void)
{
+ tsc_timer_ensure_setup(true);
+
return rdtsc() - gd->arch.tsc_base;
}