diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2014-09-09 16:10:18 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-09-09 16:10:18 +0000 |
commit | 4f6d34b434c0f063c68bdd4445da9097358b9afc (patch) | |
tree | dca84d7173f6b2dce31edbd1022f151d68d276fe /ArmPkg/Library/ArmArchTimerLib | |
parent | 2785509b57d9ff92321c1083aab4a5ffc9519961 (diff) | |
download | edk2-4f6d34b434c0f063c68bdd4445da9097358b9afc.zip edk2-4f6d34b434c0f063c68bdd4445da9097358b9afc.tar.gz edk2-4f6d34b434c0f063c68bdd4445da9097358b9afc.tar.bz2 |
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
Diffstat (limited to 'ArmPkg/Library/ArmArchTimerLib')
-rw-r--r-- | ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c | 14 | ||||
-rw-r--r-- | ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c index ec4c39d..5d8e006 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 ecdf083..03a4b1e 100644 --- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf +++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf @@ -32,6 +32,7 @@ DebugLib
ArmLib
BaseLib
+ ArmGenericTimerCounterLib
[Pcd]
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz
|