summaryrefslogtreecommitdiff
path: root/ArmPkg/Include/Library
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-27 16:35:16 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-27 16:35:16 +0000
commitda9675a241ab9856377b9bd63504b2d5333b3c7a (patch)
tree15c8f64a5dbb56ef78dc059bbaa436c6e374ce2f /ArmPkg/Include/Library
parent0c0e7ef451a3f74d6756d6ec65685114b3dacea8 (diff)
downloadedk2-platforms-da9675a241ab9856377b9bd63504b2d5333b3c7a.tar.xz
ArmPkg: Add ARM Architectural Timer support
ARM Architectural Timer support is defined by the ARM Generic Timer Specification. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12455 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Include/Library')
-rw-r--r--ArmPkg/Include/Library/ArmLib.h2
-rw-r--r--ArmPkg/Include/Library/ArmV7ArchTimerLib.h115
2 files changed, 116 insertions, 1 deletions
diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
index e88633e1e9..3ce687244f 100644
--- a/ArmPkg/Include/Library/ArmLib.h
+++ b/ArmPkg/Include/Library/ArmLib.h
@@ -167,7 +167,7 @@ Cp15CacheInfo (
BOOLEAN
EFIAPI
-ArmIsMPCore (
+ArmIsMpCore (
VOID
);
diff --git a/ArmPkg/Include/Library/ArmV7ArchTimerLib.h b/ArmPkg/Include/Library/ArmV7ArchTimerLib.h
new file mode 100644
index 0000000000..d2f4a46c66
--- /dev/null
+++ b/ArmPkg/Include/Library/ArmV7ArchTimerLib.h
@@ -0,0 +1,115 @@
+/** @file
+
+ Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __ARM_V7_ARCH_TIMER_LIB_H__
+#define __ARM_V7_ARCH_TIMER_LIB_H__
+
+#define ARM_ARCH_TIMER_ENABLE (1 << 0)
+#define ARM_ARCH_TIMER_IMASK (1 << 1)
+#define ARM_ARCH_TIMER_ISTATUS (1 << 2)
+
+typedef enum {
+ CntFrq = 0,
+ CntPct,
+ CntkCtl,
+ CntpTval,
+ CntpCtl,
+ CntvTval,
+ CntvCtl,
+ CntvCt,
+ CntpCval,
+ CntvCval,
+ CntvOff,
+ CnthCtl,
+ CnthpTval,
+ CnthpCtl,
+ CnthpCval,
+ RegMaximum
+}ARM_ARCH_TIMER_REGS;
+
+VOID
+EFIAPI
+ArmArchTimerReadReg (
+ IN ARM_ARCH_TIMER_REGS Reg,
+ OUT VOID *DstBuf
+ );
+
+VOID
+EFIAPI
+ArmArchTimerWriteReg (
+ IN ARM_ARCH_TIMER_REGS Reg,
+ 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_V7_ARCH_TIMER_LIB_H__