From a715d456de47187cbaad1747a398499180cac710 Mon Sep 17 00:00:00 2001 From: Leif Lindholm Date: Wed, 19 Jun 2024 15:41:33 +0100 Subject: [PATCH] ArmPkg: drop manual ARM programming of generic timer frequency There is a bit of legacy code in ArmArchTimerLib that attempts to program the generic timer based on a Pcd. This was only ever done for (32-bit) ARM in case the cpu lacked the Security Extensions (because if they were there, Secure firmware would be expected to have configured this before switching to Non-secure state). We don't support operation without Secure firmware anymore, but also the code has been incorrectly invoked only on platforms that *do* implement the Security Extensions since December 2020 and commit 0dd0d42ab5b6 ("ArmPkg: use helper to check for Security extensions in ArmArchTimerLib") As a result, edk2 has been overriding any programming done by Secure Firmware on ARM platforms. Which is wrong. Drop this programming in preparation for deleting the Pcd completely. Signed-off-by: Leif Lindholm --- ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c index d663a76a9b..00700395ef 100644 --- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c +++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c @@ -45,19 +45,6 @@ TimerConstructor ( // Ref manual, lower bound of the frequency is in the range of 1-10MHz. // ASSERT (TICKS_PER_MICRO_SEC); - - #ifdef MDE_CPU_ARM - // - // Only set the frequency for ARMv7. We expect the secure firmware to - // have already done it. - // If the security extension is not implemented, set Timer Frequency - // here. - // - if (ArmHasSecurityExtensions ()) { - ArmGenericTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz)); - } - - #endif } //