From: Simon Glass Date: Mon, 21 Oct 2019 03:31:54 +0000 (-0600) Subject: x86: timer: Set up the timer in timer_early_get_count() X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-favicon.png?a=commitdiff_plain;h=096c71e34bac7551aa228bbcb9e1c867ad9e5d07;p=u-boot.git 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 Reviewed-by: Bin Meng --- diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c index 919caba8a1..f19d2237e4 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; }