UncachedMemoryAllocationLib|Include/Library/UncachedMemoryAllocationLib.h\r
DefaultExceptionHandlerLib|Include/Library/DefaultExceptionHandlerLib.h\r
ArmDisassemblerLib|Include/Library/ArmDisassemblerLib.h\r
+ ArmGicArchLib|Include/Library/ArmGicArchLib.h\r
\r
[Guids.common]\r
gArmTokenSpaceGuid = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }\r
\r
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
+ ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf\r
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf\r
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
+++ /dev/null
-/** @file\r
-*\r
-* Copyright (c) 2014, ARM Limited. All rights reserved.\r
-*\r
-* This program and the accompanying materials are licensed and made available\r
-* under the terms and conditions of the BSD License which accompanies this\r
-* distribution. The full text of the license may be found at\r
-* http://opensource.org/licenses/bsd-license.php\r
-*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-*\r
-**/\r
-\r
-#include <Library/ArmLib.h>\r
-#include <Library/ArmGicLib.h>\r
-\r
-ARM_GIC_ARCH_REVISION\r
-EFIAPI\r
-ArmGicGetSupportedArchRevision (\r
- VOID\r
- )\r
-{\r
- UINT32 IccSre;\r
-\r
- // Ideally we would like to use the GICC IIDR Architecture version here, but\r
- // this does not seem to be very reliable as the implementation could easily\r
- // get it wrong. It is more reliable to check if the GICv3 System Register\r
- // feature is implemented on the CPU. This is also convenient as our GICv3\r
- // driver requires SRE. If only Memory mapped access is available we try to\r
- // drive the GIC as a v2.\r
- if (ArmReadIdPfr0 () & AARCH64_PFR0_GIC) {\r
- // Make sure System Register access is enabled (SRE). This depends on the\r
- // higher privilege level giving us permission, otherwise we will either\r
- // cause an exception here, or the write doesn't stick in which case we need\r
- // to fall back to the GICv2 MMIO interface.\r
- // Note: We do not need to set ICC_SRE_EL2.Enable because the OS is started\r
- // at the same exception level.\r
- // It is the OS responsibility to set this bit.\r
- IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
- if (!(IccSre & ICC_SRE_EL2_SRE)) {\r
- ArmGicV3SetControlSystemRegisterEnable (IccSre | ICC_SRE_EL2_SRE);\r
- IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
- }\r
- if (IccSre & ICC_SRE_EL2_SRE) {\r
- return ARM_GIC_ARCH_REVISION_3;\r
- }\r
- }\r
-\r
- return ARM_GIC_ARCH_REVISION_2;\r
-}\r
+++ /dev/null
-/** @file\r
-*\r
-* Copyright (c) 2014, ARM Limited. All rights reserved.\r
-*\r
-* This program and the accompanying materials are licensed and made available\r
-* under the terms and conditions of the BSD License which accompanies this\r
-* distribution. The full text of the license may be found at\r
-* http://opensource.org/licenses/bsd-license.php\r
-*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-*\r
-**/\r
-\r
-#include <Library/ArmLib.h>\r
-#include <Library/ArmGicLib.h>\r
-\r
-ARM_GIC_ARCH_REVISION\r
-EFIAPI\r
-ArmGicGetSupportedArchRevision (\r
- VOID\r
- )\r
-{\r
- UINT32 IccSre;\r
-\r
- // Ideally we would like to use the GICC IIDR Architecture version here, but\r
- // this does not seem to be very reliable as the implementation could easily\r
- // get it wrong. It is more reliable to check if the GICv3 System Register\r
- // feature is implemented on the CPU. This is also convenient as our GICv3\r
- // driver requires SRE. If only Memory mapped access is available we try to\r
- // drive the GIC as a v2.\r
- if (ArmReadIdPfr1 () & ARM_PFR1_GIC) {\r
- // Make sure System Register access is enabled (SRE). This depends on the\r
- // higher privilege level giving us permission, otherwise we will either\r
- // cause an exception here, or the write doesn't stick in which case we need\r
- // to fall back to the GICv2 MMIO interface.\r
- // Note: We do not need to set ICC_SRE_EL2.Enable because the OS is started\r
- // at the same exception level.\r
- // It is the OS responsibility to set this bit.\r
- IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
- if (!(IccSre & ICC_SRE_EL2_SRE)) {\r
- ArmGicV3SetControlSystemRegisterEnable (IccSre| ICC_SRE_EL2_SRE);\r
- IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
- }\r
- if (IccSre & ICC_SRE_EL2_SRE) {\r
- return ARM_GIC_ARCH_REVISION_3;\r
- }\r
- }\r
-\r
- return ARM_GIC_ARCH_REVISION_2;\r
-}\r
GicV2/ArmGicV2NonSecLib.c\r
\r
[Sources.ARM]\r
- Arm/ArmGicArchLib.c\r
GicV3/Arm/ArmGicV3.S | GCC\r
GicV3/Arm/ArmGicV3.asm | RVCT\r
\r
[Sources.AARCH64]\r
- AArch64/ArmGicArchLib.c\r
GicV3/AArch64/ArmGicV3.S\r
\r
[LibraryClasses]\r
ArmLib\r
DebugLib\r
IoLib\r
+ ArmGicArchLib\r
\r
[Packages]\r
ArmPkg/ArmPkg.dec\r
GicV2/ArmGicV2SecLib.c\r
\r
[Sources.ARM]\r
- Arm/ArmGicArchLib.c\r
GicV3/Arm/ArmGicV3.S | GCC\r
GicV3/Arm/ArmGicV3.asm | RVCT\r
\r
[Sources.AARCH64]\r
- AArch64/ArmGicArchLib.c\r
GicV3/AArch64/ArmGicV3.S\r
\r
[Packages]\r
ArmLib\r
DebugLib\r
IoLib\r
+ ArmGicArchLib\r
\r
[Pcd]\r
gArmPlatformTokenSpaceGuid.PcdCoreCount\r
--- /dev/null
+/** @file\r
+*\r
+* Copyright (c) 2015, Linaro Ltd. All rights reserved.\r
+*\r
+* This program and the accompanying materials are licensed and made available\r
+* under the terms and conditions of the BSD License which accompanies this\r
+* distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#ifndef __ARM_GIC_ARCH_LIB_H__\r
+#define __ARM_GIC_ARCH_LIB_H__\r
+\r
+//\r
+// GIC definitions\r
+//\r
+typedef enum {\r
+ ARM_GIC_ARCH_REVISION_2,\r
+ ARM_GIC_ARCH_REVISION_3\r
+} ARM_GIC_ARCH_REVISION;\r
+\r
+\r
+ARM_GIC_ARCH_REVISION\r
+EFIAPI\r
+ArmGicGetSupportedArchRevision (\r
+ VOID\r
+ );\r
+\r
+#endif\r
#ifndef __ARMGIC_H\r
#define __ARMGIC_H\r
\r
-//\r
-// GIC definitions\r
-//\r
-typedef enum {\r
- ARM_GIC_ARCH_REVISION_2,\r
- ARM_GIC_ARCH_REVISION_3\r
-} ARM_GIC_ARCH_REVISION;\r
+#include <Library/ArmGicArchLib.h>\r
\r
//\r
// GIC Distributor\r
// Bit Mask for\r
#define ARM_GIC_ICCIAR_ACKINTID 0x3FF\r
\r
-ARM_GIC_ARCH_REVISION\r
-EFIAPI\r
-ArmGicGetSupportedArchRevision (\r
- VOID\r
- );\r
-\r
UINTN\r
EFIAPI\r
ArmGicGetInterfaceIdentification (\r
--- /dev/null
+/** @file\r
+*\r
+* Copyright (c) 2014, ARM Limited. All rights reserved.\r
+*\r
+* This program and the accompanying materials are licensed and made available\r
+* under the terms and conditions of the BSD License which accompanies this\r
+* distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#include <Library/ArmLib.h>\r
+#include <Library/ArmGicLib.h>\r
+\r
+ARM_GIC_ARCH_REVISION\r
+EFIAPI\r
+ArmGicGetSupportedArchRevision (\r
+ VOID\r
+ )\r
+{\r
+ UINT32 IccSre;\r
+\r
+ // Ideally we would like to use the GICC IIDR Architecture version here, but\r
+ // this does not seem to be very reliable as the implementation could easily\r
+ // get it wrong. It is more reliable to check if the GICv3 System Register\r
+ // feature is implemented on the CPU. This is also convenient as our GICv3\r
+ // driver requires SRE. If only Memory mapped access is available we try to\r
+ // drive the GIC as a v2.\r
+ if (ArmReadIdPfr0 () & AARCH64_PFR0_GIC) {\r
+ // Make sure System Register access is enabled (SRE). This depends on the\r
+ // higher privilege level giving us permission, otherwise we will either\r
+ // cause an exception here, or the write doesn't stick in which case we need\r
+ // to fall back to the GICv2 MMIO interface.\r
+ // Note: We do not need to set ICC_SRE_EL2.Enable because the OS is started\r
+ // at the same exception level.\r
+ // It is the OS responsibility to set this bit.\r
+ IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
+ if (!(IccSre & ICC_SRE_EL2_SRE)) {\r
+ ArmGicV3SetControlSystemRegisterEnable (IccSre | ICC_SRE_EL2_SRE);\r
+ IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
+ }\r
+ if (IccSre & ICC_SRE_EL2_SRE) {\r
+ return ARM_GIC_ARCH_REVISION_3;\r
+ }\r
+ }\r
+\r
+ return ARM_GIC_ARCH_REVISION_2;\r
+}\r
--- /dev/null
+/** @file\r
+*\r
+* Copyright (c) 2014, ARM Limited. All rights reserved.\r
+*\r
+* This program and the accompanying materials are licensed and made available\r
+* under the terms and conditions of the BSD License which accompanies this\r
+* distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#include <Library/ArmLib.h>\r
+#include <Library/ArmGicLib.h>\r
+\r
+ARM_GIC_ARCH_REVISION\r
+EFIAPI\r
+ArmGicGetSupportedArchRevision (\r
+ VOID\r
+ )\r
+{\r
+ UINT32 IccSre;\r
+\r
+ // Ideally we would like to use the GICC IIDR Architecture version here, but\r
+ // this does not seem to be very reliable as the implementation could easily\r
+ // get it wrong. It is more reliable to check if the GICv3 System Register\r
+ // feature is implemented on the CPU. This is also convenient as our GICv3\r
+ // driver requires SRE. If only Memory mapped access is available we try to\r
+ // drive the GIC as a v2.\r
+ if (ArmReadIdPfr1 () & ARM_PFR1_GIC) {\r
+ // Make sure System Register access is enabled (SRE). This depends on the\r
+ // higher privilege level giving us permission, otherwise we will either\r
+ // cause an exception here, or the write doesn't stick in which case we need\r
+ // to fall back to the GICv2 MMIO interface.\r
+ // Note: We do not need to set ICC_SRE_EL2.Enable because the OS is started\r
+ // at the same exception level.\r
+ // It is the OS responsibility to set this bit.\r
+ IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
+ if (!(IccSre & ICC_SRE_EL2_SRE)) {\r
+ ArmGicV3SetControlSystemRegisterEnable (IccSre| ICC_SRE_EL2_SRE);\r
+ IccSre = ArmGicV3GetControlSystemRegisterEnable ();\r
+ }\r
+ if (IccSre & ICC_SRE_EL2_SRE) {\r
+ return ARM_GIC_ARCH_REVISION_3;\r
+ }\r
+ }\r
+\r
+ return ARM_GIC_ARCH_REVISION_2;\r
+}\r
--- /dev/null
+#/* @file\r
+# Copyright (c) 2015, Linaro Ltd. All rights reserved.\r
+#\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#*/\r
+\r
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = ArmGicArchLib\r
+ FILE_GUID = cd67f41a-26e9-4482-90c9-a9aff803382a\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = ArmGicArchLib\r
+\r
+[Sources.ARM]\r
+ Arm/ArmGicArchLib.c\r
+\r
+[Sources.AARCH64]\r
+ AArch64/ArmGicArchLib.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ ArmPkg/ArmPkg.dec\r
+\r
+[LibraryClasses]\r
+ ArmGicLib\r
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
+ ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf\r
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
\r
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
+ ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf\r
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
\r
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf\r
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
+ ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf\r
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf\r
\r
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
+ ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf\r
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf\r
ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
+ ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf\r
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
ArmHvcLib|ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf\r