ArmPkg: delete PcdArmArchTimerFreqInHz

PcdArmArchTimerFreqInHz lets platforms override the architectural timer
frequency, but this really isn't supported in hardware by anything lower
than EL3. And we no longer support running edk2 at EL3.

So drop this Pcd and update ArmArchTimerLib to unconditionally use
ArmGenericTimerGetTimerFreq () instead.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
This commit is contained in:
Leif Lindholm 2024-06-19 18:29:30 +01:00 committed by mergify[bot]
parent 7ee89453b5
commit 0333faf50e
3 changed files with 2 additions and 24 deletions

View File

@ -314,11 +314,6 @@
gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease|0xFFFF|UINT16|0x30000059
[PcdsFixedAtBuild.common, PcdsDynamic.common]
#
# ARM Architectural Timer
#
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|0|UINT32|0x00000034
# ARM Architectural Timer Interrupt(GIC PPI) numbers
gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum|29|UINT32|0x00000035
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|30|UINT32|0x00000036

View File

@ -15,7 +15,7 @@
#include <Library/PcdLib.h>
#include <Library/ArmGenericTimerCounterLib.h>
#define TICKS_PER_MICRO_SEC (PcdGet32 (PcdArmArchTimerFreqInHz)/1000000U)
#define TICKS_PER_MICRO_SEC (ArmGenericTimerGetTimerFreq ()/1000000U)
// Select appropriate multiply function for platform architecture.
#ifdef MDE_CPU_ARM
@ -34,19 +34,6 @@ TimerConstructor (
// Check if the ARM Generic Timer Extension is implemented.
//
if (ArmIsArchTimerImplemented ()) {
//
// Check if Architectural Timer frequency is pre-determined by the platform
// (ie. nonzero).
//
if (PcdGet32 (PcdArmArchTimerFreqInHz) != 0) {
//
// Check if ticks/uS is not 0. The Architectural timer runs at constant
// frequency, irrespective of CPU frequency. According to Generic Timer
// Ref manual, lower bound of the frequency is in the range of 1-10MHz.
//
ASSERT (TICKS_PER_MICRO_SEC);
}
//
// Architectural Timer Frequency must be set in Secure privileged
// mode (if secure extension is supported).
@ -76,10 +63,7 @@ GetPlatformTimerFreq (
{
UINTN TimerFreq;
TimerFreq = PcdGet32 (PcdArmArchTimerFreqInHz);
if (TimerFreq == 0) {
TimerFreq = ArmGenericTimerGetTimerFreq ();
}
TimerFreq = ArmGenericTimerGetTimerFreq ();
return TimerFreq;
}

View File

@ -29,4 +29,3 @@
ArmGenericTimerCounterLib
[Pcd]
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz