summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Library
diff options
context:
space:
mode:
authorRyan Harkin <ryan.harkin@linaro.org>2013-02-21 16:40:10 +0000
committerRyan Harkin <ryan.harkin@linaro.org>2013-02-21 16:40:10 +0000
commitc553da4d0d9b3e65303656b2a4d497458aab74a7 (patch)
tree5092e86960926118d151bd336cf5b5b2637f87c0 /ArmPlatformPkg/Library
parent187c40a8a44f83cb3be1bbc8e999bc611349338a (diff)
parent6a23f2591fe0fa4aaf82393633ea2bd6951f7024 (diff)
Merge branch 'linaro-tracking-2013.02' into linaro-releaselinaro-uefi-2013.02
Diffstat (limited to 'ArmPlatformPkg/Library')
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.c152
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.inf88
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c168
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.inf80
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c210
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.c162
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S30
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm35
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c328
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf4
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNullSec.inf44
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformSecLibNull/ArmPlatformLibNullSec.c148
-rw-r--r--ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.c4
-rwxr-xr-xArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf110
-rw-r--r--ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c6
-rw-r--r--ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c368
-rw-r--r--ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c147
-rw-r--r--ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf6
-rw-r--r--ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.c520
-rw-r--r--ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.inf88
20 files changed, 1426 insertions, 1272 deletions
diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.c b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.c
index 278138759f..511d0f69de 100644
--- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.c
+++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.c
@@ -1,76 +1,76 @@
-/** @file
-*
-* Copyright (c) 2011-2012, 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
-* 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.
-*
-**/
-
-#include <PiDxe.h>
-#include <Library/ArmPlatformGlobalVariableLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/HobLib.h>
-#include <Library/PcdLib.h>
-
-#include <Guid/ArmGlobalVariableHob.h>
-
-UINTN mGlobalVariableBase = 0;
-
-RETURN_STATUS
-EFIAPI
-ArmPlatformGlobalVariableConstructor (
- VOID
- )
-{
- ARM_HOB_GLOBAL_VARIABLE *Hob;
-
- Hob = GetFirstGuidHob (&gArmGlobalVariableGuid);
- ASSERT (Hob != NULL);
-
- mGlobalVariableBase = Hob->GlobalVariableBase;
-
- return EFI_SUCCESS;
-}
-
-VOID
-ArmPlatformGetGlobalVariable (
- IN UINTN VariableOffset,
- IN UINTN VariableSize,
- OUT VOID* Variable
- )
-{
- if (mGlobalVariableBase == 0) {
- ArmPlatformGlobalVariableConstructor ();
- }
-
- CopyMem (Variable, (VOID*)(mGlobalVariableBase + VariableOffset), VariableSize);
-}
-
-VOID
-ArmPlatformSetGlobalVariable (
- IN UINTN VariableOffset,
- IN UINTN VariableSize,
- OUT VOID* Variable
- )
-{
- if (mGlobalVariableBase == 0) {
- ArmPlatformGlobalVariableConstructor ();
- }
-
- CopyMem ((VOID*)(mGlobalVariableBase + VariableOffset), Variable, VariableSize);
-}
-
-VOID*
-ArmPlatformGetGlobalVariableAddress (
- IN UINTN VariableOffset
- )
-{
- return (VOID*)(mGlobalVariableBase + VariableOffset);
-}
+/** @file
+*
+* Copyright (c) 2011-2012, 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
+* 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.
+*
+**/
+
+#include <PiDxe.h>
+#include <Library/ArmPlatformGlobalVariableLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/HobLib.h>
+#include <Library/PcdLib.h>
+
+#include <Guid/ArmGlobalVariableHob.h>
+
+UINTN mGlobalVariableBase = 0;
+
+RETURN_STATUS
+EFIAPI
+ArmPlatformGlobalVariableConstructor (
+ VOID
+ )
+{
+ ARM_HOB_GLOBAL_VARIABLE *Hob;
+
+ Hob = GetFirstGuidHob (&gArmGlobalVariableGuid);
+ ASSERT (Hob != NULL);
+
+ mGlobalVariableBase = Hob->GlobalVariableBase;
+
+ return EFI_SUCCESS;
+}
+
+VOID
+ArmPlatformGetGlobalVariable (
+ IN UINTN VariableOffset,
+ IN UINTN VariableSize,
+ OUT VOID* Variable
+ )
+{
+ if (mGlobalVariableBase == 0) {
+ ArmPlatformGlobalVariableConstructor ();
+ }
+
+ CopyMem (Variable, (VOID*)(mGlobalVariableBase + VariableOffset), VariableSize);
+}
+
+VOID
+ArmPlatformSetGlobalVariable (
+ IN UINTN VariableOffset,
+ IN UINTN VariableSize,
+ OUT VOID* Variable
+ )
+{
+ if (mGlobalVariableBase == 0) {
+ ArmPlatformGlobalVariableConstructor ();
+ }
+
+ CopyMem ((VOID*)(mGlobalVariableBase + VariableOffset), Variable, VariableSize);
+}
+
+VOID*
+ArmPlatformGetGlobalVariableAddress (
+ IN UINTN VariableOffset
+ )
+{
+ return (VOID*)(mGlobalVariableBase + VariableOffset);
+}
diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.inf b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.inf
index f2284ce4ca..a0835d25f9 100644
--- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.inf
+++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Dxe/DxeArmPlatformGlobalVariableLib.inf
@@ -1,44 +1,44 @@
-#/** @file
-# Timer library implementation
-#
-#
-# Copyright (c) 2011-2012, 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.
-#
-#**/
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = DxeArmPlatformGlobalVariableLib
- FILE_GUID = 53fa3cc3-23b7-4ec2-9bfa-30257d7e1135
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ArmPlatformGlobalVariableLib
-
- CONSTRUCTOR = ArmPlatformGlobalVariableConstructor
-
-[Sources.common]
- DxeArmPlatformGlobalVariableLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
-
-[LibraryClasses]
- BaseLib
- DebugLib
- HobLib
-
-[Guids]
- gArmGlobalVariableGuid
-
-[FixedPcd]
- gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
-
+#/** @file
+# Timer library implementation
+#
+#
+# Copyright (c) 2011-2012, 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.
+#
+#**/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = DxeArmPlatformGlobalVariableLib
+ FILE_GUID = 53fa3cc3-23b7-4ec2-9bfa-30257d7e1135
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = ArmPlatformGlobalVariableLib
+
+ CONSTRUCTOR = ArmPlatformGlobalVariableConstructor
+
+[Sources.common]
+ DxeArmPlatformGlobalVariableLib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
+
+[LibraryClasses]
+ BaseLib
+ DebugLib
+ HobLib
+
+[Guids]
+ gArmGlobalVariableGuid
+
+[FixedPcd]
+ gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
+
diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c
index 63aa3199fe..df3e12944d 100644
--- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c
+++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.c
@@ -1,84 +1,84 @@
-/** @file
-*
-* Copyright (c) 2011-2012, 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
-* 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.
-*
-**/
-
-#include <Uefi.h>
-#include <Library/ArmPlatformGlobalVariableLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PcdLib.h>
-#include <Library/DebugLib.h>
-
-// Declared by ArmPlatformPkg/PrePi Module
-extern UINTN mGlobalVariableBase;
-
-VOID
-ArmPlatformGetGlobalVariable (
- IN UINTN VariableOffset,
- IN UINTN VariableSize,
- OUT VOID* Variable
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
-
- GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize);
-
- if (VariableSize == 4) {
- *(UINT32*)Variable = ReadUnaligned32 ((CONST UINT32*)(GlobalVariableBase + VariableOffset));
- } else if (VariableSize == 8) {
- *(UINT64*)Variable = ReadUnaligned64 ((CONST UINT64*)(GlobalVariableBase + VariableOffset));
- } else {
- CopyMem (Variable, (VOID*)(GlobalVariableBase + VariableOffset), VariableSize);
- }
-}
-
-VOID
-ArmPlatformSetGlobalVariable (
- IN UINTN VariableOffset,
- IN UINTN VariableSize,
- OUT VOID* Variable
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
-
- GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize);
-
- if (VariableSize == 4) {
- WriteUnaligned32 ((UINT32*)(GlobalVariableBase + VariableOffset), *(UINT32*)Variable);
- } else if (VariableSize == 8) {
- WriteUnaligned64 ((UINT64*)(GlobalVariableBase + VariableOffset), *(UINT64*)Variable);
- } else {
- CopyMem ((VOID*)(GlobalVariableBase + VariableOffset), Variable, VariableSize);
- }
-}
-
-VOID*
-ArmPlatformGetGlobalVariableAddress (
- IN UINTN VariableOffset
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
-
- GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize);
-
- return (VOID*)(GlobalVariableBase + VariableOffset);
-}
+/** @file
+*
+* Copyright (c) 2011-2012, 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
+* 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.
+*
+**/
+
+#include <Uefi.h>
+#include <Library/ArmPlatformGlobalVariableLib.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+
+// Declared by ArmPlatformPkg/PrePi Module
+extern UINTN mGlobalVariableBase;
+
+VOID
+ArmPlatformGetGlobalVariable (
+ IN UINTN VariableOffset,
+ IN UINTN VariableSize,
+ OUT VOID* Variable
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
+
+ GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize);
+
+ if (VariableSize == 4) {
+ *(UINT32*)Variable = ReadUnaligned32 ((CONST UINT32*)(GlobalVariableBase + VariableOffset));
+ } else if (VariableSize == 8) {
+ *(UINT64*)Variable = ReadUnaligned64 ((CONST UINT64*)(GlobalVariableBase + VariableOffset));
+ } else {
+ CopyMem (Variable, (VOID*)(GlobalVariableBase + VariableOffset), VariableSize);
+ }
+}
+
+VOID
+ArmPlatformSetGlobalVariable (
+ IN UINTN VariableOffset,
+ IN UINTN VariableSize,
+ OUT VOID* Variable
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
+
+ GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize);
+
+ if (VariableSize == 4) {
+ WriteUnaligned32 ((UINT32*)(GlobalVariableBase + VariableOffset), *(UINT32*)Variable);
+ } else if (VariableSize == 8) {
+ WriteUnaligned64 ((UINT64*)(GlobalVariableBase + VariableOffset), *(UINT64*)Variable);
+ } else {
+ CopyMem ((VOID*)(GlobalVariableBase + VariableOffset), Variable, VariableSize);
+ }
+}
+
+VOID*
+ArmPlatformGetGlobalVariableAddress (
+ IN UINTN VariableOffset
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
+
+ GlobalVariableBase = PcdGet32 (PcdCPUCoresStackBase) + PcdGet32 (PcdCPUCorePrimaryStackSize) - PcdGet32 (PcdPeiGlobalVariableSize);
+
+ return (VOID*)(GlobalVariableBase + VariableOffset);
+}
diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.inf b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.inf
index a14f933221..8eea9d3821 100644
--- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.inf
+++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.inf
@@ -1,40 +1,40 @@
-#/** @file
-# ArmPlatformGlobalVariableLib library implementation
-#
-# Copyright (c) 2011-2012, 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.
-#
-#**/
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PeiArmPlatformGlobalVariableLib
- FILE_GUID = 3e03daf2-b7b4-45f7-80b2-12aba043391f
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ArmPlatformGlobalVariableLib
-
-[Sources.common]
- PeiArmPlatformGlobalVariableLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
-
-[LibraryClasses]
- BaseLib
- DebugLib
- PcdLib
-
-[FixedPcd]
- gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase
- gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
- gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
-
+#/** @file
+# ArmPlatformGlobalVariableLib library implementation
+#
+# Copyright (c) 2011-2012, 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.
+#
+#**/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PeiArmPlatformGlobalVariableLib
+ FILE_GUID = 3e03daf2-b7b4-45f7-80b2-12aba043391f
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = ArmPlatformGlobalVariableLib
+
+[Sources.common]
+ PeiArmPlatformGlobalVariableLib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
+
+[LibraryClasses]
+ BaseLib
+ DebugLib
+ PcdLib
+
+[FixedPcd]
+ gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase
+ gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize
+ gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize
+
diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
index 563e405f66..47430e302b 100644
--- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
+++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
@@ -1,105 +1,105 @@
-/** @file
-*
-* Copyright (c) 2011-2012, 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
-* 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.
-*
-**/
-
-#include <Uefi.h>
-#include <Library/ArmPlatformGlobalVariableLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PcdLib.h>
-#include <Library/DebugLib.h>
-
-#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize))) || \
- ((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet32 (PcdSystemMemoryBase)))
-
-// Declared by ArmPlatformPkg/PrePi Module
-extern UINTN mGlobalVariableBase;
-
-VOID
-ArmPlatformGetGlobalVariable (
- IN UINTN VariableOffset,
- IN UINTN VariableSize,
- OUT VOID* Variable
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
-
- if (IS_XIP()) {
- // In Case of XIP, we expect the Primary Stack at the top of the System Memory
- // The size must be 64bit aligned to allow 64bit variable to be aligned
- GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
- } else {
- GlobalVariableBase = mGlobalVariableBase;
- }
-
- if (VariableSize == 4) {
- *(UINT32*)Variable = ReadUnaligned32 ((CONST UINT32*)(GlobalVariableBase + VariableOffset));
- } else if (VariableSize == 8) {
- *(UINT64*)Variable = ReadUnaligned64 ((CONST UINT64*)(GlobalVariableBase + VariableOffset));
- } else {
- CopyMem (Variable, (VOID*)(GlobalVariableBase + VariableOffset), VariableSize);
- }
-}
-
-VOID
-ArmPlatformSetGlobalVariable (
- IN UINTN VariableOffset,
- IN UINTN VariableSize,
- OUT VOID* Variable
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
-
- if (IS_XIP()) {
- // In Case of XIP, we expect the Primary Stack at the top of the System Memory
- // The size must be 64bit aligned to allow 64bit variable to be aligned
- GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
- } else {
- GlobalVariableBase = mGlobalVariableBase;
- }
-
- if (VariableSize == 4) {
- WriteUnaligned32 ((UINT32*)(GlobalVariableBase + VariableOffset), *(UINT32*)Variable);
- } else if (VariableSize == 8) {
- WriteUnaligned64 ((UINT64*)(GlobalVariableBase + VariableOffset), *(UINT64*)Variable);
- } else {
- CopyMem ((VOID*)(GlobalVariableBase + VariableOffset), Variable, VariableSize);
- }
-}
-
-VOID*
-ArmPlatformGetGlobalVariableAddress (
- IN UINTN VariableOffset
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
-
- if (IS_XIP()) {
- // In Case of XIP, we expect the Primary Stack at the top of the System Memory
- // The size must be 64bit aligned to allow 64bit variable to be aligned
- GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
- } else {
- GlobalVariableBase = mGlobalVariableBase;
- }
-
- return (VOID*)(GlobalVariableBase + VariableOffset);
-}
+/** @file
+*
+* Copyright (c) 2011-2012, 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
+* 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.
+*
+**/
+
+#include <Uefi.h>
+#include <Library/ArmPlatformGlobalVariableLib.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+
+#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize))) || \
+ ((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet32 (PcdSystemMemoryBase)))
+
+// Declared by ArmPlatformPkg/PrePi Module
+extern UINTN mGlobalVariableBase;
+
+VOID
+ArmPlatformGetGlobalVariable (
+ IN UINTN VariableOffset,
+ IN UINTN VariableSize,
+ OUT VOID* Variable
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
+
+ if (IS_XIP()) {
+ // In Case of XIP, we expect the Primary Stack at the top of the System Memory
+ // The size must be 64bit aligned to allow 64bit variable to be aligned
+ GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
+ } else {
+ GlobalVariableBase = mGlobalVariableBase;
+ }
+
+ if (VariableSize == 4) {
+ *(UINT32*)Variable = ReadUnaligned32 ((CONST UINT32*)(GlobalVariableBase + VariableOffset));
+ } else if (VariableSize == 8) {
+ *(UINT64*)Variable = ReadUnaligned64 ((CONST UINT64*)(GlobalVariableBase + VariableOffset));
+ } else {
+ CopyMem (Variable, (VOID*)(GlobalVariableBase + VariableOffset), VariableSize);
+ }
+}
+
+VOID
+ArmPlatformSetGlobalVariable (
+ IN UINTN VariableOffset,
+ IN UINTN VariableSize,
+ OUT VOID* Variable
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
+
+ if (IS_XIP()) {
+ // In Case of XIP, we expect the Primary Stack at the top of the System Memory
+ // The size must be 64bit aligned to allow 64bit variable to be aligned
+ GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
+ } else {
+ GlobalVariableBase = mGlobalVariableBase;
+ }
+
+ if (VariableSize == 4) {
+ WriteUnaligned32 ((UINT32*)(GlobalVariableBase + VariableOffset), *(UINT32*)Variable);
+ } else if (VariableSize == 8) {
+ WriteUnaligned64 ((UINT64*)(GlobalVariableBase + VariableOffset), *(UINT64*)Variable);
+ } else {
+ CopyMem ((VOID*)(GlobalVariableBase + VariableOffset), Variable, VariableSize);
+ }
+}
+
+VOID*
+ArmPlatformGetGlobalVariableAddress (
+ IN UINTN VariableOffset
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdPeiGlobalVariableSize));
+
+ if (IS_XIP()) {
+ // In Case of XIP, we expect the Primary Stack at the top of the System Memory
+ // The size must be 64bit aligned to allow 64bit variable to be aligned
+ GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
+ } else {
+ GlobalVariableBase = mGlobalVariableBase;
+ }
+
+ return (VOID*)(GlobalVariableBase + VariableOffset);
+}
diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.c b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.c
index 42d903f3d6..978ba33369 100644
--- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.c
+++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.c
@@ -1,81 +1,81 @@
-/** @file
-*
-* Copyright (c) 2011-2012, 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
-* 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.
-*
-**/
-
-#include <Uefi.h>
-#include <Library/ArmPlatformGlobalVariableLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PcdLib.h>
-#include <Library/DebugLib.h>
-
-VOID
-ArmPlatformGetGlobalVariable (
- IN UINTN VariableOffset,
- IN UINTN VariableSize,
- OUT VOID* Variable
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdSecGlobalVariableSize));
-
- GlobalVariableBase = PcdGet32 (PcdCPUCoresSecStackBase) + PcdGet32 (PcdCPUCoreSecPrimaryStackSize) - PcdGet32 (PcdSecGlobalVariableSize);
-
- if (VariableSize == 4) {
- *(UINT32*)Variable = ReadUnaligned32 ((CONST UINT32*)(GlobalVariableBase + VariableOffset));
- } else if (VariableSize == 8) {
- *(UINT64*)Variable = ReadUnaligned64 ((CONST UINT64*)(GlobalVariableBase + VariableOffset));
- } else {
- CopyMem (Variable, (VOID*)(GlobalVariableBase + VariableOffset), VariableSize);
- }
-}
-
-VOID
-ArmPlatformSetGlobalVariable (
- IN UINTN VariableOffset,
- IN UINTN VariableSize,
- OUT VOID* Variable
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdSecGlobalVariableSize));
-
- GlobalVariableBase = PcdGet32 (PcdCPUCoresSecStackBase) + PcdGet32 (PcdCPUCoreSecPrimaryStackSize) - PcdGet32 (PcdSecGlobalVariableSize);
-
- if (VariableSize == 4) {
- WriteUnaligned32 ((UINT32*)(GlobalVariableBase + VariableOffset), *(UINT32*)Variable);
- } else if (VariableSize == 8) {
- WriteUnaligned64 ((UINT64*)(GlobalVariableBase + VariableOffset), *(UINT64*)Variable);
- } else {
- CopyMem ((VOID*)(GlobalVariableBase + VariableOffset), Variable, VariableSize);
- }
-}
-
-VOID*
-ArmPlatformGetGlobalVariableAddress (
- IN UINTN VariableOffset
- )
-{
- UINTN GlobalVariableBase;
-
- // Ensure the Global Variable Size have been initialized
- ASSERT (VariableOffset < PcdGet32 (PcdSecGlobalVariableSize));
-
- GlobalVariableBase = PcdGet32 (PcdCPUCoresSecStackBase) + PcdGet32 (PcdCPUCoreSecPrimaryStackSize) - PcdGet32 (PcdSecGlobalVariableSize);
-
- return (VOID*)(GlobalVariableBase + VariableOffset);
-}
+/** @file
+*
+* Copyright (c) 2011-2012, 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
+* 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.
+*
+**/
+
+#include <Uefi.h>
+#include <Library/ArmPlatformGlobalVariableLib.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+
+VOID
+ArmPlatformGetGlobalVariable (
+ IN UINTN VariableOffset,
+ IN UINTN VariableSize,
+ OUT VOID* Variable
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdSecGlobalVariableSize));
+
+ GlobalVariableBase = PcdGet32 (PcdCPUCoresSecStackBase) + PcdGet32 (PcdCPUCoreSecPrimaryStackSize) - PcdGet32 (PcdSecGlobalVariableSize);
+
+ if (VariableSize == 4) {
+ *(UINT32*)Variable = ReadUnaligned32 ((CONST UINT32*)(GlobalVariableBase + VariableOffset));
+ } else if (VariableSize == 8) {
+ *(UINT64*)Variable = ReadUnaligned64 ((CONST UINT64*)(GlobalVariableBase + VariableOffset));
+ } else {
+ CopyMem (Variable, (VOID*)(GlobalVariableBase + VariableOffset), VariableSize);
+ }
+}
+
+VOID
+ArmPlatformSetGlobalVariable (
+ IN UINTN VariableOffset,
+ IN UINTN VariableSize,
+ OUT VOID* Variable
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdSecGlobalVariableSize));
+
+ GlobalVariableBase = PcdGet32 (PcdCPUCoresSecStackBase) + PcdGet32 (PcdCPUCoreSecPrimaryStackSize) - PcdGet32 (PcdSecGlobalVariableSize);
+
+ if (VariableSize == 4) {
+ WriteUnaligned32 ((UINT32*)(GlobalVariableBase + VariableOffset), *(UINT32*)Variable);
+ } else if (VariableSize == 8) {
+ WriteUnaligned64 ((UINT64*)(GlobalVariableBase + VariableOffset), *(UINT64*)Variable);
+ } else {
+ CopyMem ((VOID*)(GlobalVariableBase + VariableOffset), Variable, VariableSize);
+ }
+}
+
+VOID*
+ArmPlatformGetGlobalVariableAddress (
+ IN UINTN VariableOffset
+ )
+{
+ UINTN GlobalVariableBase;
+
+ // Ensure the Global Variable Size have been initialized
+ ASSERT (VariableOffset < PcdGet32 (PcdSecGlobalVariableSize));
+
+ GlobalVariableBase = PcdGet32 (PcdCPUCoresSecStackBase) + PcdGet32 (PcdCPUCoreSecPrimaryStackSize) - PcdGet32 (PcdSecGlobalVariableSize);
+
+ return (VOID*)(GlobalVariableBase + VariableOffset);
+}
diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S
new file mode 100644
index 0000000000..286327956a
--- /dev/null
+++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S
@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2012, 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
+// 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.
+//
+//
+
+#include <Library/ArmLib.h>
+
+.text
+.align 3
+
+GCC_ASM_EXPORT(ArmPlatformGetCorePosition)
+
+//UINTN
+//ArmPlatformGetCorePosition (
+// IN UINTN MpId
+// );
+ASM_PFX(ArmPlatformGetCorePosition):
+ and r1, r0, #ARM_CORE_MASK
+ and r0, r0, #ARM_CLUSTER_MASK
+ add r0, r1, r0, LSR #7
+ bx lr
+
diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm
new file mode 100644
index 0000000000..25ffbcf9c0
--- /dev/null
+++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm
@@ -0,0 +1,35 @@
+//
+// Copyright (c) 2012, 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
+// 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.
+//
+//
+
+#include <Library/ArmLib.h>
+
+ INCLUDE AsmMacroIoLib.inc
+
+ EXPORT ArmPlatformGetCorePosition
+
+ PRESERVE8
+ AREA ArmPlatformNullHelper, CODE, READONLY
+
+//UINTN
+//ArmPlatformGetCorePosition (
+// IN UINTN MpId
+// );
+ArmPlatformGetCorePosition FUNCTION
+ and r1, r0, #ARM_CORE_MASK
+ and r0, r0, #ARM_CLUSTER_MASK
+ add r0, r1, r0, LSR #7
+ bx lr
+ ENDFUNC
+
+ END
+
diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c
index 235eb673f7..f3a7efcae0 100644
--- a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c
+++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.c
@@ -1,164 +1,164 @@
-/** @file
-*
-* Copyright (c) 2011-2012, 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
-* 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.
-*
-**/
-
-#include <Library/ArmLib.h>
-#include <Library/ArmPlatformLib.h>
-
-#include <Ppi/ArmMpCoreInfo.h>
-
-
-ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] = {
- {
- // Cluster 0, Core 0
- 0x0, 0x0,
-
- // MP Core MailBox Set/Get/Clear Addresses and Clear Value
- (EFI_PHYSICAL_ADDRESS)0,
- (EFI_PHYSICAL_ADDRESS)0,
- (EFI_PHYSICAL_ADDRESS)0,
- (UINT64)0xFFFFFFFF
- },
- {
- // Cluster 0, Core 1
- 0x0, 0x1,
-
- // MP Core MailBox Set/Get/Clear Addresses and Clear Value
- (EFI_PHYSICAL_ADDRESS)0,
- (EFI_PHYSICAL_ADDRESS)0,
- (EFI_PHYSICAL_ADDRESS)0,
- (UINT64)0xFFFFFFFF
- },
- {
- // Cluster 0, Core 2
- 0x0, 0x2,
-
- // MP Core MailBox Set/Get/Clear Addresses and Clear Value
- (EFI_PHYSICAL_ADDRESS)0,
- (EFI_PHYSICAL_ADDRESS)0,
- (EFI_PHYSICAL_ADDRESS)0,
- (UINT64)0xFFFFFFFF
- },
- {
- // Cluster 0, Core 3
- 0x0, 0x3,
-
- // MP Core MailBox Set/Get/Clear Addresses and Clear Value
- (EFI_PHYSICAL_ADDRESS)0,
- (EFI_PHYSICAL_ADDRESS)0,
- (EFI_PHYSICAL_ADDRESS)0,
- (UINT64)0xFFFFFFFF
- }
-};
-
-// This function should be better located into TimerLib implementation
-RETURN_STATUS
-EFIAPI
-TimerConstructor (
- VOID
- )
-{
- return EFI_SUCCESS;
-}
-
-/**
- Return the current Boot Mode
-
- This function returns the boot reason on the platform
-
-**/
-EFI_BOOT_MODE
-ArmPlatformGetBootMode (
- VOID
- )
-{
- return BOOT_WITH_FULL_CONFIGURATION;
-}
-
-/**
- Initialize controllers that must setup in the normal world
-
- This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
- in the PEI phase.
-
-**/
-RETURN_STATUS
-ArmPlatformInitialize (
- IN UINTN MpId
- )
-{
- if (!IS_PRIMARY_CORE(MpId)) {
- return RETURN_SUCCESS;
- }
-
- //TODO: Implement me
-
- return RETURN_SUCCESS;
-}
-
-/**
- Initialize the system (or sometimes called permanent) memory
-
- This memory is generally represented by the DRAM.
-
-**/
-VOID
-ArmPlatformInitializeSystemMemory (
- VOID
- )
-{
- //TODO: Implement me
-}
-
-EFI_STATUS
-PrePeiCoreGetMpCoreInfo (
- OUT UINTN *CoreCount,
- OUT ARM_CORE_INFO **ArmCoreTable
- )
-{
- if (ArmIsMpCore()) {
- *CoreCount = sizeof(mArmPlatformNullMpCoreInfoTable) / sizeof(ARM_CORE_INFO);
- *ArmCoreTable = mArmPlatformNullMpCoreInfoTable;
- return EFI_SUCCESS;
- } else {
- return EFI_UNSUPPORTED;
- }
-}
-
-// Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
-EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
-ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
-
-EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
- {
- EFI_PEI_PPI_DESCRIPTOR_PPI,
- &mArmMpCoreInfoPpiGuid,
- &mMpCoreInfoPpi
- }
-};
-
-VOID
-ArmPlatformGetPlatformPpiList (
- OUT UINTN *PpiListSize,
- OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
- )
-{
- if (ArmIsMpCore()) {
- *PpiListSize = sizeof(gPlatformPpiTable);
- *PpiList = gPlatformPpiTable;
- } else {
- *PpiListSize = 0;
- *PpiList = NULL;
- }
-}
-
+/** @file
+*
+* Copyright (c) 2011-2012, 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
+* 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.
+*
+**/
+
+#include <Library/ArmLib.h>
+#include <Library/ArmPlatformLib.h>
+
+#include <Ppi/ArmMpCoreInfo.h>
+
+
+ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] = {
+ {
+ // Cluster 0, Core 0
+ 0x0, 0x0,
+
+ // MP Core MailBox Set/Get/Clear Addresses and Clear Value
+ (EFI_PHYSICAL_ADDRESS)0,
+ (EFI_PHYSICAL_ADDRESS)0,
+ (EFI_PHYSICAL_ADDRESS)0,
+ (UINT64)0xFFFFFFFF
+ },
+ {
+ // Cluster 0, Core 1
+ 0x0, 0x1,
+
+ // MP Core MailBox Set/Get/Clear Addresses and Clear Value
+ (EFI_PHYSICAL_ADDRESS)0,
+ (EFI_PHYSICAL_ADDRESS)0,
+ (EFI_PHYSICAL_ADDRESS)0,
+ (UINT64)0xFFFFFFFF
+ },
+ {
+ // Cluster 0, Core 2
+ 0x0, 0x2,
+
+ // MP Core MailBox Set/Get/Clear Addresses and Clear Value
+ (EFI_PHYSICAL_ADDRESS)0,
+ (EFI_PHYSICAL_ADDRESS)0,
+ (EFI_PHYSICAL_ADDRESS)0,
+ (UINT64)0xFFFFFFFF
+ },
+ {
+ // Cluster 0, Core 3
+ 0x0, 0x3,
+
+ // MP Core MailBox Set/Get/Clear Addresses and Clear Value
+ (EFI_PHYSICAL_ADDRESS)0,
+ (EFI_PHYSICAL_ADDRESS)0,
+ (EFI_PHYSICAL_ADDRESS)0,
+ (UINT64)0xFFFFFFFF
+ }
+};
+
+// This function should be better located into TimerLib implementation
+RETURN_STATUS
+EFIAPI
+TimerConstructor (
+ VOID
+ )
+{
+ return EFI_SUCCESS;
+}
+
+/**
+ Return the current Boot Mode
+
+ This function returns the boot reason on the platform
+
+**/
+EFI_BOOT_MODE
+ArmPlatformGetBootMode (
+ VOID
+ )
+{
+ return BOOT_WITH_FULL_CONFIGURATION;
+}
+
+/**
+ Initialize controllers that must setup in the normal world
+
+ This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
+ in the PEI phase.
+
+**/
+RETURN_STATUS
+ArmPlatformInitialize (
+ IN UINTN MpId
+ )
+{
+ if (!IS_PRIMARY_CORE(MpId)) {
+ return RETURN_SUCCESS;
+ }
+
+ //TODO: Implement me
+
+ return RETURN_SUCCESS;
+}
+
+/**
+ Initialize the system (or sometimes called permanent) memory
+
+ This memory is generally represented by the DRAM.
+
+**/
+VOID
+ArmPlatformInitializeSystemMemory (
+ VOID
+ )
+{
+ //TODO: Implement me
+}
+
+EFI_STATUS
+PrePeiCoreGetMpCoreInfo (
+ OUT UINTN *CoreCount,
+ OUT ARM_CORE_INFO **ArmCoreTable
+ )
+{
+ if (ArmIsMpCore()) {
+ *CoreCount = sizeof(mArmPlatformNullMpCoreInfoTable) / sizeof(ARM_CORE_INFO);
+ *ArmCoreTable = mArmPlatformNullMpCoreInfoTable;
+ return EFI_SUCCESS;
+ } else {
+ return EFI_UNSUPPORTED;
+ }
+}
+
+// Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
+EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
+ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
+
+EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
+ {
+ EFI_PEI_PPI_DESCRIPTOR_PPI,
+ &mArmMpCoreInfoPpiGuid,
+ &mMpCoreInfoPpi
+ }
+};
+
+VOID
+ArmPlatformGetPlatformPpiList (
+ OUT UINTN *PpiListSize,
+ OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
+ )
+{
+ if (ArmIsMpCore()) {
+ *PpiListSize = sizeof(gPlatformPpiTable);
+ *PpiList = gPlatformPpiTable;
+ } else {
+ *PpiListSize = 0;
+ *PpiList = NULL;
+ }
+}
+
diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf
index 13c62a60c8..a6c2e8f48e 100644
--- a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf
+++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf
@@ -33,6 +33,10 @@
ArmPlatformLibNull.c
ArmPlatformLibNullMem.c
+[Sources.Arm]
+ Arm/ArmPlatformHelper.S | GCC
+ Arm/ArmPlatformHelper.asm | RVCT
+
[FixedPcd]
gArmTokenSpaceGuid.PcdSystemMemoryBase
gArmTokenSpaceGuid.PcdSystemMemorySize
diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNullSec.inf b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNullSec.inf
new file mode 100644
index 0000000000..128b0b59e2
--- /dev/null
+++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNullSec.inf
@@ -0,0 +1,44 @@
+#/* @file
+# Copyright (c) 2011-2012, 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
+# 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.
+#
+#*/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = ArmPlatformLibNull
+ FILE_GUID = cb494bad-23ff-427e-8608-d7e138d3363b
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = ArmPlatformLib
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ ArmPkg/ArmPkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
+
+[LibraryClasses]
+ ArmLib
+ DebugLib
+
+[Sources.common]
+ ArmPlatformLibNull.c
+
+[Sources.Arm]
+ Arm/ArmPlatformHelper.S | GCC
+ Arm/ArmPlatformHelper.asm | RVCT
+
+[FixedPcd]
+ gArmTokenSpaceGuid.PcdSystemMemoryBase
+ gArmTokenSpaceGuid.PcdSystemMemorySize
+
+ gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
+ gArmTokenSpaceGuid.PcdArmPrimaryCore
diff --git a/ArmPlatformPkg/Library/ArmPlatformSecLibNull/ArmPlatformLibNullSec.c b/ArmPlatformPkg/Library/ArmPlatformSecLibNull/ArmPlatformLibNullSec.c
index c548d8b3f9..1a83882030 100644
--- a/ArmPlatformPkg/Library/ArmPlatformSecLibNull/ArmPlatformLibNullSec.c
+++ b/ArmPlatformPkg/Library/ArmPlatformSecLibNull/ArmPlatformLibNullSec.c
@@ -1,74 +1,74 @@
-/** @file
-*
-* Copyright (c) 2011-2012, 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
-* 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.
-*
-**/
-
-#include <Library/ArmPlatformLib.h>
-#include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
-
-/**
- Initialize the Secure peripherals and memory regions
-
- If Trustzone is supported by your platform then this function makes the required initialization
- of the secure peripherals and memory regions.
-
-**/
-VOID
-ArmPlatformSecTrustzoneInit (
- IN UINTN MpId
- )
-{
- // Secondary cores might have to set the Secure SGIs into the GICD_IGROUPR0
- if (!IS_PRIMARY_CORE(MpId)) {
- return;
- }
-
- ASSERT(FALSE);
-}
-
-/**
- Initialize controllers that must setup at the early stage
-
- Some peripherals must be initialized in Secure World.
- For example, some L2x0 requires to be initialized in Secure World
-
-**/
-RETURN_STATUS
-ArmPlatformSecInitialize (
- IN UINTN MpId
- )
-{
- // If it is not the primary core then there is nothing to do
- if (!IS_PRIMARY_CORE(MpId)) {
- return RETURN_SUCCESS;
- }
-
- // Do nothing yet
- return RETURN_SUCCESS;
-}
-
-/**
- Call before jumping to Normal World
-
- This function allows the firmware platform to do extra actions before
- jumping to the Normal World
-
-**/
-VOID
-ArmPlatformSecExtraAction (
- IN UINTN MpId,
- OUT UINTN* JumpAddress
- )
-{
- *JumpAddress = PcdGet32(PcdFvBaseAddress);
-}
+/** @file
+*
+* Copyright (c) 2011-2012, 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
+* 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.
+*
+**/
+
+#include <Library/ArmPlatformLib.h>
+#include <Library/DebugLib.h>
+#include <Library/PcdLib.h>
+
+/**
+ Initialize the Secure peripherals and memory regions
+
+ If Trustzone is supported by your platform then this function makes the required initialization
+ of the secure peripherals and memory regions.
+
+**/
+VOID
+ArmPlatformSecTrustzoneInit (
+ IN UINTN MpId
+ )
+{
+ // Secondary cores might have to set the Secure SGIs into the GICD_IGROUPR0
+ if (!IS_PRIMARY_CORE(MpId)) {
+ return;
+ }
+
+ ASSERT(FALSE);
+}
+
+/**
+ Initialize controllers that must setup at the early stage
+
+ Some peripherals must be initialized in Secure World.
+ For example, some L2x0 requires to be initialized in Secure World
+
+**/
+RETURN_STATUS
+ArmPlatformSecInitialize (
+ IN UINTN MpId
+ )
+{
+ // If it is not the primary core then there is nothing to do
+ if (!IS_PRIMARY_CORE(MpId)) {
+ return RETURN_SUCCESS;
+ }
+
+ // Do nothing yet
+ return RETURN_SUCCESS;
+}
+
+/**
+ Call before jumping to Normal World
+
+ This function allows the firmware platform to do extra actions before
+ jumping to the Normal World
+
+**/
+VOID
+ArmPlatformSecExtraAction (
+ IN UINTN MpId,
+ OUT UINTN* JumpAddress
+ )
+{
+ *JumpAddress = PcdGet32(PcdFvBaseAddress);
+}
diff --git a/ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.c b/ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.c
index 6d3250e3a5..e82584e6dc 100644
--- a/ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.c
+++ b/ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.c
@@ -1,7 +1,7 @@
/** @file
* Main file supporting the Monitor World on ARM PLatforms
*
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2013, 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
@@ -33,5 +33,5 @@ ArmSecureMonitorWorldInitialize (
ASSERT (IS_ALIGNED(MonitorVectorTable, BIT5));
// Write the Monitor Mode Vector Table Address
- ArmWriteMVBar ((UINT32) &MonitorVectorTable);
+ ArmWriteMVBar ((UINTN) &MonitorVectorTable);
}
diff --git a/ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf b/ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf
index 2962ffe5d8..26afb34b23 100755
--- a/ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf
+++ b/ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf
@@ -1,55 +1,55 @@
-#/* @file
-# Copyright (c) 2011-2012, 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
-# 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.
-#
-#*/
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = DebugSecExtraActionLib
- FILE_GUID = 8fff7a60-a6f8-11e0-990a-0002a5d5c51b
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ArmPlatformSecExtraActionLib
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = ARM
-#
-
-[Sources.common]
- DebugSecExtraActionLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ArmPkg/ArmPkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
-
-[LibraryClasses]
- DebugLib
- PcdLib
- ArmGicLib
- PrintLib
- SerialPortLib
-
-[FeaturePcd]
- gArmPlatformTokenSpaceGuid.PcdStandalone
- gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec
-
-[FixedPcd]
- gArmTokenSpaceGuid.PcdFvBaseAddress
-
- gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
- gArmTokenSpaceGuid.PcdArmPrimaryCore
-
- gArmTokenSpaceGuid.PcdGicDistributorBase
- gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
- gArmTokenSpaceGuid.PcdGicSgiIntId
+#/* @file
+# Copyright (c) 2011-2012, 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
+# 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.
+#
+#*/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = DebugSecExtraActionLib
+ FILE_GUID = 8fff7a60-a6f8-11e0-990a-0002a5d5c51b
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = ArmPlatformSecExtraActionLib
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = ARM
+#
+
+[Sources.common]
+ DebugSecExtraActionLib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ ArmPkg/ArmPkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
+
+[LibraryClasses]
+ DebugLib
+ PcdLib
+ ArmGicLib
+ PrintLib
+ SerialPortLib
+
+[FeaturePcd]
+ gArmPlatformTokenSpaceGuid.PcdStandalone
+ gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec
+
+[FixedPcd]
+ gArmTokenSpaceGuid.PcdFvBaseAddress
+
+ gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
+ gArmTokenSpaceGuid.PcdArmPrimaryCore
+
+ gArmTokenSpaceGuid.PcdGicDistributorBase
+ gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
+ gArmTokenSpaceGuid.PcdGicSgiIntId
diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
index 8f7ea65e7b..b45e85d9af 100644
--- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
+++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.c
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2013, 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
@@ -101,7 +101,7 @@ EblSymbolTable (
for (Entry = 0; Entry < DebugImageTableHeader->TableSize; Entry++, DebugTable++) {
if (DebugTable->NormalImage != NULL) {
if ((DebugTable->NormalImage->ImageInfoType == EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) && (DebugTable->NormalImage->LoadedImageProtocolInstance != NULL)) {
- ImageBase = (UINT32)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase;
+ ImageBase = (UINTN)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase;
PeCoffSizeOfHeaders = PeCoffGetSizeOfHeaders ((VOID *)(UINTN)ImageBase);
Pdb = PeCoffLoaderGetPdbPointer (DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase);
if (Pdb != NULL) {
@@ -389,7 +389,7 @@ EblDevicePaths (
for (Index = 0; Index < HandleCount; Index++) {
Status = gBS->HandleProtocol (HandleBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID **)&DevicePathProtocol);
String = DevicePathToTextProtocol->ConvertDevicePathToText(DevicePathProtocol,TRUE,TRUE);
- Print (L"[0x%X] %s\n",(UINT32)HandleBuffer[Index], String);
+ Print (L"[0x%X] %s\n",(UINTN)HandleBuffer[Index], String);
}
return EFI_SUCCESS;
diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
index 7ccd09bd48..20e8882713 100644
--- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
+++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c
@@ -1,184 +1,184 @@
-/** @file
- Serial I/O Port library functions with no library constructor/destructor
-
- Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
- Copyright (c) 2012, 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.
-
-**/
-
-#include <Base.h>
-
-#include <Library/IoLib.h>
-#include <Library/PcdLib.h>
-#include <Library/SerialPortLib.h>
-#include <Library/SerialPortExtLib.h>
-
-#include <Drivers/PL011Uart.h>
-
-
-/**
-
- Programmed hardware of Serial port.
-
- @return Always return RETURN_UNSUPPORTED.
-
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortInitialize (
- VOID
- )
-{
- return PL011UartInitializePort (
- (UINTN)PcdGet64 (PcdSerialRegisterBase),
- (UINTN)PcdGet64 (PcdUartDefaultBaudRate),
- 0, // Use the default value for Fifo depth
- (EFI_PARITY_TYPE)PcdGet8 (PcdUartDefaultParity),
- PcdGet8 (PcdUartDefaultDataBits),
- (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits));
-}
-
-/**
- Write data to serial device.
-
- @param Buffer Point of data buffer which need to be written.
- @param NumberOfBytes Number of output bytes which are cached in Buffer.
-
- @retval 0 Write data failed.
- @retval !0 Actual number of bytes written to serial device.
-
-**/
-UINTN
-EFIAPI
-SerialPortWrite (
- IN UINT8 *Buffer,
- IN UINTN NumberOfBytes
- )
-{
- return PL011UartWrite ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
-}
-
-/**
- Read data from serial device and save the data in buffer.
-
- @param Buffer Point of data buffer which need to be written.
- @param NumberOfBytes Number of output bytes which are cached in Buffer.
-
- @retval 0 Read data failed.
- @retval !0 Actual number of bytes read from serial device.
-
-**/
-UINTN
-EFIAPI
-SerialPortRead (
- OUT UINT8 *Buffer,
- IN UINTN NumberOfBytes
-)
-{
- return PL011UartRead ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
-}
-
-/**
- Check to see if any data is available to be read from the debug device.
-
- @retval EFI_SUCCESS At least one byte of data is available to be read
- @retval EFI_NOT_READY No data is available to be read
- @retval EFI_DEVICE_ERROR The serial device is not functioning properly
-
-**/
-BOOLEAN
-EFIAPI
-SerialPortPoll (
- VOID
- )
-{
- return PL011UartPoll ((UINTN)PcdGet64 (PcdSerialRegisterBase));
-}
-
-/**
- Set new attributes to PL011.
-
- @param BaudRate The baud rate of the serial device. If the baud rate is not supported,
- the speed will be reduced down to the nearest supported one and the
- variable's value will be updated accordingly.
- @param ReceiveFifoDepth The number of characters the device will buffer on input. If the specified
- value is not supported, the variable's value will be reduced down to the
- nearest supported one.
- @param Timeout If applicable, the number of microseconds the device will wait
- before timing out a Read or a Write operation.
- @param Parity If applicable, this is the EFI_PARITY_TYPE that is computer or checked
- as each character is transmitted or received. If the device does not
- support parity, the value is the default parity value.
- @param DataBits The number of data bits in each character
- @param StopBits If applicable, the EFI_STOP_BITS_TYPE number of stop bits per character.
- If the device does not support stop bits, the value is the default stop
- bit value.
-
- @retval EFI_SUCCESS All attributes were set correctly on the serial device.
- @retval EFI_INVALID_PARAMETERS One or more of the attributes has an unsupported value.
-
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortSetAttributes (
- IN UINT64 BaudRate,
- IN UINT32 ReceiveFifoDepth,
- IN UINT32 Timeout,
- IN EFI_PARITY_TYPE Parity,
- IN UINT8 DataBits,
- IN EFI_STOP_BITS_TYPE StopBits
- )
-{
- return PL011UartInitializePort (
- (UINTN)PcdGet64 (PcdSerialRegisterBase),
- BaudRate,
- ReceiveFifoDepth,
- Parity,
- DataBits,
- StopBits);
-}
-
-/**
- Set the serial device control bits.
-
- @param Control Control bits which are to be set on the serial device.
-
- @retval EFI_SUCCESS The new control bits were set on the serial device.
- @retval EFI_UNSUPPORTED The serial device does not support this operation.
- @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
-
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortSetControl (
- IN UINT32 Control
- )
-{
- return PL011UartSetControl((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);
-}
-
-/**
- Get the serial device control bits.
-
- @param Control Control signals read from the serial device.
-
- @retval EFI_SUCCESS The control bits were read from the serial device.
- @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
-
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortGetControl (
- OUT UINT32 *Control
- )
-{
- return PL011UartGetControl((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);
-}
+/** @file
+ Serial I/O Port library functions with no library constructor/destructor
+
+ Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
+ Copyright (c) 2012, 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.
+
+**/
+
+#include <Base.h>
+
+#include <Library/IoLib.h>
+#include <Library/PcdLib.h>
+#include <Library/SerialPortLib.h>
+#include <Library/SerialPortExtLib.h>
+
+#include <Drivers/PL011Uart.h>
+
+
+/**
+
+ Programmed hardware of Serial port.
+
+ @return Always return RETURN_UNSUPPORTED.
+
+**/
+RETURN_STATUS
+EFIAPI
+SerialPortInitialize (
+ VOID
+ )
+{
+ return PL011UartInitializePort (
+ (UINTN)PcdGet64 (PcdSerialRegisterBase),
+ (UINTN)PcdGet64 (PcdUartDefaultBaudRate),
+ 0, // Use the default value for Fifo depth
+ (EFI_PARITY_TYPE)PcdGet8 (PcdUartDefaultParity),
+ PcdGet8 (PcdUartDefaultDataBits),
+ (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits));
+}
+
+/**
+ Write data to serial device.
+
+ @param Buffer Point of data buffer which need to be written.
+ @param NumberOfBytes Number of output bytes which are cached in Buffer.
+
+ @retval 0 Write data failed.
+ @retval !0 Actual number of bytes written to serial device.
+
+**/
+UINTN
+EFIAPI
+SerialPortWrite (
+ IN UINT8 *Buffer,
+ IN UINTN NumberOfBytes
+ )
+{
+ return PL011UartWrite ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
+}
+
+/**
+ Read data from serial device and save the data in buffer.
+
+ @param Buffer Point of data buffer which need to be written.
+ @param NumberOfBytes Number of output bytes which are cached in Buffer.
+
+ @retval 0 Read data failed.
+ @retval !0 Actual number of bytes read from serial device.
+
+**/
+UINTN
+EFIAPI
+SerialPortRead (
+ OUT UINT8 *Buffer,
+ IN UINTN NumberOfBytes
+)
+{
+ return PL011UartRead ((UINTN)PcdGet64 (PcdSerialRegisterBase), Buffer, NumberOfBytes);
+}
+
+/**
+ Check to see if any data is available to be read from the debug device.
+
+ @retval EFI_SUCCESS At least one byte of data is available to be read
+ @retval EFI_NOT_READY No data is available to be read
+ @retval EFI_DEVICE_ERROR The serial device is not functioning properly
+
+**/
+BOOLEAN
+EFIAPI
+SerialPortPoll (
+ VOID
+ )
+{
+ return PL011UartPoll ((UINTN)PcdGet64 (PcdSerialRegisterBase));
+}
+
+/**
+ Set new attributes to PL011.
+
+ @param BaudRate The baud rate of the serial device. If the baud rate is not supported,
+ the speed will be reduced down to the nearest supported one and the
+ variable's value will be updated accordingly.
+ @param ReceiveFifoDepth The number of characters the device will buffer on input. If the specified
+ value is not supported, the variable's value will be reduced down to the
+ nearest supported one.
+ @param Timeout If applicable, the number of microseconds the device will wait
+ before timing out a Read or a Write operation.
+ @param Parity If applicable, this is the EFI_PARITY_TYPE that is computer or checked
+ as each character is transmitted or received. If the device does not
+ support parity, the value is the default parity value.
+ @param DataBits The number of data bits in each character
+ @param StopBits If applicable, the EFI_STOP_BITS_TYPE number of stop bits per character.
+ If the device does not support stop bits, the value is the default stop
+ bit value.
+
+ @retval EFI_SUCCESS All attributes were set correctly on the serial device.
+ @retval EFI_INVALID_PARAMETERS One or more of the attributes has an unsupported value.
+
+**/
+RETURN_STATUS
+EFIAPI
+SerialPortSetAttributes (
+ IN UINT64 BaudRate,
+ IN UINT32 ReceiveFifoDepth,
+ IN UINT32 Timeout,
+ IN EFI_PARITY_TYPE Parity,
+ IN UINT8 DataBits,
+ IN EFI_STOP_BITS_TYPE StopBits
+ )
+{
+ return PL011UartInitializePort (
+ (UINTN)PcdGet64 (PcdSerialRegisterBase),
+ BaudRate,
+ ReceiveFifoDepth,
+ Parity,
+ DataBits,
+ StopBits);
+}
+
+/**
+ Set the serial device control bits.
+
+ @param Control Control bits which are to be set on the serial device.
+
+ @retval EFI_SUCCESS The new control bits were set on the serial device.
+ @retval EFI_UNSUPPORTED The serial device does not support this operation.
+ @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
+
+**/
+RETURN_STATUS
+EFIAPI
+SerialPortSetControl (
+ IN UINT32 Control
+ )
+{
+ return PL011UartSetControl((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);
+}
+
+/**
+ Get the serial device control bits.
+
+ @param Control Control signals read from the serial device.
+
+ @retval EFI_SUCCESS The control bits were read from the serial device.
+ @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
+
+**/
+RETURN_STATUS
+EFIAPI
+SerialPortGetControl (
+ OUT UINT32 *Control
+ )
+{
+ return PL011UartGetControl((UINTN)PcdGet64 (PcdSerialRegisterBase), Control);
+}
diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
index ec3091b9e7..b7dba087fc 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
@@ -4,6 +4,7 @@
Currently this driver does not support runtime virtual calling.
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
+ Copyright (c) 2011-2013, 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
@@ -33,9 +34,9 @@
#include <ArmPlatform.h>
-CHAR16 mTimeZoneVariableName[] = L"PL031_TimeZone";
-CHAR16 mDaylightVariableName[] = L"PL031_Daylight";
-BOOLEAN mPL031Initialized = FALSE;
+STATIC CONST CHAR16 mTimeZoneVariableName[] = L"PL031RtcTimeZone";
+STATIC CONST CHAR16 mDaylightVariableName[] = L"PL031RtcDaylight";
+STATIC BOOLEAN mPL031Initialized = FALSE;
EFI_STATUS
IdentifyPL031 (
@@ -128,10 +129,6 @@ EpochToEfiTime (
UINTN ss;
UINTN J;
- if (Time->Daylight == TRUE) {
-
- }
-
J = (EpochSeconds / 86400) + 2440588;
j = J + 32044;
g = j / 146097;
@@ -233,13 +230,14 @@ DayValid (
Returns the current time and date information, and the time-keeping capabilities
of the hardware platform.
- @param Time A pointer to storage to receive a snapshot of the current time.
- @param Capabilities An optional pointer to a buffer to receive the real time clock
- device's capabilities.
+ @param Time A pointer to storage to receive a snapshot of the current time.
+ @param Capabilities An optional pointer to a buffer to receive the real time clock
+ device's capabilities.
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_INVALID_PARAMETER Time is NULL.
- @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_INVALID_PARAMETER Time is NULL.
+ @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.
+ @retval EFI_SECURITY_VIOLATION The time could not be retrieved due to an authentication failure.
**/
EFI_STATUS
@@ -250,9 +248,10 @@ LibGetTime (
)
{
EFI_STATUS Status = EFI_SUCCESS;
- UINTN EpochSeconds;
- INT16 *TimeZone = 0;
- UINTN *Daylight = 0;
+ UINT32 EpochSeconds;
+ INT16 TimeZone;
+ UINT8 Daylight;
+ UINTN Size;
// Initialize the hardware if not already done
if (!mPL031Initialized) {
@@ -286,27 +285,44 @@ LibGetTime (
}
// Get the current time zone information from non-volatile storage
- TimeZone = (INT16 *)GetVariable(mTimeZoneVariableName, &gEfiGlobalVariableGuid);
+ Size = sizeof (TimeZone);
+ Status = gRT->GetVariable (
+ (CHAR16 *)mTimeZoneVariableName,
+ &gEfiCallerIdGuid,
+ NULL,
+ &Size,
+ (VOID *)&TimeZone
+ );
+
+ if (EFI_ERROR (Status)) {
+ ASSERT(Status != EFI_INVALID_PARAMETER);
+ ASSERT(Status != EFI_BUFFER_TOO_SMALL);
+
+ if (Status != EFI_NOT_FOUND)
+ goto EXIT;
- if (TimeZone == NULL) {
// The time zone variable does not exist in non-volatile storage, so create it.
Time->TimeZone = EFI_UNSPECIFIED_TIMEZONE;
// Store it
Status = gRT->SetVariable (
- mTimeZoneVariableName,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(Time->TimeZone),
- &(Time->TimeZone)
- );
+ (CHAR16 *)mTimeZoneVariableName,
+ &gEfiCallerIdGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ Size,
+ (VOID *)&(Time->TimeZone)
+ );
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR,"LibGetTime: ERROR: TimeZone\n"));
+ DEBUG ((
+ EFI_D_ERROR,
+ "LibGetTime: Failed to save %s variable to non-volatile storage, Status = %r\n",
+ mTimeZoneVariableName,
+ Status
+ ));
goto EXIT;
}
} else {
// Got the time zone
- Time->TimeZone = *TimeZone;
- FreePool(TimeZone);
+ Time->TimeZone = TimeZone;
// Check TimeZone bounds: -1440 to 1440 or 2047
if (((Time->TimeZone < -1440) || (Time->TimeZone > 1440))
@@ -321,27 +337,44 @@ LibGetTime (
}
// Get the current daylight information from non-volatile storage
- Daylight = (UINTN *)GetVariable(mDaylightVariableName, &gEfiGlobalVariableGuid);
+ Size = sizeof (Daylight);
+ Status = gRT->GetVariable (
+ (CHAR16 *)mDaylightVariableName,
+ &gEfiCallerIdGuid,
+ NULL,
+ &Size,
+ (VOID *)&Daylight
+ );
+
+ if (EFI_ERROR (Status)) {
+ ASSERT(Status != EFI_INVALID_PARAMETER);
+ ASSERT(Status != EFI_BUFFER_TOO_SMALL);
+
+ if (Status != EFI_NOT_FOUND)
+ goto EXIT;
- if (Daylight == NULL) {
// The daylight variable does not exist in non-volatile storage, so create it.
Time->Daylight = 0;
// Store it
Status = gRT->SetVariable (
- mDaylightVariableName,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(Time->Daylight),
- &(Time->Daylight)
- );
+ (CHAR16 *)mDaylightVariableName,
+ &gEfiCallerIdGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ Size,
+ (VOID *)&(Time->Daylight)
+ );
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR,"LibGetTime: ERROR: Daylight\n"));
+ DEBUG ((
+ EFI_D_ERROR,
+ "LibGetTime: Failed to save %s variable to non-volatile storage, Status = %r\n",
+ mDaylightVariableName,
+ Status
+ ));
goto EXIT;
}
} else {
// Got the daylight information
- Time->Daylight = *Daylight;
- FreePool(Daylight);
+ Time->Daylight = Daylight;
// Adjust for the correct period
if ((Time->Daylight & EFI_TIME_IN_DAYLIGHT) == EFI_TIME_IN_DAYLIGHT) {
@@ -456,27 +489,37 @@ LibSetTime (
// Save the current time zone information into non-volatile storage
Status = gRT->SetVariable (
- mTimeZoneVariableName,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(Time->TimeZone),
- &(Time->TimeZone)
- );
+ (CHAR16 *)mTimeZoneVariableName,
+ &gEfiCallerIdGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ sizeof (Time->TimeZone),
+ (VOID *)&(Time->TimeZone)
+ );
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR,"LibSetTime: ERROR: TimeZone\n"));
+ DEBUG ((
+ EFI_D_ERROR,
+ "LibSetTime: Failed to save %s variable to non-volatile storage, Status = %r\n",
+ mTimeZoneVariableName,
+ Status
+ ));
goto EXIT;
}
// Save the current daylight information into non-volatile storage
Status = gRT->SetVariable (
- mDaylightVariableName,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(Time->Daylight),
- &(Time->Daylight)
- );
+ (CHAR16 *)mDaylightVariableName,
+ &gEfiCallerIdGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ sizeof(Time->Daylight),
+ (VOID *)&(Time->Daylight)
+ );
if (EFI_ERROR (Status)) {
- DEBUG((EFI_D_ERROR,"LibSetTime: ERROR: Daylight\n"));
+ DEBUG ((
+ EFI_D_ERROR,
+ "LibSetTime: Failed to save %s variable to non-volatile storage, Status = %r\n",
+ mDaylightVariableName,
+ Status
+ ));
goto EXIT;
}
diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf
index 24c74d2d11..add982ce8e 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.inf
@@ -1,8 +1,7 @@
#/** @file
-# Memory Status Code Library for UEFI drivers
#
-# Lib to provide memory journal status code reporting Routines
# Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011-2013, 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
@@ -25,7 +24,6 @@
[Sources.common]
PL031RealTimeClockLib.c
-
[Packages]
MdePkg/MdePkg.dec
EmbeddedPkg/EmbeddedPkg.dec
@@ -37,7 +35,7 @@
DebugLib
PcdLib
ArmPlatformSysConfigLib
-
+
[Pcd]
gArmPlatformTokenSpaceGuid.PcdPL031RtcBase
gArmPlatformTokenSpaceGuid.PcdPL031RtcPpmAccuracy
diff --git a/ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.c b/ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.c
index fcaa23edde..a042dac9a3 100644
--- a/ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.c
+++ b/ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.c
@@ -1,260 +1,260 @@
-/** @file
-
- Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
- Copyright (c) 2011, 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
- 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.
-
-**/
-
-#include <Base.h>
-
-#include <Library/BaseLib.h>
-#include <Library/TimerLib.h>
-#include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
-#include <Library/IoLib.h>
-#include <Drivers/SP804Timer.h>
-
-#define SP804_TIMER_METRONOME_BASE ((UINTN)PcdGet32 (PcdSP804TimerMetronomeBase))
-#define SP804_TIMER_PERFORMANCE_BASE ((UINTN)PcdGet32 (PcdSP804TimerPerformanceBase))
-
-// Setup SP810's Timer2 for managing delay functions. And Timer3 for Performance counter
-// Note: ArmVE's Timer0 and Timer1 are used by TimerDxe.
-RETURN_STATUS
-EFIAPI
-TimerConstructor (
- VOID
- )
-{
- // Check if the Metronome Timer is already initialized
- if (MmioRead32(SP804_TIMER_METRONOME_BASE + SP804_TIMER_CONTROL_REG) & SP804_TIMER_CTRL_ENABLE) {
- return RETURN_SUCCESS;
- } else {
- // Configure the Metronome Timer for free running operation, 32 bits, no prescaler, and interrupt disabled
- MmioWrite32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_32BIT | SP804_PRESCALE_DIV_1);
-
- // Start the Metronome Timer ticking
- MmioOr32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);
- }
-
- // Check if the Performance Timer is already initialized
- if (MmioRead32(SP804_TIMER_PERFORMANCE_BASE + SP804_TIMER_CONTROL_REG) & SP804_TIMER_CTRL_ENABLE) {
- return RETURN_SUCCESS;
- } else {
- // Configure the Performance timer for free running operation, 32 bits, no prescaler, interrupt disabled
- MmioWrite32 (SP804_TIMER_PERFORMANCE_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_32BIT | SP804_PRESCALE_DIV_1);
-
- // Start the Performance Timer ticking
- MmioOr32 (SP804_TIMER_PERFORMANCE_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Stalls the CPU for at least the given number of microseconds.
-
- Stalls the CPU for the number of microseconds specified by MicroSeconds.
- The hardware timer is 32 bits.
- The maximum possible delay is (0xFFFFFFFF / TimerFrequencyMHz), i.e. ([32bits] / FreqInMHz)
- For example:
- +----------------+------------+----------+----------+
- | TimerFrequency | MaxDelay | MaxDelay | MaxDelay |
- | (MHz) | (us) | (s) | (min) |
- +----------------+------------+----------+----------+
- | 1 | 0xFFFFFFFF | 4294 | 71.5 |
- | 5 | 0x33333333 | 859 | 14.3 |
- | 10 | 0x19999999 | 429 | 7.2 |
- | 50 | 0x051EB851 | 86 | 1.4 |
- +----------------+------------+----------+----------+
- If it becomes necessary to support higher delays, then consider using the
- real time clock.
-
- During this delay, the cpu is not yielded to any other process, with one exception:
- events that are triggered off a timer and which execute at a higher TPL than
- this function. These events may call MicroSecondDelay (or NanoSecondDelay) to
- fulfil their own needs.
- Therefore, this function must be re-entrant, as it may be interrupted and re-started.
-
- @param MicroSeconds The minimum number of microseconds to delay.
-
- @return The value of MicroSeconds inputted.
-
-**/
-UINTN
-EFIAPI
-MicroSecondDelay (
- IN UINTN MicroSeconds
- )
-{
- UINT64 DelayTicks64; // Convert from microseconds to timer ticks, more bits to detect over-range conditions.
- UINTN DelayTicks; // Convert from microseconds to timer ticks, native size for general calculations.
- UINTN StartTicks; // Timer value snapshot at the start of the delay
- UINTN TargetTicks; // Timer value to signal the end of the delay
- UINTN CurrentTicks; // Current value of the 64-bit timer value at any given moment
-
- // If we snapshot the timer at the start of the delay function then we minimise unaccounted overheads.
- StartTicks = MmioRead32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CURRENT_REG);
-
- // We are operating at the limit of 32bits. For the range checking work in 64 bits to avoid overflows.
- DelayTicks64 = MultU64x32((UINT64)MicroSeconds, PcdGet32(PcdSP804TimerFrequencyInMHz));
-
- // We are limited to 32 bits.
- // If the specified delay is exactly equal to the max range of the timer,
- // then the start will be equal to the stop plus one timer overflow (wrap-around).
- // To avoid having to check for that, reduce the maximum acceptable range by 1 tick,
- // i.e. reject delays equal or greater than the max range of the timer.
- if (DelayTicks64 >= (UINT64)SP804_MAX_TICKS) {
- DEBUG((EFI_D_ERROR,"MicroSecondDelay: ERROR: MicroSeconds=%d exceed SP804 count range. Max MicroSeconds=%d\n",
- MicroSeconds,
- ((UINTN)SP804_MAX_TICKS/PcdGet32(PcdSP804TimerFrequencyInMHz))));
- }
- ASSERT(DelayTicks64 < (UINT64)SP804_MAX_TICKS);
-
- // From now on do calculations only in native bit size.
- DelayTicks = (UINTN)DelayTicks64;
-
- // Calculate the target value of the timer.
-
- //Note: SP804 timer is counting down
- if (StartTicks >= DelayTicks) {
- // In this case we do not expect a wrap-around of the timer to occur.
- // CurrentTicks must be less than StartTicks and higher than TargetTicks.
- // If this is not the case, then the delay has been reached and may even have been exceeded if this
- // function was suspended by a higher priority interrupt.
-
- TargetTicks = StartTicks - DelayTicks;
-
- do {
- CurrentTicks = MmioRead32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CURRENT_REG);
- } while ((CurrentTicks > TargetTicks) && (CurrentTicks <= StartTicks));
-
- } else {
- // In this case TargetTicks is larger than StartTicks.
- // This means we expect a wrap-around of the timer to occur and we must wait for it.
- // Before the wrap-around, CurrentTicks must be less than StartTicks and less than TargetTicks.
- // After the wrap-around, CurrentTicks must be larger than StartTicks and larger than TargetTicks.
- // If this is not the case, then the delay has been reached and may even have been exceeded if this
- // function was suspended by a higher priority interrupt.
-
- // The order of operations is essential to avoid arithmetic overflow problems
- TargetTicks = ((UINTN)SP804_MAX_TICKS - DelayTicks) + StartTicks;
-
- // First wait for the wrap-around to occur
- do {
- CurrentTicks = MmioRead32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CURRENT_REG);
- } while (CurrentTicks <= StartTicks);
-
- // Then wait for the target
- do {
- CurrentTicks = MmioRead32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CURRENT_REG);
- } while (CurrentTicks > TargetTicks);
- }
-
- return MicroSeconds;
-}
-
-/**
- Stalls the CPU for at least the given number of nanoseconds.
-
- Stalls the CPU for the number of nanoseconds specified by NanoSeconds.
-
- When the timer frequency is 1MHz, each tick corresponds to 1 microsecond.
- Therefore, the nanosecond delay will be rounded up to the nearest 1 microsecond.
-
- @param NanoSeconds The minimum number of nanoseconds to delay.
-
- @return The value of NanoSeconds inputted.
-
-**/
-UINTN
-EFIAPI
-NanoSecondDelay (
- IN UINTN NanoSeconds
- )
-{
- UINTN MicroSeconds;
-
- // Round up to 1us Tick Number
- MicroSeconds = NanoSeconds / 1000;
- MicroSeconds += ((NanoSeconds % 1000) == 0) ? 0 : 1;
-
- MicroSecondDelay (MicroSeconds);
-
- return NanoSeconds;
-}
-
-/**
- Retrieves the current value of a 64-bit free running performance counter.
-
- The counter can either count up by 1 or count down by 1. If the physical
- performance counter counts by a larger increment, then the counter values
- must be translated. The properties of the counter can be retrieved from
- GetPerformanceCounterProperties().
-
- @return The current value of the free running performance counter.
-
-**/
-UINT64
-EFIAPI
-GetPerformanceCounter (
- VOID
- )
-{
- // Free running 64-bit/32-bit counter is needed here.
- // Don't think we need this to boot, just to do performance profile
- UINT64 Value;
- Value = MmioRead32 (SP804_TIMER_PERFORMANCE_BASE + SP804_TIMER_CURRENT_REG);
- return Value;
-}
-
-
-/**
- Retrieves the 64-bit frequency in Hz and the range of performance counter
- values.
-
- If StartValue is not NULL, then the value that the performance counter starts
- with immediately after is it rolls over is returned in StartValue. If
- EndValue is not NULL, then the value that the performance counter end with
- immediately before it rolls over is returned in EndValue. The 64-bit
- frequency of the performance counter in Hz is always returned. If StartValue
- is less than EndValue, then the performance counter counts up. If StartValue
- is greater than EndValue, then the performance counter counts down. For
- example, a 64-bit free running counter that counts up would have a StartValue
- of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter
- that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.
-
- @param StartValue The value the performance counter starts with when it
- rolls over.
- @param EndValue The value that the performance counter ends with before
- it rolls over.
-
- @return The frequency in Hz.
-
-**/
-UINT64
-EFIAPI
-GetPerformanceCounterProperties (
- OUT UINT64 *StartValue, OPTIONAL
- OUT UINT64 *EndValue OPTIONAL
- )
-{
- if (StartValue != NULL) {
- // Timer starts with the reload value
- *StartValue = 0xFFFFFFFF;
- }
-
- if (EndValue != NULL) {
- // Timer counts down to 0x0
- *EndValue = (UINT64)0ULL;
- }
-
- return PcdGet64 (PcdEmbeddedPerformanceCounterFrequencyInHz);
-}
+/** @file
+
+ Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
+ Copyright (c) 2011, 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
+ 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.
+
+**/
+
+#include <Base.h>
+
+#include <Library/BaseLib.h>
+#include <Library/TimerLib.h>
+#include <Library/DebugLib.h>
+#include <Library/PcdLib.h>
+#include <Library/IoLib.h>
+#include <Drivers/SP804Timer.h>
+
+#define SP804_TIMER_METRONOME_BASE ((UINTN)PcdGet32 (PcdSP804TimerMetronomeBase))
+#define SP804_TIMER_PERFORMANCE_BASE ((UINTN)PcdGet32 (PcdSP804TimerPerformanceBase))
+
+// Setup SP810's Timer2 for managing delay functions. And Timer3 for Performance counter
+// Note: ArmVE's Timer0 and Timer1 are used by TimerDxe.
+RETURN_STATUS
+EFIAPI
+TimerConstructor (
+ VOID
+ )
+{
+ // Check if the Metronome Timer is already initialized
+ if (MmioRead32(SP804_TIMER_METRONOME_BASE + SP804_TIMER_CONTROL_REG) & SP804_TIMER_CTRL_ENABLE) {
+ return RETURN_SUCCESS;
+ } else {
+ // Configure the Metronome Timer for free running operation, 32 bits, no prescaler, and interrupt disabled
+ MmioWrite32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_32BIT | SP804_PRESCALE_DIV_1);
+
+ // Start the Metronome Timer ticking
+ MmioOr32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);
+ }
+
+ // Check if the Performance Timer is already initialized
+ if (MmioRead32(SP804_TIMER_PERFORMANCE_BASE + SP804_TIMER_CONTROL_REG) & SP804_TIMER_CTRL_ENABLE) {
+ return RETURN_SUCCESS;
+ } else {
+ // Configure the Performance timer for free running operation, 32 bits, no prescaler, interrupt disabled
+ MmioWrite32 (SP804_TIMER_PERFORMANCE_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_32BIT | SP804_PRESCALE_DIV_1);
+
+ // Start the Performance Timer ticking
+ MmioOr32 (SP804_TIMER_PERFORMANCE_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);
+ }
+
+ return RETURN_SUCCESS;
+}
+
+/**
+ Stalls the CPU for at least the given number of microseconds.
+
+ Stalls the CPU for the number of microseconds specified by MicroSeconds.
+ The hardware timer is 32 bits.
+ The maximum possible delay is (0xFFFFFFFF / TimerFrequencyMHz), i.e. ([32bits] / FreqInMHz)
+ For example:
+ +----------------+------------+----------+----------+
+ | TimerFrequency | MaxDelay | MaxDelay | MaxDelay |
+ | (MHz) | (us) | (s) | (min) |
+ +----------------+------------+----------+----------+
+ | 1 | 0xFFFFFFFF | 4294 | 71.5 |
+ | 5 | 0x33333333 | 859 | 14.3 |
+ | 10 | 0x19999999 | 429 | 7.2 |
+ | 50 | 0x051EB851 | 86 | 1.4 |
+ +----------------+------------+----------+----------+
+ If it becomes necessary to support higher delays, then consider using the
+ real time clock.
+
+ During this delay, the cpu is not yielded to any other process, with one exception:
+ events that are triggered off a timer and which execute at a higher TPL than
+ this function. These events may call MicroSecondDelay (or NanoSecondDelay) to
+ fulfil their own needs.
+ Therefore, this function must be re-entrant, as it may be interrupted and re-started.
+
+ @param MicroSeconds The minimum number of microseconds to delay.
+
+ @return The value of MicroSeconds inputted.
+
+**/
+UINTN
+EFIAPI
+MicroSecondDelay (
+ IN UINTN MicroSeconds
+ )
+{
+ UINT64 DelayTicks64; // Convert from microseconds to timer ticks, more bits to detect over-range conditions.
+ UINTN DelayTicks; // Convert from microseconds to timer ticks, native size for general calculations.
+ UINTN StartTicks; // Timer value snapshot at the start of the delay
+ UINTN TargetTicks; // Timer value to signal the end of the delay
+ UINTN CurrentTicks; // Current value of the 64-bit timer value at any given moment
+
+ // If we snapshot the timer at the start of the delay function then we minimise unaccounted overheads.
+ StartTicks = MmioRead32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CURRENT_REG);
+
+ // We are operating at the limit of 32bits. For the range checking work in 64 bits to avoid overflows.
+ DelayTicks64 = MultU64x32((UINT64)MicroSeconds, PcdGet32(PcdSP804TimerFrequencyInMHz));
+
+ // We are limited to 32 bits.
+ // If the specified delay is exactly equal to the max range of the timer,
+ // then the start will be equal to the stop plus one timer overflow (wrap-around).
+ // To avoid having to check for that, reduce the maximum acceptable range by 1 tick,
+ // i.e. reject delays equal or greater than the max range of the timer.
+ if (DelayTicks64 >= (UINT64)SP804_MAX_TICKS) {
+ DEBUG((EFI_D_ERROR,"MicroSecondDelay: ERROR: MicroSeconds=%d exceed SP804 count range. Max MicroSeconds=%d\n",
+ MicroSeconds,
+ ((UINTN)SP804_MAX_TICKS/PcdGet32(PcdSP804TimerFrequencyInMHz))));
+ }
+ ASSERT(DelayTicks64 < (UINT64)SP804_MAX_TICKS);
+
+ // From now on do calculations only in native bit size.
+ DelayTicks = (UINTN)DelayTicks64;
+
+ // Calculate the target value of the timer.
+
+ //Note: SP804 timer is counting down
+ if (StartTicks >= DelayTicks) {
+ // In this case we do not expect a wrap-around of the timer to occur.
+ // CurrentTicks must be less than StartTicks and higher than TargetTicks.
+ // If this is not the case, then the delay has been reached and may even have been exceeded if this
+ // function was suspended by a higher priority interrupt.
+
+ TargetTicks = StartTicks - DelayTicks;
+
+ do {
+ CurrentTicks = MmioRead32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CURRENT_REG);
+ } while ((CurrentTicks > TargetTicks) && (CurrentTicks <= StartTicks));
+
+ } else {
+ // In this case TargetTicks is larger than StartTicks.
+ // This means we expect a wrap-around of the timer to occur and we must wait for it.
+ // Before the wrap-around, CurrentTicks must be less than StartTicks and less than TargetTicks.
+ // After the wrap-around, CurrentTicks must be larger than StartTicks and larger than TargetTicks.
+ // If this is not the case, then the delay has been reached and may even have been exceeded if this
+ // function was suspended by a higher priority interrupt.
+
+ // The order of operations is essential to avoid arithmetic overflow problems
+ TargetTicks = ((UINTN)SP804_MAX_TICKS - DelayTicks) + StartTicks;
+
+ // First wait for the wrap-around to occur
+ do {
+ CurrentTicks = MmioRead32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CURRENT_REG);
+ } while (CurrentTicks <= StartTicks);
+
+ // Then wait for the target
+ do {
+ CurrentTicks = MmioRead32 (SP804_TIMER_METRONOME_BASE + SP804_TIMER_CURRENT_REG);
+ } while (CurrentTicks > TargetTicks);
+ }
+
+ return MicroSeconds;
+}
+
+/**
+ Stalls the CPU for at least the given number of nanoseconds.
+
+ Stalls the CPU for the number of nanoseconds specified by NanoSeconds.
+
+ When the timer frequency is 1MHz, each tick corresponds to 1 microsecond.
+ Therefore, the nanosecond delay will be rounded up to the nearest 1 microsecond.
+
+ @param NanoSeconds The minimum number of nanoseconds to delay.
+
+ @return The value of NanoSeconds inputted.
+
+**/
+UINTN
+EFIAPI
+NanoSecondDelay (
+ IN UINTN NanoSeconds
+ )
+{
+ UINTN MicroSeconds;
+
+ // Round up to 1us Tick Number
+ MicroSeconds = NanoSeconds / 1000;
+ MicroSeconds += ((NanoSeconds % 1000) == 0) ? 0 : 1;
+
+ MicroSecondDelay (MicroSeconds);
+
+ return NanoSeconds;
+}
+
+/**
+ Retrieves the current value of a 64-bit free running performance counter.
+
+ The counter can either count up by 1 or count down by 1. If the physical
+ performance counter counts by a larger increment, then the counter values
+ must be translated. The properties of the counter can be retrieved from
+ GetPerformanceCounterProperties().
+
+ @return The current value of the free running performance counter.
+
+**/
+UINT64
+EFIAPI
+GetPerformanceCounter (
+ VOID
+ )
+{
+ // Free running 64-bit/32-bit counter is needed here.
+ // Don't think we need this to boot, just to do performance profile
+ UINT64 Value;
+ Value = MmioRead32 (SP804_TIMER_PERFORMANCE_BASE + SP804_TIMER_CURRENT_REG);
+ return Value;
+}
+
+
+/**
+ Retrieves the 64-bit frequency in Hz and the range of performance counter
+ values.
+
+ If StartValue is not NULL, then the value that the performance counter starts
+ with immediately after is it rolls over is returned in StartValue. If
+ EndValue is not NULL, then the value that the performance counter end with
+ immediately before it rolls over is returned in EndValue. The 64-bit
+ frequency of the performance counter in Hz is always returned. If StartValue
+ is less than EndValue, then the performance counter counts up. If StartValue
+ is greater than EndValue, then the performance counter counts down. For
+ example, a 64-bit free running counter that counts up would have a StartValue
+ of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter
+ that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.
+
+ @param StartValue The value the performance counter starts with when it
+ rolls over.
+ @param EndValue The value that the performance counter ends with before
+ it rolls over.
+
+ @return The frequency in Hz.
+
+**/
+UINT64
+EFIAPI
+GetPerformanceCounterProperties (
+ OUT UINT64 *StartValue, OPTIONAL
+ OUT UINT64 *EndValue OPTIONAL
+ )
+{
+ if (StartValue != NULL) {
+ // Timer starts with the reload value
+ *StartValue = 0xFFFFFFFF;
+ }
+
+ if (EndValue != NULL) {
+ // Timer counts down to 0x0
+ *EndValue = (UINT64)0ULL;
+ }
+
+ return PcdGet64 (PcdEmbeddedPerformanceCounterFrequencyInHz);
+}
diff --git a/ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.inf b/ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.inf
index 0928cae53b..d9bce48b93 100644
--- a/ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.inf
+++ b/ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.inf
@@ -1,44 +1,44 @@
-#/** @file
-# Timer library implementation
-#
-#
-# 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.
-#
-#**/
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = SP804TimerLib
- FILE_GUID = 09cefa99-0d07-487f-a651-fb44f094b1c7
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = TimerLib
-
- CONSTRUCTOR = TimerConstructor
-
-[Sources.common]
- SP804TimerLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ArmPkg/ArmPkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
-
-[LibraryClasses]
- DebugLib
- IoLib
- BaseLib
-
-[Pcd]
- gArmPlatformTokenSpaceGuid.PcdSP804TimerFrequencyInMHz
- gArmPlatformTokenSpaceGuid.PcdSP804TimerPerformanceBase
- gArmPlatformTokenSpaceGuid.PcdSP804TimerMetronomeBase
- gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz
+#/** @file
+# Timer library implementation
+#
+#
+# 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.
+#
+#**/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = SP804TimerLib
+ FILE_GUID = 09cefa99-0d07-487f-a651-fb44f094b1c7
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = TimerLib
+
+ CONSTRUCTOR = TimerConstructor
+
+[Sources.common]
+ SP804TimerLib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ ArmPkg/ArmPkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
+
+[LibraryClasses]
+ DebugLib
+ IoLib
+ BaseLib
+
+[Pcd]
+ gArmPlatformTokenSpaceGuid.PcdSP804TimerFrequencyInMHz
+ gArmPlatformTokenSpaceGuid.PcdSP804TimerPerformanceBase
+ gArmPlatformTokenSpaceGuid.PcdSP804TimerMetronomeBase
+ gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz