Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34709 )
Change subject: x86: Prevent Kconfig errors resulting in a brick ......................................................................
x86: Prevent Kconfig errors resulting in a brick
Always select USE_LEGACY_8254_TIMER if we know we have to.
Fixes boot failure (Linux kernel/GRUB2 hangs with no console output) on X11SSH-TF using SeaBIOS as payload.
Change-Id: Ica0c20255f661dd61edc3a7d15646b7447c4658e Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M payloads/external/GRUB2/Kconfig.name M payloads/external/SeaBIOS/Kconfig.name M src/device/Kconfig M src/soc/intel/common/block/timer/Kconfig 4 files changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/34709/1
diff --git a/payloads/external/GRUB2/Kconfig.name b/payloads/external/GRUB2/Kconfig.name index fe60d76..40629ad 100644 --- a/payloads/external/GRUB2/Kconfig.name +++ b/payloads/external/GRUB2/Kconfig.name @@ -1,6 +1,7 @@ config PAYLOAD_GRUB2 bool "GRUB2" depends on ARCH_X86 || ARCH_ARM + select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK help Select this option if you want to build a coreboot image with a GRUB2 payload. If you don't know what this is diff --git a/payloads/external/SeaBIOS/Kconfig.name b/payloads/external/SeaBIOS/Kconfig.name index bb1f30c..8f92997 100644 --- a/payloads/external/SeaBIOS/Kconfig.name +++ b/payloads/external/SeaBIOS/Kconfig.name @@ -1,6 +1,7 @@ config PAYLOAD_SEABIOS bool "SeaBIOS" depends on ARCH_X86 + select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK help Select this option if you want to build a coreboot image with a SeaBIOS payload. If you don't know what this is diff --git a/src/device/Kconfig b/src/device/Kconfig index e605bc2..ebf6bfb 100644 --- a/src/device/Kconfig +++ b/src/device/Kconfig @@ -86,6 +86,7 @@ bool "Run VGA Option ROMs" depends on PCI && (ARCH_X86 || ARCH_PPC64) && !MAINBOARD_FORCE_NATIVE_VGA_INIT select HAVE_VGA_TEXT_FRAMEBUFFER + select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK help Execute VGA Option ROMs in coreboot if found. This can be used to enable PCI/AGP/PCI-E video cards when not using a SeaBIOS diff --git a/src/soc/intel/common/block/timer/Kconfig b/src/soc/intel/common/block/timer/Kconfig index a214ef0..66bf9cf 100644 --- a/src/soc/intel/common/block/timer/Kconfig +++ b/src/soc/intel/common/block/timer/Kconfig @@ -5,7 +5,6 @@
config USE_LEGACY_8254_TIMER bool "Use Legacy 8254 Timer" - default y if PAYLOAD_SEABIOS || VGA_ROM_RUN default n help This sets the FSP UPD to enable Legacy 8254 clock gating. As per
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34709 )
Change subject: x86: Prevent Kconfig errors resulting in a brick ......................................................................
Patch Set 1:
Can you please separate the GRUB change?
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34709 )
Change subject: x86: Prevent Kconfig errors resulting in a brick ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@12 PS1, Line 12: on X11SSH-TF using SeaBIOS as payload. How does this change affect the kernel? Does the kernel hang depend on the chosen payload?
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34709 )
Change subject: x86: Prevent Kconfig errors resulting in a brick ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@12 PS1, Line 12: on X11SSH-TF using SeaBIOS as payload.
How does this change affect the kernel? Does the kernel hang depend […]
I can boot Linux from harddisk again, thus it doesn't hang any more. I haven't tested other payloads than SeaBIOS.
Christian Walter has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34709 )
Change subject: x86: Prevent Kconfig errors resulting in a brick ......................................................................
Patch Set 1: Code-Review+1
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34709 )
Change subject: x86: Prevent Kconfig errors resulting in a brick ......................................................................
Patch Set 1:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@9 PS1, Line 9: Always select USE_LEGACY_8254_TIMER if we know we have to. Better use that information as the commit message summary?
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@11 PS1, Line 11: Linux kernel/GRUB2 payload?
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@13 PS1, Line 13: Mention the commit breaking this in a Fixes: line?
Hello Patrick Rudolph, Christian Walter, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34709
to look at the new patch set (#2).
Change subject: soc/intel/common: Select USE_LEGACY_8254_TIMER ......................................................................
soc/intel/common: Select USE_LEGACY_8254_TIMER
Always select USE_LEGACY_8254_TIMER if we know we have to.
Default to y as there might be legacy software not under our control that needs the 8254 timer. Add a comment to evaluate if this should be changed to 'default n' in 10 years from now.
The following software needs 8254 timer: * SeaBios * Option ROMs * GRUB <2.03 * Linux <5.3
References: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=c8c40... http://git.savannah.gnu.org/cgit/grub.git/commit/?id=446794de8da4329ea532cbe...
Fixes boot failure on SeaBios and GRUB2 bootloader on X11SSH-TF using SeaBIOS as payload.
Change-Id: Ica0c20255f661dd61edc3a7d15646b7447c4658e Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M payloads/external/SeaBIOS/Kconfig.name M src/device/Kconfig M src/soc/intel/common/block/timer/Kconfig 3 files changed, 12 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/34709/2
Patrick Rudolph 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:
(4 comments)
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@9 PS1, Line 9: Always select USE_LEGACY_8254_TIMER if we know we have to.
Better use that information as the commit message summary?
Done
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@11 PS1, Line 11: Linux kernel/GRUB2
payload?
no, on disk
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@12 PS1, Line 12: on X11SSH-TF using SeaBIOS as payload.
I can boot Linux from harddisk again, thus it doesn't hang any more. […]
Done more test and it breaks SeaBios OptionROM execution and bootmenu timeout.
https://review.coreboot.org/c/coreboot/+/34709/1//COMMIT_MSG@13 PS1, Line 13:
Mention the commit breaking this in a Fixes: line?
I don't know the exact commit that made it break.
Frans Hendriks 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:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig File src/device/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig@89 PS2, Line 89: select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK What is the relation between VGA and 8254?
Paul Menzel 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:
(2 comments)
Why is only Intel affected?
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 SeaBIOS
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG@26 PS2, Line 26: SeaBios SeaBIOS
Patrick Rudolph 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:
(1 comment)
Patch Set 2:
(2 comments)
Why is only Intel affected?
USE_LEGACY_8254_TIMER is used on recent Intel platforms only.
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig File src/device/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig@89 PS2, Line 89: select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK
What is the relation between VGA and 8254?
Option ROMs use the 8254 PIT instead of HPET, TSC or ACPI PM timer as you need to switch to protected mode to use those. That isn't necessary when using the 8254 PIT.
Philipp Deppenwiese 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+2
Frans Hendriks 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:
(2 comments)
Patch Set 2:
(4 comments)
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG@9 PS2, Line 9: Always select USE_LEGACY_8254_TIMER if we know we have to. This patchset changes default of USE_LEGACY_8254_TIMER to Y unconditional. Shouldn't this line be removed.
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig File src/device/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig@89 PS2, Line 89: select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK
Option ROMs use the 8254 PIT instead of HPET, TSC or ACPI PM timer as you need to switch to protecte […]
Should this be enabled for VGA Oprom only? Or for all Oproms?
Frans Hendriks 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:
Patch Set 2:
(4 comments)
Will changing default to y in soc/intel/common/block/timer/Kconfig only solve the issue? Is update of the two other files required?
Patrick Rudolph 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:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG@9 PS2, Line 9: Always select USE_LEGACY_8254_TIMER if we know we have to.
This patchset changes default of USE_LEGACY_8254_TIMER to Y unconditional. […]
It also selects USE_LEGACY_8254_TIMER in specific cases to prevent a hang.
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig File src/device/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig@89 PS2, Line 89: select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK
Should this be enabled for VGA Oprom only? Or for all Oproms?
It should be enabled for all Oproms, but we only support VGA Oproms in coreboot.
Patrick Rudolph 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:
Patch Set 2:
Patch Set 2:
(4 comments)
Will changing default to y in soc/intel/common/block/timer/Kconfig only solve the issue? Is update of the two other files required?
No, as it allows to select *n* in cases where we actually know it will hang the computer. Once the affected software (SeaBios) has been fixed the "select" can be removed.
Angel Pons 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:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... File src/soc/intel/common/block/timer/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... PS2, Line 18: SeaBios SeaBIOS
Frans Hendriks 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
(2 comments)
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34709/2//COMMIT_MSG@9 PS2, Line 9: Always select USE_LEGACY_8254_TIMER if we know we have to.
It also selects USE_LEGACY_8254_TIMER in specific cases to prevent a hang.
Done
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig File src/device/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/device/Kconfig@89 PS2, Line 89: select USE_LEGACY_8254_TIMER if SOC_INTEL_COMMON_BLOCK
It should be enabled for all Oproms, but we only support VGA Oproms in coreboot.
Done
Patrick Rudolph 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:
@Google do you want default n if CHROMEOS?
Subrata Banik 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:
(1 comment)
@Furquan: do you see it might risk hatch ?
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... File src/soc/intel/common/block/timer/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... PS2, Line 8: default y making default y might break S0ix as in could see will disable 8254 static clock gating which is must for S0ix.
https://github.com/coreboot/coreboot/blob/cafbbf526180d8eb91a1c386667f2449b0...
Furquan Shaikh 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:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... File src/soc/intel/common/block/timer/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... PS2, Line 8: default y
making default y might break S0ix as in could see will disable 8254 static clock gating which is mus […]
+1 to what Subrata said. Setting this to 'y' is going to break behavior for all boards which did not have to do anything special until now because USE_LEGACY_8254_TIMER was always disabled by default unless PAYLOAD_SEABIOS or VGA_ROM_RUN were set. One example of this is S0ix. I am not sure if there are any other assumptions that other boards have made. In my opinion it could affect boards more than just CHROMEOS.
Furquan Shaikh 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
-1 to make sure this does not get submitted until we have arrived to a conclusion.
Patrick Rudolph 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:
(1 comment)
Libpayload also uses the 8254 in get_cpu_speed(). It might affect depthcharge if it's n, please verify.
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... File src/soc/intel/common/block/timer/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... PS2, Line 8: default y
+1 to what Subrata said. […]
Looking at the git history there's NO board that every selected 8254 clock gating. The default to n was introduced in 85d3b40a19358c4014eceaea3204feece8b15edd, but there's no hint that it's related to S0ix.
Subrata Banik 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:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... File src/soc/intel/common/block/timer/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... PS2, Line 8: default y
Looking at the git history there's NO board that every selected 8254 clock gating. […]
https://github.com/coreboot/coreboot/blob/cafbbf526180d8eb91a1c386667f2449b0...
Nico Huber 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:
Libpayload also uses the 8254 in get_cpu_speed(). It might affect depthcharge if it's n, please verify.
I have a WIP patch for libpayload, will try to clean it up soon. Generally, I think getting rid of the 8254 requirement is less work than debating this change here (exception: legacy BIOS).
Angel Pons 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
(1 comment)
-1, as the current approach could break other boards.
Patch Set 2:
Libpayload also uses the 8254 in get_cpu_speed(). It might affect depthcharge if it's n, please verify.
I have a WIP patch for libpayload, will try to clean it up soon. Generally, I think getting rid of the 8254 requirement is less work than debating this change here (exception: legacy BIOS).
Yeah, I think this would be best.
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... File src/soc/intel/common/block/timer/Kconfig:
https://review.coreboot.org/c/coreboot/+/34709/2/src/soc/intel/common/block/... PS2, Line 8: default y
https://github. […]
Maybe add a Kconfig symbol named MAINBOARD_USES_S0IX so that USE_LEGACY_8254_TIMER depends on !MAINBOARD_USES_S0IX ?
Paul Menzel 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:
Patch Set 2:
Libpayload also uses the 8254 in get_cpu_speed(). It might affect depthcharge if it's n, please verify.
I have a WIP patch for libpayload, will try to clean it up soon. Generally, I think getting rid of the 8254 requirement is less work than debating this change here (exception: legacy BIOS).
Could you upload it in its current state for testing?
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()); ```
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:
related changes: CB:45960, CB:46301
Martin L Roth has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/34709?usp=email )
Change subject: soc/intel/common: Select USE_LEGACY_8254_TIMER ......................................................................
Abandoned
This patch has not been touched in over 12 months. Anyone who wants to take over work on this patch, please feel free to restore it and do any work needed to get it merged. If you create a new patch based on this work, please credit the original author.