mb/emulation/qemu-q35: don't select CONFIG_UNKNOWN_TSC_RATE#903
Open
SergiiDmytruk wants to merge 1 commit into
Open
mb/emulation/qemu-q35: don't select CONFIG_UNKNOWN_TSC_RATE#903SergiiDmytruk wants to merge 1 commit into
SergiiDmytruk wants to merge 1 commit into
Conversation
This option signifies missing implementation of tsc_freq_mhz() which results in tsc_freq_mhz() from src/arch/x86/timestamp.c returning zero. That zero in turn gets put into TIMESTAMP CBMEM table requiring payloads and user-space tools to figure the frequency on their own. Implement tsc_freq_mhz() to query timer frequency in coreboot, so it gets reported downstream. Change-Id: I88d1206c13f15a9f20c07b65dcec42ec614f7e6a Upstream-Status: Pending Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
miczyg1
reviewed
May 25, 2026
| /* Mimics implementation of acpi_fill_fadt() in southbridge/intel/i82801ix/fadt.c. */ | ||
| u16 pmbase = pci_read_config16(PCI_DEV(0, 0x1f, 0), 0x40) & 0xfffe; | ||
| u16 pm_tmr_blk = pmbase + PM1_TMR; | ||
| return inl(pm_tmr_blk); |
Contributor
There was a problem hiding this comment.
@SergiiDmytruk this returns the current tick, not the frequency. Am I right?
Member
Author
There was a problem hiding this comment.
Oh, right, not sure how I confused it for frequency which is actually hard-coded (as used by AcpiTimerLib selected for QEMU). Should it be simply returned here or better to make EDK handle 0 in some sensible way?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This option signifies missing implementation of
tsc_freq_mhz()which results intsc_freq_mhz()fromsrc/arch/x86/timestamp.creturning zero. That zero in turn gets put into TIMESTAMP CBMEM table requiring payloads and user-space tools to figure the frequency on their own.Dasharo/edk2@0beada2 fixed parsing of TIMESTAMP table, resulting in division by zero when starting QEMU. Addressing it in coreboot, similarly to the fix for APUs in #887. This fixes CI failures like https://github.com/Dasharo/coreboot/actions/runs/26337084146/job/77532919152#step:11:13.