UefiCpuPkg/CpuDxeRiscV64: Use DT based timer frequency for CPU driver

There is GetPerformanceCounterProperties() that relies
on Device Tree to fetch timer frequency and removes the
dependency from the PCDs, use that instead.

Signed-off-by: Akshay Behl <cap2k4@rivosinc.com>

Co-authored-by: Dhaval Sharma <dhaval@rivosinc.com>
This commit is contained in:
Akshay Behl
2025-06-08 23:06:52 +05:30
committed by mergify[bot]
parent 8c721d68ea
commit 484930e0c6
3 changed files with 3 additions and 2 deletions

View File

@@ -269,7 +269,7 @@ CpuGetTimerValue (
if (TimerPeriod != NULL) {
*TimerPeriod = DivU64x32 (
1000000000000000u,
PcdGet64 (PcdCpuCoreCrystalClockFrequency)
GetPerformanceCounterProperties (NULL, NULL)
);
}

View File

@@ -17,6 +17,7 @@
#include <Library/BaseRiscVFpuLib.h>
#include <Library/BaseRiscVSbiLib.h>
#include <Library/BaseRiscVMmuLib.h>
#include <Library/TimerLib.h>
#include <Library/BaseLib.h>
#include <Library/CacheMaintenanceLib.h>
#include <Library/CpuExceptionHandlerLib.h>

View File

@@ -40,6 +40,7 @@
RiscVMmuLib
RiscVFpuLib
CacheMaintenanceLib
TimerLib
[Sources]
CpuDxe.c
@@ -62,7 +63,6 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuCoreCrystalClockFrequency ## CONSUMES
[Depex]
TRUE