Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34709 )
Change subject: soc/intel/common: Select USE_LEGACY_8254_TIMER ......................................................................
Patch Set 2: Code-Review-1
(3 comments)
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG@17 PS2, Line 17: * SeaBios this is not true anymore for years. seabios can use 8254 (pit), pm timer and even tsc.
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG@20 PS2, Line 20: * Linux <5.3 hmm, as I read that patch, that problem only occurs, when both hpet and pit is not available.
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c index 0e14f6c0d35e0..07c0e960b3f3b 100644 --- a/arch/x86/kernel/time.c +++ b/arch/x86/kernel/time.c @@ -82,8 +82,11 @@ static void __init setup_default_timer_irq(void) /* Default timer init function */ void __init hpet_time_init(void) { - if (!hpet_enable()) - setup_pit_timer(); + if (!hpet_enable()) { + if (!pit_timer_init()) + return; + } + setup_default_timer_irq(); }
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG@26 PS2, Line 26: GRUB2 GRUB2 supports other timers, too, but obviously not when booting from SeaBIOS. That seems to be a problem that IMO should be solved upstream in GRUB2 by trying other timers (pm, tsc) in legacy mode, too, instead of adding a workaround in coreboot.
grub-core/kern/i386/tsc.c
``` #if defined (GRUB_MACHINE_XEN) || defined (GRUB_MACHINE_XEN_PVH) (void) (grub_tsc_calibrate_from_xen () || calibrate_tsc_hardcode()); #elif defined (GRUB_MACHINE_EFI) (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); #elif defined (GRUB_MACHINE_COREBOOT) (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); #else (void) (grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); ```