]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi: Use a fixed value for the timer clock
authorSimon Glass <sjg@chromium.org>
Fri, 10 Mar 2023 20:47:15 +0000 (12:47 -0800)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 13 Mar 2023 12:53:01 +0000 (13:53 +0100)
It is not yet clear how to read the timer via EFI. The current value seems
much too high on a Framework laptop I tried. Adjust it to a lower
hard-coded value for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/timer/tsc_timer.c

index 192c7b71a5a386f6d7d62e47ca170b9747f90eff..f86a0b86921c4d9983b15b1e772e68dcad1b0013 100644 (file)
@@ -404,6 +404,15 @@ static void tsc_timer_ensure_setup(bool early)
        if (!gd->arch.clock_rate) {
                unsigned long fast_calibrate;
 
+               /**
+                * There is no obvious way to obtain this information from EFI
+                * boot services. This value was measured on a Framework Laptop
+                * which has a 12th Gen Intel Core
+                */
+               if (IS_ENABLED(CONFIG_EFI_APP)) {
+                       fast_calibrate = 2750;
+                       goto done;
+               }
                fast_calibrate = native_calibrate_tsc();
                if (fast_calibrate)
                        goto done;