summaryrefslogtreecommitdiff
path: root/drivers/timer/tsc_timer.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-08-27 19:44:25 -0600
committerSimon Glass <sjg@chromium.org>2024-10-18 14:10:21 -0600
commit3b2e4f542e3ea5d116d5830f4eef9be97d872312 (patch)
tree67c7f6ee2d38f7ecfe80ddf6cff9c89a151c4135 /drivers/timer/tsc_timer.c
parent6ab545ba21668132d9dad27026c91d298b6e5a77 (diff)
x86: Ensure the CPU identity exists for timer init
When bootstage is used the timer can be inited before the CPU identity is set up, resulting in the checks for the vendor not working. Add a special call to work around this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/timer/tsc_timer.c')
-rw-r--r--drivers/timer/tsc_timer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index 80c084f380d..d11227cf440 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -403,6 +403,10 @@ static void tsc_timer_ensure_setup(bool early)
if (!gd->arch.clock_rate) {
unsigned long fast_calibrate;
+ /* deal with this being called before x86_cpu_init_f() */
+ if (!gd->arch.x86_vendor)
+ x86_get_identity_for_timer();
+
/**
* There is no obvious way to obtain this information from EFI
* boot services. This value was measured on a Framework Laptop