Closed mhaeuser closed 5 years ago
My OC mod for AMD CPUs implements parsing the PM timer address from FADT. This is of course not a practical application since this effectively parses the ACPI context twice (once just enough to get to the FAD table and then once again in OcAcpiLib). Feel free to tear it into pieces though. Initializing the ACPI context only once would either require the initialization to be done in the constructor or the frequency calculations to be moved out of the constructor.
I'm currently working on parsing the timer address through FCH I/O in case you decide to not use FADT to retrieve the info.
@notiflux, @Download-Fritz
While this is nice and generic, after evaluating the problem more precisely, I am not too happy that the suggested approach requires ACPI for one more reason. This would break the contract OcTimerLib offers, i.e. timer support starting from construction onwards.
I checked AMD reference manuals, namely 51192_Bolton_FCH_RRG.pdf [1], and it seems that AMD ACPI PM timer is actually well described. See last part referencing AcpiPmTmrBlk on page 3-275.
I implemented a patch in OcSupportPkg that is supposed to work fine with most AMD CPUs.
[1] https://www.amd.com/system/files/TechDocs/51192_Bolton_FCH_RRG.pdf)
Of course it will, and I do not see what is wrong with it. 0x8086 is Intel vendor id.
oops, sorry... that happens when you only look at the commit and not at the file itself... lol
Currently, ACPI PM timer [1] support is implemented by retrieving its address via Intel PCH I/O. [2] When available, we should determine the ACPI PM timer address via its address fields in FADT [3], namely "PM_TMR_BLK" and "X_PM_TMR_BLK". To account for broken ACPI tables, the current code should be kept in place as a fallback for when the address cannot be retrieved via FADT.
@vit9696 proposed to split the OcCpuLib "OcCpuScanProcessor" interface [4] into "OcScanProcessorTopology" and "OcScanProcessorFrequency", latter of which would be called by OcAcpiLib with the address obtained by FADT, or 0 to fall back to detecting via Intel PCH I/O.
[1] ACPI Specification 6.3, 4.8.2.1 [2] https://github.com/acidanthera/OcSupportPkg/blob/master/Library/OcTimerLib/OcTimerLib.c#L50 [3] ACPI Specification 6.3, 5.2.9 [4] https://github.com/acidanthera/OcSupportPkg/blob/master/Library/OcCpuLib/OcCpuLib.c#L779