]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ARM Packages: Renamed PL390Gic driver into ArmGic driver
authorOlivier Martin <olivier.martin@arm.com>
Tue, 29 Oct 2013 06:36:34 +0000 (06:36 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 29 Oct 2013 06:36:34 +0000 (06:36 +0000)
The aim is to make this driver follows the ARM GIC specifications and
be implementation independent.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14810 6f19259b-4bc3-4df7-8a09-765794883524

39 files changed:
ArmPkg/ArmPkg.dec
ArmPkg/ArmPkg.dsc
ArmPkg/Drivers/ArmGic/ArmGic.c [new file with mode: 0644]
ArmPkg/Drivers/ArmGic/ArmGicDxe.c [new file with mode: 0644]
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf [new file with mode: 0644]
ArmPkg/Drivers/ArmGic/ArmGicLib.inf [new file with mode: 0644]
ArmPkg/Drivers/ArmGic/ArmGicNonSec.c [new file with mode: 0644]
ArmPkg/Drivers/ArmGic/ArmGicSec.c [new file with mode: 0644]
ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf [new file with mode: 0644]
ArmPkg/Drivers/PL390Gic/PL390Gic.c [deleted file]
ArmPkg/Drivers/PL390Gic/PL390GicDxe.c [deleted file]
ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf [deleted file]
ArmPkg/Drivers/PL390Gic/PL390GicLib.inf [deleted file]
ArmPkg/Drivers/PL390Gic/PL390GicNonSec.c [deleted file]
ArmPkg/Drivers/PL390Gic/PL390GicSec.c [deleted file]
ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf [deleted file]
ArmPkg/Include/Library/ArmGicLib.h
ArmPlatformPkg/ArmPlatformPkg-2ndstage.dsc
ArmPlatformPkg/ArmPlatformPkg.dsc
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A8.dsc
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A9x2.dsc
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-MPCore.fdf
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-UniCore.fdf
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc

index 0f094c12a23b0d0ad3794f9a79969b09eb70ab4c..1d6231c6783225d9dde25581a8e5698446fe32b9 100644 (file)
@@ -81,7 +81,7 @@
   gArmTokenSpaceGuid.PcdCpuResetAddress|0x00000000|UINT32|0x00000005\r
   \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0|UINT32|0x0000000C\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0|UINT32|0x0000000D\r
index eb9791c58280f3749b1ace073bac9a8c4bef9150..661453c29598625a39bf0abe23e3da11566979bd 100644 (file)
@@ -62,7 +62,7 @@
   DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf\r
 \r
   CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
-  ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
+  ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
   ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
   DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
 \r
   ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
   ArmPkg/Drivers/CpuPei/CpuPei.inf\r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
-  ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
-  ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
 \r
   ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
diff --git a/ArmPkg/Drivers/ArmGic/ArmGic.c b/ArmPkg/Drivers/ArmGic/ArmGic.c
new file mode 100644 (file)
index 0000000..8a10d11
--- /dev/null
@@ -0,0 +1,70 @@
+/** @file\r
+*\r
+*  Copyright (c) 2011-2012, ARM Limited. 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
+#include <Uefi.h>\r
+#include <Library/IoLib.h>\r
+#include <Library/ArmGicLib.h>\r
+#include <Library/PcdLib.h>\r
+\r
+UINTN\r
+EFIAPI\r
+ArmGicGetMaxNumInterrupts (\r
+  IN  INTN          GicDistributorBase\r
+  )\r
+{\r
+  return 32 * ((MmioRead32 (GicDistributorBase + ARM_GIC_ICDICTR) & 0x1F) + 1);\r
+}\r
+\r
+VOID\r
+EFIAPI\r
+ArmGicSendSgiTo (\r
+  IN  INTN          GicDistributorBase,\r
+  IN  INTN          TargetListFilter,\r
+  IN  INTN          CPUTargetList,\r
+  IN  INTN          SgiId\r
+  )\r
+{\r
+  MmioWrite32 (GicDistributorBase + ARM_GIC_ICDSGIR, ((TargetListFilter & 0x3) << 24) | ((CPUTargetList & 0xFF) << 16) | SgiId);\r
+}\r
+\r
+RETURN_STATUS\r
+EFIAPI\r
+ArmGicAcknowledgeInterrupt (\r
+  IN  UINTN          GicDistributorBase,\r
+  IN  UINTN          GicInterruptInterfaceBase,\r
+  OUT UINTN          *CoreId,\r
+  OUT UINTN          *InterruptId\r
+  )\r
+{\r
+  UINT32            Interrupt;\r
+\r
+  // Read the Interrupt Acknowledge Register\r
+  Interrupt = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);\r
+\r
+  // Check if it is a valid interrupt ID\r
+  if ((Interrupt & 0x3FF) < ArmGicGetMaxNumInterrupts (GicDistributorBase)) {\r
+    // Got a valid SGI number hence signal End of Interrupt by writing to ICCEOIR\r
+    MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, Interrupt);\r
+\r
+    if (CoreId) {\r
+      *CoreId = (Interrupt >> 10) & 0x7;\r
+    }\r
+    if (InterruptId) {\r
+      *InterruptId = Interrupt & 0x3FF;\r
+    }\r
+    return RETURN_SUCCESS;\r
+  } else {\r
+    return RETURN_INVALID_PARAMETER;\r
+  }\r
+}\r
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.c b/ArmPkg/Drivers/ArmGic/ArmGicDxe.c
new file mode 100644 (file)
index 0000000..111ce14
--- /dev/null
@@ -0,0 +1,434 @@
+/*++\r
+\r
+Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>\r
+Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
+Portions copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR> \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
+Module Name:\r
+\r
+  Gic.c\r
+\r
+Abstract:\r
+\r
+  Driver implementing the GIC interrupt controller protocol\r
+\r
+--*/\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Library/ArmLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/IoLib.h>\r
+#include <Library/ArmGicLib.h>\r
+\r
+#include <Protocol/Cpu.h>\r
+#include <Protocol/HardwareInterrupt.h>\r
+\r
+#define ARM_GIC_DEFAULT_PRIORITY  0x80\r
+\r
+extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptProtocol;\r
+\r
+//\r
+// Notifications\r
+//\r
+EFI_EVENT EfiExitBootServicesEvent      = (EFI_EVENT)NULL;\r
+\r
+// Maximum Number of Interrupts\r
+UINTN mGicNumInterrupts                 = 0;\r
+\r
+HARDWARE_INTERRUPT_HANDLER  *gRegisteredInterruptHandlers = NULL;\r
+\r
+/**\r
+  Register Handler for the specified interrupt source.\r
+\r
+  @param This     Instance pointer for this protocol\r
+  @param Source   Hardware source of the interrupt\r
+  @param Handler  Callback for interrupt. NULL to unregister\r
+\r
+  @retval EFI_SUCCESS Source was updated to support Handler.\r
+  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+RegisterInterruptSource (\r
+  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
+  IN HARDWARE_INTERRUPT_SOURCE          Source,\r
+  IN HARDWARE_INTERRUPT_HANDLER         Handler\r
+  )\r
+{\r
+  if (Source > mGicNumInterrupts) {\r
+    ASSERT(FALSE);\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+  \r
+  if ((Handler == NULL) && (gRegisteredInterruptHandlers[Source] == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  if ((Handler != NULL) && (gRegisteredInterruptHandlers[Source] != NULL)) {\r
+    return EFI_ALREADY_STARTED;\r
+  }\r
+\r
+  gRegisteredInterruptHandlers[Source] = Handler;\r
+\r
+  // If the interrupt handler is unregistered then disable the interrupt\r
+  if (NULL == Handler){\r
+       return This->DisableInterruptSource (This, Source);\r
+  } else {\r
+       return This->EnableInterruptSource (This, Source);\r
+  }\r
+}\r
+\r
+/**\r
+  Enable interrupt source Source.\r
+\r
+  @param This     Instance pointer for this protocol\r
+  @param Source   Hardware source of the interrupt\r
+\r
+  @retval EFI_SUCCESS       Source interrupt enabled.\r
+  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EnableInterruptSource (\r
+  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
+  IN HARDWARE_INTERRUPT_SOURCE          Source\r
+  )\r
+{\r
+  UINT32    RegOffset;\r
+  UINTN     RegShift;\r
+  \r
+  if (Source > mGicNumInterrupts) {\r
+    ASSERT(FALSE);\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+  \r
+  // Calculate enable register offset and bit position\r
+  RegOffset = Source / 32;\r
+  RegShift = Source % 32;\r
+\r
+  // Write set-enable register\r
+  MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDISER + (4*RegOffset), 1 << RegShift);\r
+  \r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Disable interrupt source Source.\r
+\r
+  @param This     Instance pointer for this protocol\r
+  @param Source   Hardware source of the interrupt\r
+\r
+  @retval EFI_SUCCESS       Source interrupt disabled.\r
+  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DisableInterruptSource (\r
+  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
+  IN HARDWARE_INTERRUPT_SOURCE          Source\r
+  )\r
+{\r
+  UINT32    RegOffset;\r
+  UINTN     RegShift;\r
+  \r
+  if (Source > mGicNumInterrupts) {\r
+    ASSERT(FALSE);\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+  \r
+  // Calculate enable register offset and bit position\r
+  RegOffset = Source / 32;\r
+  RegShift = Source % 32;\r
+\r
+  // Write set-enable register\r
+  MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDICER + (4*RegOffset), 1 << RegShift);\r
+  \r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Return current state of interrupt source Source.\r
+\r
+  @param This     Instance pointer for this protocol\r
+  @param Source   Hardware source of the interrupt\r
+  @param InterruptState  TRUE: source enabled, FALSE: source disabled.\r
+\r
+  @retval EFI_SUCCESS       InterruptState is valid\r
+  @retval EFI_DEVICE_ERROR  InterruptState is not valid\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetInterruptSourceState (\r
+  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
+  IN HARDWARE_INTERRUPT_SOURCE          Source,\r
+  IN BOOLEAN                            *InterruptState\r
+  )\r
+{\r
+  UINT32    RegOffset;\r
+  UINTN     RegShift;\r
+  \r
+  if (Source > mGicNumInterrupts) {\r
+    ASSERT(FALSE);\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+  \r
+  // calculate enable register offset and bit position\r
+  RegOffset = Source / 32;\r
+  RegShift = Source % 32;\r
+    \r
+  if ((MmioRead32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDISER + (4*RegOffset)) & (1<<RegShift)) == 0) {\r
+    *InterruptState = FALSE;\r
+  } else {\r
+    *InterruptState = TRUE;\r
+  }\r
+  \r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Signal to the hardware that the End Of Intrrupt state \r
+  has been reached.\r
+\r
+  @param This     Instance pointer for this protocol\r
+  @param Source   Hardware source of the interrupt\r
+\r
+  @retval EFI_SUCCESS       Source interrupt EOI'ed.\r
+  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EndOfInterrupt (\r
+  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
+  IN HARDWARE_INTERRUPT_SOURCE          Source\r
+  )\r
+{\r
+  if (Source > mGicNumInterrupts) {\r
+    ASSERT(FALSE);\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCEIOR, Source);\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs.\r
+\r
+  @param  InterruptType    Defines the type of interrupt or exception that\r
+                           occurred on the processor.This parameter is processor architecture specific.\r
+  @param  SystemContext    A pointer to the processor context when\r
+                           the interrupt occurred on the processor.\r
+\r
+  @return None\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+IrqInterruptHandler (\r
+  IN EFI_EXCEPTION_TYPE           InterruptType,\r
+  IN EFI_SYSTEM_CONTEXT           SystemContext\r
+  )\r
+{\r
+  UINT32                      GicInterrupt;\r
+  HARDWARE_INTERRUPT_HANDLER  InterruptHandler;\r
+\r
+  GicInterrupt = MmioRead32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCIAR);\r
+\r
+  // Special Interrupts (ID1020-ID1023) have an Interrupt ID greater than the number of interrupt (ie: Spurious interrupt).\r
+  if (GicInterrupt >= mGicNumInterrupts) {\r
+    // The special interrupt do not need to be acknowledge\r
+    return;\r
+  }\r
+  \r
+  InterruptHandler = gRegisteredInterruptHandlers[GicInterrupt];\r
+  if (InterruptHandler != NULL) {\r
+    // Call the registered interrupt handler.\r
+    InterruptHandler (GicInterrupt, SystemContext);\r
+  } else {\r
+    DEBUG ((EFI_D_ERROR, "Spurious GIC interrupt: 0x%x\n", GicInterrupt));\r
+  }\r
+\r
+  EndOfInterrupt (&gHardwareInterruptProtocol, GicInterrupt);\r
+}\r
+\r
+//\r
+// Making this global saves a few bytes in image size\r
+//\r
+EFI_HANDLE  gHardwareInterruptHandle = NULL;\r
+\r
+//\r
+// The protocol instance produced by this driver\r
+//\r
+EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptProtocol = {\r
+  RegisterInterruptSource,\r
+  EnableInterruptSource,\r
+  DisableInterruptSource,\r
+  GetInterruptSourceState,\r
+  EndOfInterrupt\r
+};\r
+\r
+/**\r
+  Shutdown our hardware\r
+  \r
+  DXE Core will disable interrupts and turn off the timer and disable interrupts\r
+  after all the event handlers have run.\r
+\r
+  @param[in]  Event   The Event that is being processed\r
+  @param[in]  Context Event Context\r
+**/\r
+VOID\r
+EFIAPI\r
+ExitBootServicesEvent (\r
+  IN EFI_EVENT  Event,\r
+  IN VOID       *Context\r
+  )\r
+{\r
+  UINTN    Index;\r
+  \r
+  // Acknowledge all pending interrupts\r
+  for (Index = 0; Index < mGicNumInterrupts; Index++) {\r
+    DisableInterruptSource (&gHardwareInterruptProtocol, Index);\r
+  }\r
+\r
+  for (Index = 0; Index < mGicNumInterrupts; Index++) {\r
+    EndOfInterrupt (&gHardwareInterruptProtocol, Index);\r
+  }\r
+\r
+  // Disable Gic Interface\r
+  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCICR, 0x0);\r
+  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCPMR, 0x0);\r
+\r
+  // Disable Gic Distributor\r
+  MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDDCR, 0x0);\r
+}\r
+\r
+/**\r
+  Initialize the state information for the CPU Architectural Protocol\r
+\r
+  @param  ImageHandle   of the loaded driver\r
+  @param  SystemTable   Pointer to the System Table\r
+\r
+  @retval EFI_SUCCESS           Protocol registered\r
+  @retval EFI_OUT_OF_RESOURCES  Cannot allocate protocol data structure\r
+  @retval EFI_DEVICE_ERROR      Hardware problems\r
+\r
+**/\r
+EFI_STATUS\r
+InterruptDxeInitialize (\r
+  IN EFI_HANDLE         ImageHandle,\r
+  IN EFI_SYSTEM_TABLE   *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS              Status;\r
+  UINTN                   Index;\r
+  UINT32                  RegOffset;\r
+  UINTN                   RegShift;\r
+  EFI_CPU_ARCH_PROTOCOL   *Cpu;\r
+  UINT32                  CpuTarget;\r
+  \r
+  // Make sure the Interrupt Controller Protocol is not already installed in the system.\r
+  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);\r
+\r
+  mGicNumInterrupts = ArmGicGetMaxNumInterrupts (PcdGet32(PcdGicDistributorBase));\r
+\r
+  for (Index = 0; Index < mGicNumInterrupts; Index++) {\r
+    DisableInterruptSource (&gHardwareInterruptProtocol, Index);\r
+    \r
+    // Set Priority \r
+    RegOffset = Index / 4;\r
+    RegShift = (Index % 4) * 8;\r
+    MmioAndThenOr32 (\r
+      PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDIPR + (4*RegOffset),\r
+      ~(0xff << RegShift), \r
+      ARM_GIC_DEFAULT_PRIORITY << RegShift\r
+      );\r
+  }\r
+\r
+  //\r
+  // Targets the interrupts to the Primary Cpu\r
+  //\r
+\r
+  // Only Primary CPU will run this code. We can identify our GIC CPU ID by reading\r
+  // the GIC Distributor Target register. The 8 first GICD_ITARGETSRn are banked to each\r
+  // connected CPU. These 8 registers hold the CPU targets fields for interrupts 0-31.\r
+  // More Info in the GIC Specification about "Interrupt Processor Targets Registers"\r
+  //\r
+  // Read the first Interrupt Processor Targets Register (that corresponds to the 4\r
+  // first SGIs)\r
+  CpuTarget = MmioRead32 (PcdGet32 (PcdGicDistributorBase) + ARM_GIC_ICDIPTR);\r
+\r
+  // The CPU target is a bit field mapping each CPU to a GIC CPU Interface. This value\r
+  // is 0 when we run on a uniprocessor platform.\r
+  if (CpuTarget != 0) {\r
+    // The 8 first Interrupt Processor Targets Registers are read-only\r
+    for (Index = 8; Index < (mGicNumInterrupts / 4); Index++) {\r
+      MmioWrite32 (PcdGet32 (PcdGicDistributorBase) + ARM_GIC_ICDIPTR + (Index * 4), CpuTarget);\r
+    }\r
+  }\r
+\r
+  // Set binary point reg to 0x7 (no preemption)\r
+  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCBPR, 0x7);\r
+\r
+  // Set priority mask reg to 0xff to allow all priorities through\r
+  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCPMR, 0xff);\r
+  \r
+  // Enable gic cpu interface\r
+  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCICR, 0x1);\r
+\r
+  // Enable gic distributor\r
+  MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDDCR, 0x1);\r
+  \r
+  // Initialize the array for the Interrupt Handlers\r
+  gRegisteredInterruptHandlers = (HARDWARE_INTERRUPT_HANDLER*)AllocateZeroPool (sizeof(HARDWARE_INTERRUPT_HANDLER) * mGicNumInterrupts);\r
+  \r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &gHardwareInterruptHandle,\r
+                  &gHardwareInterruptProtocolGuid,   &gHardwareInterruptProtocol,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+  \r
+  //\r
+  // Get the CPU protocol that this driver requires.\r
+  //\r
+  Status = gBS->LocateProtocol(&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu);\r
+  ASSERT_EFI_ERROR(Status);\r
+\r
+  //\r
+  // Unregister the default exception handler.\r
+  //\r
+  Status = Cpu->RegisterInterruptHandler(Cpu, ARM_ARCH_EXCEPTION_IRQ, NULL);\r
+  ASSERT_EFI_ERROR(Status);\r
+\r
+  //\r
+  // Register to receive interrupts\r
+  //\r
+  Status = Cpu->RegisterInterruptHandler(Cpu, ARM_ARCH_EXCEPTION_IRQ, IrqInterruptHandler);\r
+  ASSERT_EFI_ERROR(Status);\r
+\r
+  // Register for an ExitBootServicesEvent\r
+  Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesEvent, NULL, &EfiExitBootServicesEvent);\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Status;\r
+}\r
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf b/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
new file mode 100644 (file)
index 0000000..9dc557a
--- /dev/null
@@ -0,0 +1,56 @@
+#/** @file\r
+#  \r
+#  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
+#  Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>\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                      = ArmGicDxe\r
+  FILE_GUID                      = DE371F7C-DEC4-4D21-ADF1-593ABCC15882 \r
+  MODULE_TYPE                    = DXE_DRIVER\r
+  VERSION_STRING                 = 1.0\r
+\r
+  ENTRY_POINT                    = InterruptDxeInitialize\r
+\r
+\r
+[Sources.common]\r
+  ArmGic.c\r
+  ArmGicDxe.c\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  EmbeddedPkg/EmbeddedPkg.dec\r
+  ArmPkg/ArmPkg.dec\r
+\r
+[LibraryClasses]\r
+  BaseLib\r
+  UefiLib\r
+  UefiBootServicesTableLib\r
+  DebugLib\r
+  PrintLib\r
+  MemoryAllocationLib\r
+  UefiDriverEntryPoint\r
+  IoLib\r
+\r
+[Protocols]\r
+  gHardwareInterruptProtocolGuid\r
+  gEfiCpuArchProtocolGuid\r
+  \r
+[FixedPcd.common]\r
+  gArmTokenSpaceGuid.PcdGicDistributorBase\r
+  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
+  \r
+  gArmTokenSpaceGuid.PcdArmPrimaryCore\r
+\r
+[Depex]\r
+  gEfiCpuArchProtocolGuid\r
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.inf b/ArmPkg/Drivers/ArmGic/ArmGicLib.inf
new file mode 100644 (file)
index 0000000..dab29b9
--- /dev/null
@@ -0,0 +1,31 @@
+#/* @file\r
+#  Copyright (c) 2011-2012, ARM Limited. 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                      = ArmGicLib\r
+  FILE_GUID                      = 03d05ee4-cdeb-458c-9dfc-993f09bdf405\r
+  MODULE_TYPE                    = SEC\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = ArmGicLib\r
+\r
+[Sources]\r
+  ArmGic.c\r
+  ArmGicNonSec.c\r
+\r
+[LibraryClasses]\r
+  IoLib\r
+\r
+[Packages]\r
+  ArmPkg/ArmPkg.dec\r
+  MdePkg/MdePkg.dec\r
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicNonSec.c b/ArmPkg/Drivers/ArmGic/ArmGicNonSec.c
new file mode 100644 (file)
index 0000000..55ff56e
--- /dev/null
@@ -0,0 +1,44 @@
+/** @file\r
+*\r
+*  Copyright (c) 2011, ARM Limited. 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
+#include <Uefi.h>\r
+#include <Library/IoLib.h>\r
+#include <Library/ArmGicLib.h>\r
+\r
+\r
+VOID\r
+EFIAPI\r
+ArmGicEnableInterruptInterface (\r
+  IN  INTN          GicInterruptInterfaceBase\r
+  )\r
+{  \r
+  /*\r
+  * Enable the CPU interface in Non-Secure world\r
+  * Note: The ICCICR register is banked when Security extensions are implemented\r
+  */\r
+  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCICR, 0x1);\r
+}\r
+\r
+VOID\r
+EFIAPI\r
+ArmGicEnableDistributor (\r
+  IN  INTN          GicDistributorBase\r
+  )\r
+{\r
+  /*\r
+   * Enable GIC distributor in Non-Secure world.\r
+   * Note: The ICDDCR register is banked when Security extensions are implemented\r
+   */\r
+  MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);\r
+}\r
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicSec.c b/ArmPkg/Drivers/ArmGic/ArmGicSec.c
new file mode 100644 (file)
index 0000000..bae76e4
--- /dev/null
@@ -0,0 +1,133 @@
+/** @file\r
+*\r
+*  Copyright (c) 2011-2013, ARM Limited. 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
+#include <Base.h>\r
+#include <Library/ArmLib.h>\r
+#include <Library/ArmPlatformLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/IoLib.h>\r
+#include <Library/ArmGicLib.h>\r
+\r
+/*\r
+ * This function configures the all interrupts to be Non-secure.\r
+ *\r
+ */\r
+VOID\r
+EFIAPI\r
+ArmGicSetupNonSecure (\r
+  IN  UINTN         MpId,\r
+  IN  INTN          GicDistributorBase,\r
+  IN  INTN          GicInterruptInterfaceBase\r
+  )\r
+{\r
+  UINTN InterruptId;\r
+  UINTN CachedPriorityMask;\r
+  UINTN Index;\r
+\r
+  CachedPriorityMask = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR);\r
+\r
+  // Set priority Mask so that no interrupts get through to CPU\r
+  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR, 0);\r
+\r
+  InterruptId = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);\r
+\r
+  // Only try to clear valid interrupts. Ignore spurious interrupts.\r
+  while ((InterruptId & 0x3FF) < ArmGicGetMaxNumInterrupts (GicDistributorBase))   {\r
+    // Some of the SGI's are still pending, read Ack register and send End of Interrupt Signal\r
+    MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, InterruptId);\r
+\r
+    // Next\r
+    InterruptId = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);\r
+  }\r
+\r
+  // Only the primary core should set the Non Secure bit to the SPIs (Shared Peripheral Interrupt).\r
+  if (ArmPlatformIsPrimaryCore (MpId)) {\r
+    // Ensure all GIC interrupts are Non-Secure\r
+    for (Index = 0; Index < (ArmGicGetMaxNumInterrupts (GicDistributorBase) / 32); Index++) {\r
+      MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4), 0xffffffff);\r
+    }\r
+  } else {\r
+    // The secondary cores only set the Non Secure bit to their banked PPIs\r
+    MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISR, 0xffffffff);\r
+  }\r
+\r
+  // Ensure all interrupts can get through the priority mask\r
+  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR, CachedPriorityMask);\r
+}\r
+\r
+/*\r
+ * This function configures the interrupts set by the mask to be secure.\r
+ *\r
+ */\r
+VOID\r
+EFIAPI\r
+ArmGicSetSecureInterrupts (\r
+  IN  UINTN         GicDistributorBase,\r
+  IN  UINTN*        GicSecureInterruptMask,\r
+  IN  UINTN         GicSecureInterruptMaskSize\r
+  )\r
+{\r
+  UINTN  Index;\r
+  UINT32 InterruptStatus;\r
+\r
+  // We must not have more interrupts defined by the mask than the number of available interrupts\r
+  ASSERT(GicSecureInterruptMaskSize <= (ArmGicGetMaxNumInterrupts (GicDistributorBase) / 32));\r
+\r
+  // Set all the interrupts defined by the mask as Secure\r
+  for (Index = 0; Index < GicSecureInterruptMaskSize; Index++) {\r
+    InterruptStatus = MmioRead32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4));\r
+    MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4), InterruptStatus & (~GicSecureInterruptMask[Index]));\r
+  }\r
+}\r
+\r
+VOID\r
+EFIAPI\r
+ArmGicEnableInterruptInterface (\r
+  IN  INTN          GicInterruptInterfaceBase\r
+  )\r
+{\r
+  // Set Priority Mask to allow interrupts\r
+  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR, 0x000000FF);\r
+\r
+  // Enable CPU interface in Secure world\r
+  // Enable CPU interface in Non-secure World\r
+  // Signal Secure Interrupts to CPU using FIQ line *\r
+  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCICR,\r
+      ARM_GIC_ICCICR_ENABLE_SECURE |\r
+      ARM_GIC_ICCICR_ENABLE_NS |\r
+      ARM_GIC_ICCICR_SIGNAL_SECURE_TO_FIQ);\r
+}\r
+\r
+VOID\r
+EFIAPI\r
+ArmGicDisableInterruptInterface (\r
+  IN  INTN          GicInterruptInterfaceBase\r
+  )\r
+{\r
+  UINT32    ControlValue;\r
+\r
+  // Disable CPU interface in Secure world and Non-secure World\r
+  ControlValue = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCICR);\r
+  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCICR, ControlValue & ~(ARM_GIC_ICCICR_ENABLE_SECURE | ARM_GIC_ICCICR_ENABLE_NS));\r
+}\r
+\r
+VOID\r
+EFIAPI\r
+ArmGicEnableDistributor (\r
+  IN  INTN          GicDistributorBase\r
+  )\r
+{\r
+  // Turn on the GIC distributor\r
+  MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 1);\r
+}\r
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf b/ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf
new file mode 100644 (file)
index 0000000..bb7f242
--- /dev/null
@@ -0,0 +1,38 @@
+#/* @file\r
+#  Copyright (c) 2011-2012, ARM Limited. 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                      = ArmGicSecLib\r
+  FILE_GUID                      = 85f3cf80-b5f4-11df-9855-0002a5d5c51b\r
+  MODULE_TYPE                    = SEC\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = ArmGicLib\r
+\r
+[Sources]\r
+  ArmGic.c\r
+  ArmGicSec.c\r
+\r
+[Packages]\r
+  ArmPkg/ArmPkg.dec\r
+  ArmPlatformPkg/ArmPlatformPkg.dec\r
+  MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+\r
+[LibraryClasses]\r
+  ArmLib\r
+  ArmPlatformLib\r
+  DebugLib\r
+  IoLib\r
+  PcdLib\r
+\r
diff --git a/ArmPkg/Drivers/PL390Gic/PL390Gic.c b/ArmPkg/Drivers/PL390Gic/PL390Gic.c
deleted file mode 100644 (file)
index 8a10d11..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file\r
-*\r
-*  Copyright (c) 2011-2012, ARM Limited. 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
-#include <Uefi.h>\r
-#include <Library/IoLib.h>\r
-#include <Library/ArmGicLib.h>\r
-#include <Library/PcdLib.h>\r
-\r
-UINTN\r
-EFIAPI\r
-ArmGicGetMaxNumInterrupts (\r
-  IN  INTN          GicDistributorBase\r
-  )\r
-{\r
-  return 32 * ((MmioRead32 (GicDistributorBase + ARM_GIC_ICDICTR) & 0x1F) + 1);\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-ArmGicSendSgiTo (\r
-  IN  INTN          GicDistributorBase,\r
-  IN  INTN          TargetListFilter,\r
-  IN  INTN          CPUTargetList,\r
-  IN  INTN          SgiId\r
-  )\r
-{\r
-  MmioWrite32 (GicDistributorBase + ARM_GIC_ICDSGIR, ((TargetListFilter & 0x3) << 24) | ((CPUTargetList & 0xFF) << 16) | SgiId);\r
-}\r
-\r
-RETURN_STATUS\r
-EFIAPI\r
-ArmGicAcknowledgeInterrupt (\r
-  IN  UINTN          GicDistributorBase,\r
-  IN  UINTN          GicInterruptInterfaceBase,\r
-  OUT UINTN          *CoreId,\r
-  OUT UINTN          *InterruptId\r
-  )\r
-{\r
-  UINT32            Interrupt;\r
-\r
-  // Read the Interrupt Acknowledge Register\r
-  Interrupt = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);\r
-\r
-  // Check if it is a valid interrupt ID\r
-  if ((Interrupt & 0x3FF) < ArmGicGetMaxNumInterrupts (GicDistributorBase)) {\r
-    // Got a valid SGI number hence signal End of Interrupt by writing to ICCEOIR\r
-    MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, Interrupt);\r
-\r
-    if (CoreId) {\r
-      *CoreId = (Interrupt >> 10) & 0x7;\r
-    }\r
-    if (InterruptId) {\r
-      *InterruptId = Interrupt & 0x3FF;\r
-    }\r
-    return RETURN_SUCCESS;\r
-  } else {\r
-    return RETURN_INVALID_PARAMETER;\r
-  }\r
-}\r
diff --git a/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c b/ArmPkg/Drivers/PL390Gic/PL390GicDxe.c
deleted file mode 100644 (file)
index 111ce14..0000000
+++ /dev/null
@@ -1,434 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>\r
-Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
-Portions copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR> \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
-Module Name:\r
-\r
-  Gic.c\r
-\r
-Abstract:\r
-\r
-  Driver implementing the GIC interrupt controller protocol\r
-\r
---*/\r
-\r
-#include <PiDxe.h>\r
-\r
-#include <Library/ArmLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/IoLib.h>\r
-#include <Library/ArmGicLib.h>\r
-\r
-#include <Protocol/Cpu.h>\r
-#include <Protocol/HardwareInterrupt.h>\r
-\r
-#define ARM_GIC_DEFAULT_PRIORITY  0x80\r
-\r
-extern EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptProtocol;\r
-\r
-//\r
-// Notifications\r
-//\r
-EFI_EVENT EfiExitBootServicesEvent      = (EFI_EVENT)NULL;\r
-\r
-// Maximum Number of Interrupts\r
-UINTN mGicNumInterrupts                 = 0;\r
-\r
-HARDWARE_INTERRUPT_HANDLER  *gRegisteredInterruptHandlers = NULL;\r
-\r
-/**\r
-  Register Handler for the specified interrupt source.\r
-\r
-  @param This     Instance pointer for this protocol\r
-  @param Source   Hardware source of the interrupt\r
-  @param Handler  Callback for interrupt. NULL to unregister\r
-\r
-  @retval EFI_SUCCESS Source was updated to support Handler.\r
-  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-RegisterInterruptSource (\r
-  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
-  IN HARDWARE_INTERRUPT_SOURCE          Source,\r
-  IN HARDWARE_INTERRUPT_HANDLER         Handler\r
-  )\r
-{\r
-  if (Source > mGicNumInterrupts) {\r
-    ASSERT(FALSE);\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  if ((Handler == NULL) && (gRegisteredInterruptHandlers[Source] == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((Handler != NULL) && (gRegisteredInterruptHandlers[Source] != NULL)) {\r
-    return EFI_ALREADY_STARTED;\r
-  }\r
-\r
-  gRegisteredInterruptHandlers[Source] = Handler;\r
-\r
-  // If the interrupt handler is unregistered then disable the interrupt\r
-  if (NULL == Handler){\r
-       return This->DisableInterruptSource (This, Source);\r
-  } else {\r
-       return This->EnableInterruptSource (This, Source);\r
-  }\r
-}\r
-\r
-/**\r
-  Enable interrupt source Source.\r
-\r
-  @param This     Instance pointer for this protocol\r
-  @param Source   Hardware source of the interrupt\r
-\r
-  @retval EFI_SUCCESS       Source interrupt enabled.\r
-  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EnableInterruptSource (\r
-  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
-  IN HARDWARE_INTERRUPT_SOURCE          Source\r
-  )\r
-{\r
-  UINT32    RegOffset;\r
-  UINTN     RegShift;\r
-  \r
-  if (Source > mGicNumInterrupts) {\r
-    ASSERT(FALSE);\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  // Calculate enable register offset and bit position\r
-  RegOffset = Source / 32;\r
-  RegShift = Source % 32;\r
-\r
-  // Write set-enable register\r
-  MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDISER + (4*RegOffset), 1 << RegShift);\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Disable interrupt source Source.\r
-\r
-  @param This     Instance pointer for this protocol\r
-  @param Source   Hardware source of the interrupt\r
-\r
-  @retval EFI_SUCCESS       Source interrupt disabled.\r
-  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-DisableInterruptSource (\r
-  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
-  IN HARDWARE_INTERRUPT_SOURCE          Source\r
-  )\r
-{\r
-  UINT32    RegOffset;\r
-  UINTN     RegShift;\r
-  \r
-  if (Source > mGicNumInterrupts) {\r
-    ASSERT(FALSE);\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  // Calculate enable register offset and bit position\r
-  RegOffset = Source / 32;\r
-  RegShift = Source % 32;\r
-\r
-  // Write set-enable register\r
-  MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDICER + (4*RegOffset), 1 << RegShift);\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Return current state of interrupt source Source.\r
-\r
-  @param This     Instance pointer for this protocol\r
-  @param Source   Hardware source of the interrupt\r
-  @param InterruptState  TRUE: source enabled, FALSE: source disabled.\r
-\r
-  @retval EFI_SUCCESS       InterruptState is valid\r
-  @retval EFI_DEVICE_ERROR  InterruptState is not valid\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-GetInterruptSourceState (\r
-  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
-  IN HARDWARE_INTERRUPT_SOURCE          Source,\r
-  IN BOOLEAN                            *InterruptState\r
-  )\r
-{\r
-  UINT32    RegOffset;\r
-  UINTN     RegShift;\r
-  \r
-  if (Source > mGicNumInterrupts) {\r
-    ASSERT(FALSE);\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-  \r
-  // calculate enable register offset and bit position\r
-  RegOffset = Source / 32;\r
-  RegShift = Source % 32;\r
-    \r
-  if ((MmioRead32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDISER + (4*RegOffset)) & (1<<RegShift)) == 0) {\r
-    *InterruptState = FALSE;\r
-  } else {\r
-    *InterruptState = TRUE;\r
-  }\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Signal to the hardware that the End Of Intrrupt state \r
-  has been reached.\r
-\r
-  @param This     Instance pointer for this protocol\r
-  @param Source   Hardware source of the interrupt\r
-\r
-  @retval EFI_SUCCESS       Source interrupt EOI'ed.\r
-  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EndOfInterrupt (\r
-  IN EFI_HARDWARE_INTERRUPT_PROTOCOL    *This,\r
-  IN HARDWARE_INTERRUPT_SOURCE          Source\r
-  )\r
-{\r
-  if (Source > mGicNumInterrupts) {\r
-    ASSERT(FALSE);\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCEIOR, Source);\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs.\r
-\r
-  @param  InterruptType    Defines the type of interrupt or exception that\r
-                           occurred on the processor.This parameter is processor architecture specific.\r
-  @param  SystemContext    A pointer to the processor context when\r
-                           the interrupt occurred on the processor.\r
-\r
-  @return None\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-IrqInterruptHandler (\r
-  IN EFI_EXCEPTION_TYPE           InterruptType,\r
-  IN EFI_SYSTEM_CONTEXT           SystemContext\r
-  )\r
-{\r
-  UINT32                      GicInterrupt;\r
-  HARDWARE_INTERRUPT_HANDLER  InterruptHandler;\r
-\r
-  GicInterrupt = MmioRead32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCIAR);\r
-\r
-  // Special Interrupts (ID1020-ID1023) have an Interrupt ID greater than the number of interrupt (ie: Spurious interrupt).\r
-  if (GicInterrupt >= mGicNumInterrupts) {\r
-    // The special interrupt do not need to be acknowledge\r
-    return;\r
-  }\r
-  \r
-  InterruptHandler = gRegisteredInterruptHandlers[GicInterrupt];\r
-  if (InterruptHandler != NULL) {\r
-    // Call the registered interrupt handler.\r
-    InterruptHandler (GicInterrupt, SystemContext);\r
-  } else {\r
-    DEBUG ((EFI_D_ERROR, "Spurious GIC interrupt: 0x%x\n", GicInterrupt));\r
-  }\r
-\r
-  EndOfInterrupt (&gHardwareInterruptProtocol, GicInterrupt);\r
-}\r
-\r
-//\r
-// Making this global saves a few bytes in image size\r
-//\r
-EFI_HANDLE  gHardwareInterruptHandle = NULL;\r
-\r
-//\r
-// The protocol instance produced by this driver\r
-//\r
-EFI_HARDWARE_INTERRUPT_PROTOCOL gHardwareInterruptProtocol = {\r
-  RegisterInterruptSource,\r
-  EnableInterruptSource,\r
-  DisableInterruptSource,\r
-  GetInterruptSourceState,\r
-  EndOfInterrupt\r
-};\r
-\r
-/**\r
-  Shutdown our hardware\r
-  \r
-  DXE Core will disable interrupts and turn off the timer and disable interrupts\r
-  after all the event handlers have run.\r
-\r
-  @param[in]  Event   The Event that is being processed\r
-  @param[in]  Context Event Context\r
-**/\r
-VOID\r
-EFIAPI\r
-ExitBootServicesEvent (\r
-  IN EFI_EVENT  Event,\r
-  IN VOID       *Context\r
-  )\r
-{\r
-  UINTN    Index;\r
-  \r
-  // Acknowledge all pending interrupts\r
-  for (Index = 0; Index < mGicNumInterrupts; Index++) {\r
-    DisableInterruptSource (&gHardwareInterruptProtocol, Index);\r
-  }\r
-\r
-  for (Index = 0; Index < mGicNumInterrupts; Index++) {\r
-    EndOfInterrupt (&gHardwareInterruptProtocol, Index);\r
-  }\r
-\r
-  // Disable Gic Interface\r
-  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCICR, 0x0);\r
-  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCPMR, 0x0);\r
-\r
-  // Disable Gic Distributor\r
-  MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDDCR, 0x0);\r
-}\r
-\r
-/**\r
-  Initialize the state information for the CPU Architectural Protocol\r
-\r
-  @param  ImageHandle   of the loaded driver\r
-  @param  SystemTable   Pointer to the System Table\r
-\r
-  @retval EFI_SUCCESS           Protocol registered\r
-  @retval EFI_OUT_OF_RESOURCES  Cannot allocate protocol data structure\r
-  @retval EFI_DEVICE_ERROR      Hardware problems\r
-\r
-**/\r
-EFI_STATUS\r
-InterruptDxeInitialize (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-  UINTN                   Index;\r
-  UINT32                  RegOffset;\r
-  UINTN                   RegShift;\r
-  EFI_CPU_ARCH_PROTOCOL   *Cpu;\r
-  UINT32                  CpuTarget;\r
-  \r
-  // Make sure the Interrupt Controller Protocol is not already installed in the system.\r
-  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);\r
-\r
-  mGicNumInterrupts = ArmGicGetMaxNumInterrupts (PcdGet32(PcdGicDistributorBase));\r
-\r
-  for (Index = 0; Index < mGicNumInterrupts; Index++) {\r
-    DisableInterruptSource (&gHardwareInterruptProtocol, Index);\r
-    \r
-    // Set Priority \r
-    RegOffset = Index / 4;\r
-    RegShift = (Index % 4) * 8;\r
-    MmioAndThenOr32 (\r
-      PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDIPR + (4*RegOffset),\r
-      ~(0xff << RegShift), \r
-      ARM_GIC_DEFAULT_PRIORITY << RegShift\r
-      );\r
-  }\r
-\r
-  //\r
-  // Targets the interrupts to the Primary Cpu\r
-  //\r
-\r
-  // Only Primary CPU will run this code. We can identify our GIC CPU ID by reading\r
-  // the GIC Distributor Target register. The 8 first GICD_ITARGETSRn are banked to each\r
-  // connected CPU. These 8 registers hold the CPU targets fields for interrupts 0-31.\r
-  // More Info in the GIC Specification about "Interrupt Processor Targets Registers"\r
-  //\r
-  // Read the first Interrupt Processor Targets Register (that corresponds to the 4\r
-  // first SGIs)\r
-  CpuTarget = MmioRead32 (PcdGet32 (PcdGicDistributorBase) + ARM_GIC_ICDIPTR);\r
-\r
-  // The CPU target is a bit field mapping each CPU to a GIC CPU Interface. This value\r
-  // is 0 when we run on a uniprocessor platform.\r
-  if (CpuTarget != 0) {\r
-    // The 8 first Interrupt Processor Targets Registers are read-only\r
-    for (Index = 8; Index < (mGicNumInterrupts / 4); Index++) {\r
-      MmioWrite32 (PcdGet32 (PcdGicDistributorBase) + ARM_GIC_ICDIPTR + (Index * 4), CpuTarget);\r
-    }\r
-  }\r
-\r
-  // Set binary point reg to 0x7 (no preemption)\r
-  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCBPR, 0x7);\r
-\r
-  // Set priority mask reg to 0xff to allow all priorities through\r
-  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCPMR, 0xff);\r
-  \r
-  // Enable gic cpu interface\r
-  MmioWrite32 (PcdGet32(PcdGicInterruptInterfaceBase) + ARM_GIC_ICCICR, 0x1);\r
-\r
-  // Enable gic distributor\r
-  MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDDCR, 0x1);\r
-  \r
-  // Initialize the array for the Interrupt Handlers\r
-  gRegisteredInterruptHandlers = (HARDWARE_INTERRUPT_HANDLER*)AllocateZeroPool (sizeof(HARDWARE_INTERRUPT_HANDLER) * mGicNumInterrupts);\r
-  \r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &gHardwareInterruptHandle,\r
-                  &gHardwareInterruptProtocolGuid,   &gHardwareInterruptProtocol,\r
-                  NULL\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
-  \r
-  //\r
-  // Get the CPU protocol that this driver requires.\r
-  //\r
-  Status = gBS->LocateProtocol(&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu);\r
-  ASSERT_EFI_ERROR(Status);\r
-\r
-  //\r
-  // Unregister the default exception handler.\r
-  //\r
-  Status = Cpu->RegisterInterruptHandler(Cpu, ARM_ARCH_EXCEPTION_IRQ, NULL);\r
-  ASSERT_EFI_ERROR(Status);\r
-\r
-  //\r
-  // Register to receive interrupts\r
-  //\r
-  Status = Cpu->RegisterInterruptHandler(Cpu, ARM_ARCH_EXCEPTION_IRQ, IrqInterruptHandler);\r
-  ASSERT_EFI_ERROR(Status);\r
-\r
-  // Register for an ExitBootServicesEvent\r
-  Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesEvent, NULL, &EfiExitBootServicesEvent);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
diff --git a/ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf b/ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf
deleted file mode 100644 (file)
index cf0b8f3..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#/** @file\r
-#  \r
-#  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
-#  Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>\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                      = PL390GicDxe\r
-  FILE_GUID                      = DE371F7C-DEC4-4D21-ADF1-593ABCC15882 \r
-  MODULE_TYPE                    = DXE_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-\r
-  ENTRY_POINT                    = InterruptDxeInitialize\r
-\r
-\r
-[Sources.common]\r
-  PL390Gic.c\r
-  PL390GicDxe.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  EmbeddedPkg/EmbeddedPkg.dec\r
-  ArmPkg/ArmPkg.dec\r
-\r
-[LibraryClasses]\r
-  BaseLib\r
-  UefiLib\r
-  UefiBootServicesTableLib\r
-  DebugLib\r
-  PrintLib\r
-  MemoryAllocationLib\r
-  UefiDriverEntryPoint\r
-  IoLib\r
-\r
-[Protocols]\r
-  gHardwareInterruptProtocolGuid\r
-  gEfiCpuArchProtocolGuid\r
-  \r
-[FixedPcd.common]\r
-  gArmTokenSpaceGuid.PcdGicDistributorBase\r
-  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
-  \r
-  gArmTokenSpaceGuid.PcdArmPrimaryCore\r
-\r
-[Depex]\r
-  gEfiCpuArchProtocolGuid\r
diff --git a/ArmPkg/Drivers/PL390Gic/PL390GicLib.inf b/ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
deleted file mode 100644 (file)
index d0cac02..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#/* @file\r
-#  Copyright (c) 2011-2012, ARM Limited. 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                      = PL390GicLib\r
-  FILE_GUID                      = 03d05ee4-cdeb-458c-9dfc-993f09bdf405\r
-  MODULE_TYPE                    = SEC\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = ArmGicLib\r
-\r
-[Sources]\r
-  PL390Gic.c\r
-  PL390GicNonSec.c\r
-\r
-[LibraryClasses]\r
-  IoLib\r
-\r
-[Packages]\r
-  ArmPkg/ArmPkg.dec\r
-  MdePkg/MdePkg.dec\r
diff --git a/ArmPkg/Drivers/PL390Gic/PL390GicNonSec.c b/ArmPkg/Drivers/PL390Gic/PL390GicNonSec.c
deleted file mode 100644 (file)
index 55ff56e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/** @file\r
-*\r
-*  Copyright (c) 2011, ARM Limited. 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
-#include <Uefi.h>\r
-#include <Library/IoLib.h>\r
-#include <Library/ArmGicLib.h>\r
-\r
-\r
-VOID\r
-EFIAPI\r
-ArmGicEnableInterruptInterface (\r
-  IN  INTN          GicInterruptInterfaceBase\r
-  )\r
-{  \r
-  /*\r
-  * Enable the CPU interface in Non-Secure world\r
-  * Note: The ICCICR register is banked when Security extensions are implemented\r
-  */\r
-  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCICR, 0x1);\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-ArmGicEnableDistributor (\r
-  IN  INTN          GicDistributorBase\r
-  )\r
-{\r
-  /*\r
-   * Enable GIC distributor in Non-Secure world.\r
-   * Note: The ICDDCR register is banked when Security extensions are implemented\r
-   */\r
-  MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);\r
-}\r
diff --git a/ArmPkg/Drivers/PL390Gic/PL390GicSec.c b/ArmPkg/Drivers/PL390Gic/PL390GicSec.c
deleted file mode 100644 (file)
index bae76e4..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/** @file\r
-*\r
-*  Copyright (c) 2011-2013, ARM Limited. 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
-#include <Base.h>\r
-#include <Library/ArmLib.h>\r
-#include <Library/ArmPlatformLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/IoLib.h>\r
-#include <Library/ArmGicLib.h>\r
-\r
-/*\r
- * This function configures the all interrupts to be Non-secure.\r
- *\r
- */\r
-VOID\r
-EFIAPI\r
-ArmGicSetupNonSecure (\r
-  IN  UINTN         MpId,\r
-  IN  INTN          GicDistributorBase,\r
-  IN  INTN          GicInterruptInterfaceBase\r
-  )\r
-{\r
-  UINTN InterruptId;\r
-  UINTN CachedPriorityMask;\r
-  UINTN Index;\r
-\r
-  CachedPriorityMask = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR);\r
-\r
-  // Set priority Mask so that no interrupts get through to CPU\r
-  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR, 0);\r
-\r
-  InterruptId = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);\r
-\r
-  // Only try to clear valid interrupts. Ignore spurious interrupts.\r
-  while ((InterruptId & 0x3FF) < ArmGicGetMaxNumInterrupts (GicDistributorBase))   {\r
-    // Some of the SGI's are still pending, read Ack register and send End of Interrupt Signal\r
-    MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCEIOR, InterruptId);\r
-\r
-    // Next\r
-    InterruptId = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCIAR);\r
-  }\r
-\r
-  // Only the primary core should set the Non Secure bit to the SPIs (Shared Peripheral Interrupt).\r
-  if (ArmPlatformIsPrimaryCore (MpId)) {\r
-    // Ensure all GIC interrupts are Non-Secure\r
-    for (Index = 0; Index < (ArmGicGetMaxNumInterrupts (GicDistributorBase) / 32); Index++) {\r
-      MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4), 0xffffffff);\r
-    }\r
-  } else {\r
-    // The secondary cores only set the Non Secure bit to their banked PPIs\r
-    MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISR, 0xffffffff);\r
-  }\r
-\r
-  // Ensure all interrupts can get through the priority mask\r
-  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR, CachedPriorityMask);\r
-}\r
-\r
-/*\r
- * This function configures the interrupts set by the mask to be secure.\r
- *\r
- */\r
-VOID\r
-EFIAPI\r
-ArmGicSetSecureInterrupts (\r
-  IN  UINTN         GicDistributorBase,\r
-  IN  UINTN*        GicSecureInterruptMask,\r
-  IN  UINTN         GicSecureInterruptMaskSize\r
-  )\r
-{\r
-  UINTN  Index;\r
-  UINT32 InterruptStatus;\r
-\r
-  // We must not have more interrupts defined by the mask than the number of available interrupts\r
-  ASSERT(GicSecureInterruptMaskSize <= (ArmGicGetMaxNumInterrupts (GicDistributorBase) / 32));\r
-\r
-  // Set all the interrupts defined by the mask as Secure\r
-  for (Index = 0; Index < GicSecureInterruptMaskSize; Index++) {\r
-    InterruptStatus = MmioRead32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4));\r
-    MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISR + (Index * 4), InterruptStatus & (~GicSecureInterruptMask[Index]));\r
-  }\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-ArmGicEnableInterruptInterface (\r
-  IN  INTN          GicInterruptInterfaceBase\r
-  )\r
-{\r
-  // Set Priority Mask to allow interrupts\r
-  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCPMR, 0x000000FF);\r
-\r
-  // Enable CPU interface in Secure world\r
-  // Enable CPU interface in Non-secure World\r
-  // Signal Secure Interrupts to CPU using FIQ line *\r
-  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCICR,\r
-      ARM_GIC_ICCICR_ENABLE_SECURE |\r
-      ARM_GIC_ICCICR_ENABLE_NS |\r
-      ARM_GIC_ICCICR_SIGNAL_SECURE_TO_FIQ);\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-ArmGicDisableInterruptInterface (\r
-  IN  INTN          GicInterruptInterfaceBase\r
-  )\r
-{\r
-  UINT32    ControlValue;\r
-\r
-  // Disable CPU interface in Secure world and Non-secure World\r
-  ControlValue = MmioRead32 (GicInterruptInterfaceBase + ARM_GIC_ICCICR);\r
-  MmioWrite32 (GicInterruptInterfaceBase + ARM_GIC_ICCICR, ControlValue & ~(ARM_GIC_ICCICR_ENABLE_SECURE | ARM_GIC_ICCICR_ENABLE_NS));\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-ArmGicEnableDistributor (\r
-  IN  INTN          GicDistributorBase\r
-  )\r
-{\r
-  // Turn on the GIC distributor\r
-  MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 1);\r
-}\r
diff --git a/ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf b/ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf
deleted file mode 100644 (file)
index 205e503..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#/* @file\r
-#  Copyright (c) 2011-2012, ARM Limited. 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                      = PL390GicSecLib\r
-  FILE_GUID                      = 85f3cf80-b5f4-11df-9855-0002a5d5c51b\r
-  MODULE_TYPE                    = SEC\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = ArmGicLib\r
-\r
-[Sources]\r
-  PL390Gic.c\r
-  PL390GicSec.c\r
-\r
-[Packages]\r
-  ArmPkg/ArmPkg.dec\r
-  ArmPlatformPkg/ArmPlatformPkg.dec\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-\r
-[LibraryClasses]\r
-  ArmLib\r
-  ArmPlatformLib\r
-  DebugLib\r
-  IoLib\r
-  PcdLib\r
-\r
index 429f8ade12e4ac863ea31bd9722570b422f2c816..3280cf8eeb2f03e95996ffea2895b0b3f09965d2 100644 (file)
@@ -12,8 +12,8 @@
 *\r
 **/\r
 \r
-#ifndef __PL390GIC_H\r
-#define __PL390GIC_H\r
+#ifndef __ARMGIC_H\r
+#define __ARMGIC_H\r
 \r
 //\r
 // GIC definitions\r
index b8b439555b8ce5880406771365a126a4c29dfeca..c6cef797b16bb323ea3e7fb0d426a9d37b87552f 100644 (file)
@@ -77,7 +77,7 @@
   CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
   DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
-  ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
+  ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
   ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
   ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
 \r
index c353e6f902ca2865dd9c25020da8c1201d0f6a89..2221b88f33d83118af8fd07a6c87964fa199a00f 100644 (file)
@@ -77,7 +77,7 @@
   CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
   DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
-  ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
+  ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
   ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
 \r
   SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
   \r
   #\r
index c4a1df5a0d39bd8a9bcb4206e4a64a94fb6f280c..998b8262911e1d002fcb89665d1da46e77e88b90 100644 (file)
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x10009000\r
   \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x10041000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x10040000\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
   \r
   #\r
   MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   EmbeddedPkg/SerialDxe/SerialDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
   \r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
index 2686df4eefbc39180cd49498712589b07f16979e..36bd1ab3e5c497e21b6291b2a022367ea2cbe6d7 100644 (file)
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x10009000\r
   \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x1F001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x1F000100\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
   \r
   #\r
   MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   EmbeddedPkg/SerialDxe/SerialDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
   \r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
index babadd87e93f0b94eb66e3e5c34e5e5917b79441..7b96b0e0593f1cd7bbe95a2f16e94aa61bdca4e0 100644 (file)
@@ -138,7 +138,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
   \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
   \r
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
index 2e8ae2f500052c896a163208339c31c2e34e6ce9..705e21802b73fa85831c5138e2f83d5114a65bf8 100644 (file)
@@ -139,7 +139,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
   \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
   \r
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
index bc4807f3f1a3ac68a8be5f55731f64ec2e3b654a..97ee9123a128f10a8e73f4b59b407ca491c74fc9 100644 (file)
@@ -60,7 +60,7 @@
   CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
   DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
-  ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
+  ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
   ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
 \r
   # RealView Emulation Board Specific Libraries\r
index 0cc44341653282185e40df4c1ca5925f4677b8e4..cb1c87f540688e3962cde1ce134ef8b023e57dfc 100644 (file)
@@ -39,8 +39,8 @@
 \r
   #DebugAgentTimerLib|ArmPlatformPkg/ArmVExpressPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf\r
 \r
-  # ARM PL390 General Interrupt Driver in Secure and Non-secure\r
-  ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
+  # ARM General Interrupt Driver in Secure and Non-secure\r
+  ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
 \r
   LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf\r
   \r
   \r
   \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x2C001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x2C002000\r
 \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   #ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcdGraphicsOutputDxe.inf\r
index 290e04830c5851b4ea656ccf61a640d9ec8ba88a..465b88a8002f92a2bec278ca253e7b170aa72cf2 100644 (file)
@@ -92,7 +92,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
 \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   #INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index 42a5119e74a2305f4c2fcaf1f0df184e06ddcb11..64fcb3d4f9b720b54f73578685d356a6e05f1553 100644 (file)
   gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x10005000\r
   \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x1e001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x1e000100\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
   \r
   #\r
   \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index 34b9d250a15d7ec5bb75d91eb878118fd0efeec2..cd44c516454fb043d28ef42a49e1b7e0e6305b8e 100644 (file)
@@ -166,7 +166,7 @@ READ_LOCK_STATUS   = TRUE
 \r
   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
 \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index 2d12f4ba85e5e3d1b8d997c59d8db30636137afb..b1ce4584d1537165eb5f838a182b4603abd9f0a6 100644 (file)
   gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
   \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x2C001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x2C002000\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
   \r
   #\r
 \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index af42aefa9a6649f4485839bc8a82df7f6f322cdf..a15a0f082e046e2003419c7789f64b18a54e442a 100644 (file)
@@ -138,7 +138,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
 \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index efd80ab0a77c91767e0e8ef22ff1f4dfb60474f1..440ff9a2944d6bf61e224d4d494b022484ec7c93 100644 (file)
   gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
   \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x2C001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x2C002000\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
   \r
   #\r
 \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index 24e55751d51936c7a7ea89ae273cc0c9601947ad..6b5d516d3d6b9ad4ca431bafc28ac03b078f9dc8 100644 (file)
@@ -138,7 +138,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
 \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index b6355026a3d46604acaef84feaf7239fa990991f..f04f7801165fc8c49bfbd16da4d09e3a109ae700 100644 (file)
   gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
   \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x2C001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x2C000100\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
   \r
   #\r
 \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index 728eb785046bd73ceef3e38e73696bc164c45130..346a90e216bf16640b2c75a519626334578920eb 100644 (file)
@@ -137,7 +137,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
 \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index 4ba827b288fda1ac7e3317de8c8808bad861b4dc..f4aeee8e21c628a5eb97bbad5bebbaad66e06726 100644 (file)
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400\r
 \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x2C001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x2C002000\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
 \r
   #\r
 \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
 \r
index a358b061d3c7bf57c82d3053336cd2eac1613414..7763b6781895f493ced6dd13018116f10645c8f8 100644 (file)
@@ -137,7 +137,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
 \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
 \r
index 9c4d0bdb2244f361ae0b1b94354802738a88caf4..eb1a9889486484e85c5c17d6a8506955a3015dd3 100644 (file)
   gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
  \r
   #\r
-  # ARM PL390 General Interrupt Controller\r
+  # ARM General Interrupt Controller\r
   #\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x2C001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x2C002000\r
   ArmPlatformPkg/Sec/Sec.inf {\r
     <LibraryClasses>\r
       # Use the implementation which set the Secure bits\r
-      ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf\r
+      ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
   }\r
  \r
   #\r
 \r
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
 \r
-  ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index c732442b227b6c1c62fd44fda6035b1582e246be..26e0828b44ab0e2aca19fac6c06a9fb171582528 100644 (file)
@@ -139,7 +139,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
   INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
 \r
-  INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf\r
+  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
   INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
   INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
index dee39aa8e2f3ab9dc850fce4a9396d50a5edfb86..93e541239c1b9dd777ba7f3d87004dbaa609d005 100644 (file)
@@ -60,7 +60,7 @@
   CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
   ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf\r
   DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf\r
-  ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf\r
+  ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
   ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
   ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
 \r