summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2014-09-09 16:10:18 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-09-09 16:10:18 +0000
commit4f6d34b434c0f063c68bdd4445da9097358b9afc (patch)
treedca84d7173f6b2dce31edbd1022f151d68d276fe
parent2785509b57d9ff92321c1083aab4a5ffc9519961 (diff)
downloadedk2-4f6d34b434c0f063c68bdd4445da9097358b9afc.tar.gz
edk2-4f6d34b434c0f063c68bdd4445da9097358b9afc.tar.bz2
edk2-4f6d34b434c0f063c68bdd4445da9097358b9afc.zip
ArmPkg: Move TimerDxe and ArmArchTimerLib to new ArmGenericTimerCounterLib
Move TimerDxe and ArmArchTimerLib to ArmGenericTimerCounterLib, and update all platforms to select the physical counter instance they have been using implicitly all along. Contributed-under: TianoCore Contribution Agreement 1.0 Acked-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16078 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--ArmPkg/ArmPkg.dsc1
-rw-r--r--ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.c5
-rw-r--r--ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf4
-rw-r--r--ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c5
-rw-r--r--ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf2
-rw-r--r--ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.c4
-rw-r--r--ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.inf3
-rw-r--r--ArmPkg/Drivers/TimerDxe/TimerDxe.c27
-rw-r--r--ArmPkg/Drivers/TimerDxe/TimerDxe.inf1
-rw-r--r--ArmPkg/Include/Library/ArmArchTimer.h60
-rw-r--r--ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c14
-rw-r--r--ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf1
-rw-r--r--ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimer.c107
-rw-r--r--ArmPkg/Library/ArmLib/ArmV7/ArmV7ArchTimer.c107
-rw-r--r--ArmPlatformPkg/ArmPlatformPkg.dsc1
-rw-r--r--ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc1
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc1
17 files changed, 37 insertions, 307 deletions
diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 4a02517c4b..3a51b5ce1c 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -64,6 +64,7 @@
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
+ ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
diff --git a/ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.c b/ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.c
index 585695a7dd..a1678febc4 100644
--- a/ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.c
+++ b/ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.c
@@ -15,9 +15,8 @@
#include <Base.h>
#include <Library/ArmLib.h>
#include <Library/ArmCpuLib.h>
-#include <Library/ArmArchTimer.h>
+#include <Library/ArmGenericTimerCounterLib.h>
#include <Library/DebugLib.h>
-#include <Library/IoLib.h>
#include <Library/PcdLib.h>
#include <Chipset/ArmCortexA15.h>
@@ -39,7 +38,7 @@ ArmCpuSetup (
// Note: System Counter frequency can only be set in Secure privileged mode,
// if security extensions are implemented.
- ArmArchTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
+ ArmGenericTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
if (ArmIsMpCore()) {
// Turn on SMP coherency
diff --git a/ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf b/ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
index ed4bdc377d..bd9a733b46 100644
--- a/ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
+++ b/ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
@@ -1,5 +1,5 @@
#/* @file
-# Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+# Copyright (c) 2011-2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -25,7 +25,7 @@
[LibraryClasses]
ArmLib
- IoLib
+ ArmGenericTimerCounterLib
PcdLib
[Sources.common]
diff --git a/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c b/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c
index 97f1ced413..135bd6b86d 100644
--- a/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c
+++ b/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c
@@ -15,9 +15,8 @@
#include <Base.h>
#include <Library/ArmLib.h>
#include <Library/ArmCpuLib.h>
-#include <Library/ArmArchTimer.h>
+#include <Library/ArmGenericTimerCounterLib.h>
#include <Library/DebugLib.h>
-#include <Library/IoLib.h>
#include <Library/PcdLib.h>
#include <Chipset/ArmCortexA5x.h>
@@ -33,7 +32,7 @@ ArmCpuSetup (
// Note: System Counter frequency can only be set in Secure privileged mode,
// if security extensions are implemented.
- ArmArchTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
+ ArmGenericTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
if (ArmIsMpCore ()) {
// Turn on SMP coherency
diff --git a/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf b/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf
index acfa98d41d..e270220326 100644
--- a/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf
+++ b/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf
@@ -25,7 +25,7 @@
[LibraryClasses]
ArmLib
- IoLib
+ ArmGenericTimerCounterLib
PcdLib
[Sources.common]
diff --git a/ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.c b/ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.c
index 3e7fa124ce..9b1815f8f2 100644
--- a/ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.c
+++ b/ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.c
@@ -14,7 +14,7 @@
#include <Base.h>
#include <Library/ArmCpuLib.h>
-#include <Library/ArmArchTimer.h>
+#include <Library/ArmGenericTimerCounterLib.h>
#include <Library/PcdLib.h>
#include <Chipset/ArmAemV8.h>
@@ -26,7 +26,7 @@ ArmCpuSetup (
{
// Note: System Counter frequency can only be set in Secure privileged mode,
// if security extensions are implemented.
- ArmArchTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
+ ArmGenericTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
}
diff --git a/ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.inf b/ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.inf
index 0109cc53a3..1c8122082d 100644
--- a/ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.inf
+++ b/ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.inf
@@ -24,8 +24,7 @@
ArmPkg/ArmPkg.dec
[LibraryClasses]
- ArmLib
- IoLib
+ ArmGenericTimerCounterLib
PcdLib
[Sources.common]
diff --git a/ArmPkg/Drivers/TimerDxe/TimerDxe.c b/ArmPkg/Drivers/TimerDxe/TimerDxe.c
index 239a353269..3e5d8e72be 100644
--- a/ArmPkg/Drivers/TimerDxe/TimerDxe.c
+++ b/ArmPkg/Drivers/TimerDxe/TimerDxe.c
@@ -24,6 +24,7 @@
#include <Library/UefiLib.h>
#include <Library/PcdLib.h>
#include <Library/IoLib.h>
+#include <Library/ArmGenericTimerCounterLib.h>
#include <Library/ArmArchTimer.h>
#include <Protocol/Timer.h>
@@ -101,7 +102,7 @@ ExitBootServicesEvent (
IN VOID *Context
)
{
- ArmArchTimerDisableTimer ();
+ ArmGenericTimerDisableTimer ();
}
/**
@@ -144,7 +145,7 @@ TimerDriverSetTimerPeriod (
EFI_TPL OriginalTPL;
// Always disable the timer
- ArmArchTimerDisableTimer ();
+ ArmGenericTimerDisableTimer ();
if (TimerPeriod != 0) {
// mTimerTicks = TimerPeriod in 1ms unit x Frequency.10^-3
@@ -163,13 +164,13 @@ TimerDriverSetTimerPeriod (
gBS->RestoreTPL (OriginalTPL);
- // Get value of the current physical timer
- CounterValue = ArmReadCntPct ();
+ // Get value of the current timer
+ CounterValue = ArmGenericTimerGetSystemCount ();
// Set the interrupt in Current Time + mTimerTick
- ArmWriteCntpCval (CounterValue + mTimerTicks);
+ ArmGenericTimerSetCompareVal (CounterValue + mTimerTicks);
// Enable the timer
- ArmArchTimerEnableTimer ();
+ ArmGenericTimerEnableTimer ();
} else {
// Save the new timer period
mTimerPeriod = TimerPeriod;
@@ -307,7 +308,7 @@ TimerInterruptHandler (
OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
// Check if the timer interrupt is active
- if ((ArmArchTimerGetTimerCtrlReg () ) & ARM_ARCH_TIMER_ISTATUS) {
+ if ((ArmGenericTimerGetTimerCtrlReg () ) & ARM_ARCH_TIMER_ISTATUS) {
// Signal end of interrupt early to help avoid losing subsequent ticks from long duration handlers
gInterrupt->EndOfInterrupt (gInterrupt, Source);
@@ -321,9 +322,9 @@ TimerInterruptHandler (
//
// Get current counter value
- CurrentValue = ArmReadCntPct ();
+ CurrentValue = ArmGenericTimerGetSystemCount ();
// Get the counter value to compare with
- CompareValue = ArmReadCntpCval ();
+ CompareValue = ArmGenericTimerGetCompareVal ();
// This loop is needed in case we missed interrupts (eg: case when the interrupt handling
// has taken longer than mTickPeriod).
@@ -335,7 +336,7 @@ TimerInterruptHandler (
} while (CompareValue < CurrentValue);
// Set next compare value
- ArmWriteCntpCval (CompareValue);
+ ArmGenericTimerSetCompareVal (CompareValue);
}
// Enable timer interrupts
@@ -379,10 +380,10 @@ TimerInitialize (
ASSERT_EFI_ERROR (Status);
// Disable the timer
- TimerCtrlReg = ArmArchTimerGetTimerCtrlReg ();
+ TimerCtrlReg = ArmGenericTimerGetTimerCtrlReg ();
TimerCtrlReg |= ARM_ARCH_TIMER_IMASK;
TimerCtrlReg &= ~ARM_ARCH_TIMER_ENABLE;
- ArmArchTimerSetTimerCtrlReg (TimerCtrlReg);
+ ArmGenericTimerSetTimerCtrlReg (TimerCtrlReg);
Status = TimerDriverSetTimerPeriod (&gTimer, 0);
ASSERT_EFI_ERROR (Status);
@@ -416,7 +417,7 @@ TimerInitialize (
// Everything is ready, unmask and enable timer interrupts
TimerCtrlReg = ARM_ARCH_TIMER_ENABLE;
- ArmArchTimerSetTimerCtrlReg (TimerCtrlReg);
+ ArmGenericTimerSetTimerCtrlReg (TimerCtrlReg);
// Register for an ExitBootServicesEvent
Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesEvent, NULL, &EfiExitBootServicesEvent);
diff --git a/ArmPkg/Drivers/TimerDxe/TimerDxe.inf b/ArmPkg/Drivers/TimerDxe/TimerDxe.inf
index 161d286d9c..9e9768fbb5 100644
--- a/ArmPkg/Drivers/TimerDxe/TimerDxe.inf
+++ b/ArmPkg/Drivers/TimerDxe/TimerDxe.inf
@@ -41,6 +41,7 @@
DebugLib
UefiDriverEntryPoint
IoLib
+ ArmGenericTimerCounterLib
[Guids]
diff --git a/ArmPkg/Include/Library/ArmArchTimer.h b/ArmPkg/Include/Library/ArmArchTimer.h
index eb7e87d3c4..876c1f65c5 100644
--- a/ArmPkg/Include/Library/ArmArchTimer.h
+++ b/ArmPkg/Include/Library/ArmArchTimer.h
@@ -52,64 +52,4 @@ ArmArchTimerWriteReg (
IN VOID *SrcBuf
);
-VOID
-EFIAPI
-ArmArchTimerEnableTimer (
- VOID
- );
-
-VOID
-EFIAPI
-ArmArchTimerDisableTimer (
- VOID
- );
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerFreq (
- IN UINTN FreqInHz
- );
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerFreq (
- VOID
- );
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerVal (
- IN UINTN Val
- );
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerVal (
- VOID
- );
-
-UINT64
-EFIAPI
-ArmArchTimerGetSystemCount (
- VOID
- );
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerCtrlReg (
- VOID
- );
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerCtrlReg (
- UINTN Val
- );
-
-VOID
-EFIAPI
-ArmArchTimerSetCompareVal (
- IN UINT64 Val
- );
-
#endif // __ARM_ARCH_TIMER_H__
diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
index ec4c39dbc9..5d8e006cc9 100644
--- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
+++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c
@@ -20,7 +20,7 @@
#include <Library/TimerLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
-#include <Library/ArmArchTimer.h>
+#include <Library/ArmGenericTimerCounterLib.h>
#define TICKS_PER_MICRO_SEC (PcdGet32 (PcdArmArchTimerFreqInHz)/1000000U)
@@ -47,13 +47,13 @@ TimerConstructor (
// Only set the frequency for ARMv7. We expect the secure firmware to have already do it
// If the security extensions are not implemented set Timer Frequency
if ((ArmReadIdPfr1 () & ARM_PFR1_SEC) == 0x0) {
- ArmArchTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
+ ArmGenericTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz));
}
#endif
// Architectural Timer Frequency must be set in the Secure privileged(if secure extensions are supported) mode.
// If the reset value (0) is returned just ASSERT.
- TimerFreq = ArmArchTimerGetTimerFreq ();
+ TimerFreq = ArmGenericTimerGetTimerFreq ();
ASSERT (TimerFreq != 0);
} else {
@@ -88,13 +88,13 @@ MicroSecondDelay (
TimerTicks64 = (MicroSeconds * PcdGet32 (PcdArmArchTimerFreqInHz)) / 1000000U;
// Read System Counter value
- SystemCounterVal = ArmArchTimerGetSystemCount ();
+ SystemCounterVal = ArmGenericTimerGetSystemCount ();
TimerTicks64 += SystemCounterVal;
// Wait until delay count is expired.
while (SystemCounterVal < TimerTicks64) {
- SystemCounterVal = ArmArchTimerGetSystemCount ();
+ SystemCounterVal = ArmGenericTimerGetSystemCount ();
}
return MicroSeconds;
@@ -149,7 +149,7 @@ GetPerformanceCounter (
)
{
// Just return the value of system count
- return ArmArchTimerGetSystemCount ();
+ return ArmGenericTimerGetSystemCount ();
}
/**
@@ -192,5 +192,5 @@ GetPerformanceCounterProperties (
*EndValue = 0xFFFFFFFFFFFFFFFFUL;
}
- return (UINT64)ArmArchTimerGetTimerFreq ();
+ return (UINT64)ArmGenericTimerGetTimerFreq ();
}
diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
index ecdf0837f1..03a4b1efa6 100644
--- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
+++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
@@ -32,6 +32,7 @@
DebugLib
ArmLib
BaseLib
+ ArmGenericTimerCounterLib
[Pcd]
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimer.c b/ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimer.c
index 6a461eb2e4..63ce1978c0 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimer.c
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimer.c
@@ -166,110 +166,3 @@ ArmArchTimerWriteReg (
ASSERT (0);
}
}
-
-VOID
-EFIAPI
-ArmArchTimerEnableTimer (
- VOID
- )
-{
- UINTN TimerCtrlReg;
-
- ArmArchTimerReadReg (CntpCtl, (VOID *)&TimerCtrlReg);
- TimerCtrlReg |= ARM_ARCH_TIMER_ENABLE;
- ArmArchTimerWriteReg (CntpCtl, (VOID *)&TimerCtrlReg);
-}
-
-VOID
-EFIAPI
-ArmArchTimerDisableTimer (
- VOID
- )
-{
- UINTN TimerCtrlReg;
-
- ArmArchTimerReadReg (CntpCtl, (VOID *)&TimerCtrlReg);
- TimerCtrlReg &= ~ARM_ARCH_TIMER_ENABLE;
- ArmArchTimerWriteReg (CntpCtl, (VOID *)&TimerCtrlReg);
-}
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerFreq (
- IN UINTN FreqInHz
- )
-{
- ArmArchTimerWriteReg (CntFrq, (VOID *)&FreqInHz);
-}
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerFreq (
- VOID
- )
-{
- UINTN ArchTimerFreq = 0;
- ArmArchTimerReadReg (CntFrq, (VOID *)&ArchTimerFreq);
- return ArchTimerFreq;
-}
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerVal (
- VOID
- )
-{
- UINTN ArchTimerVal;
- ArmArchTimerReadReg (CntpTval, (VOID *)&ArchTimerVal);
- return ArchTimerVal;
-}
-
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerVal (
- IN UINTN Val
- )
-{
- ArmArchTimerWriteReg (CntpTval, (VOID *)&Val);
-}
-
-UINT64
-EFIAPI
-ArmArchTimerGetSystemCount (
- VOID
- )
-{
- UINT64 SystemCount;
- ArmArchTimerReadReg (CntPct, (VOID *)&SystemCount);
- return SystemCount;
-}
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerCtrlReg (
- VOID
- )
-{
- UINTN Val;
- ArmArchTimerReadReg (CntpCtl, (VOID *)&Val);
- return Val;
-}
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerCtrlReg (
- UINTN Val
- )
-{
- ArmArchTimerWriteReg (CntpCtl, (VOID *)&Val);
-}
-
-VOID
-EFIAPI
-ArmArchTimerSetCompareVal (
- IN UINT64 Val
- )
-{
- ArmArchTimerWriteReg (CntpCval, (VOID *)&Val);
-}
diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmV7ArchTimer.c b/ArmPkg/Library/ArmLib/ArmV7/ArmV7ArchTimer.c
index bebdafce7d..49be71bbe0 100644
--- a/ArmPkg/Library/ArmLib/ArmV7/ArmV7ArchTimer.c
+++ b/ArmPkg/Library/ArmLib/ArmV7/ArmV7ArchTimer.c
@@ -166,110 +166,3 @@ ArmArchTimerWriteReg (
ASSERT (0);
}
}
-
-VOID
-EFIAPI
-ArmArchTimerEnableTimer (
- VOID
- )
-{
- UINTN TimerCtrlReg;
-
- ArmArchTimerReadReg (CntpCtl, (VOID *)&TimerCtrlReg);
- TimerCtrlReg |= ARM_ARCH_TIMER_ENABLE;
- ArmArchTimerWriteReg (CntpCtl, (VOID *)&TimerCtrlReg);
-}
-
-VOID
-EFIAPI
-ArmArchTimerDisableTimer (
- VOID
- )
-{
- UINTN TimerCtrlReg;
-
- ArmArchTimerReadReg (CntpCtl, (VOID *)&TimerCtrlReg);
- TimerCtrlReg &= ~ARM_ARCH_TIMER_ENABLE;
- ArmArchTimerWriteReg (CntpCtl, (VOID *)&TimerCtrlReg);
-}
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerFreq (
- IN UINTN FreqInHz
- )
-{
- ArmArchTimerWriteReg (CntFrq, (VOID *)&FreqInHz);
-}
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerFreq (
- VOID
- )
-{
- UINTN ArchTimerFreq;
- ArmArchTimerReadReg (CntFrq, (VOID *)&ArchTimerFreq);
- return ArchTimerFreq;
-}
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerVal (
- VOID
- )
-{
- UINTN ArchTimerVal;
- ArmArchTimerReadReg (CntpTval, (VOID *)&ArchTimerVal);
- return ArchTimerVal;
-}
-
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerVal (
- IN UINTN Val
- )
-{
- ArmArchTimerWriteReg (CntpTval, (VOID *)&Val);
-}
-
-UINT64
-EFIAPI
-ArmArchTimerGetSystemCount (
- VOID
- )
-{
- UINT64 SystemCount;
- ArmArchTimerReadReg (CntPct, (VOID *)&SystemCount);
- return SystemCount;
-}
-
-UINTN
-EFIAPI
-ArmArchTimerGetTimerCtrlReg (
- VOID
- )
-{
- UINTN Val;
- ArmArchTimerReadReg (CntpCtl, (VOID *)&Val);
- return Val;
-}
-
-VOID
-EFIAPI
-ArmArchTimerSetTimerCtrlReg (
- UINTN Val
- )
-{
- ArmArchTimerWriteReg (CntpCtl, (VOID *)&Val);
-}
-
-VOID
-EFIAPI
-ArmArchTimerSetCompareVal (
- IN UINT64 Val
- )
-{
- ArmArchTimerWriteReg (CntpCval, (VOID *)&Val);
-}
diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc
index 420ab334c8..bed1b94436 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dsc
+++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
@@ -120,6 +120,7 @@
[LibraryClasses.AARCH64]
ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64Lib.inf
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.inf
+ ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
[LibraryClasses.common.SEC]
ArmPlatformSecLib|ArmPlatformPkg/Library/ArmPlatformSecLibNull/ArmPlatformLibNullSec.inf
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc
index 28a18eda3a..75dd11ca61 100644
--- a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc
+++ b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc
@@ -62,6 +62,7 @@
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
+ ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
# RealView Emulation Board Specific Libraries
EfiResetSystemLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/ResetSystemLib/ResetSystemLib.inf
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc
index 424c1311c5..8b5bcdf89e 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc
@@ -69,6 +69,7 @@
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
+ ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
# Versatile Express Specific Libraries
ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf