[U-Boot] [PATCH v3 021/108] x86: timer: Set up the timer in timer_early_get_count()

Simon Glass sjg at chromium.org
Mon Oct 21 03:31:54 UTC 2019


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 at chromium.org>
---

Changes in v3:
- Update commit message

Changes in v2: None

 drivers/timer/tsc_timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index 919caba8a14..f19d2237e4f 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;
 }
 
-- 
2.23.0.866.gb869b98d4c-goog



More information about the U-Boot mailing list