]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/ArmCpuLib: Replaced complex functions ArmCpuSynchronizeWait & ArmCpuSynchroniz...
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 2 May 2012 19:55:32 +0000 (19:55 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 2 May 2012 19:55:32 +0000 (19:55 +0000)
Previsouly the synchronization of MpCore was using the SGI (Software
Generated Interrupt) to synchronize MpCore during the early boot.
This commit replaced this mechanism by the more appropriate SEV/WFE
instructions (Send/Wait Event instructions).
That also eases the port to a new cpu/platform.

Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13249 6f19259b-4bc3-4df7-8a09-765794883524

19 files changed:
ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11Lib.c
ArmPkg/Drivers/ArmCpuLib/Arm11MpCoreLib/Arm11MpCoreLib.inf
ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.c
ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
ArmPkg/Drivers/ArmCpuLib/ArmCortexA8Lib/ArmCortexA8Lib.c
ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Helper.S
ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Helper.asm
ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.c
ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf
ArmPkg/Include/Library/ArmCpuLib.h
ArmPkg/Include/Library/ArmLib.h
ArmPkg/Library/ArmLib/Common/ArmLibSupport.S
ArmPkg/Library/ArmLib/Common/ArmLibSupport.asm
ArmPlatformPkg/PrePi/PeiMPCore.inf
ArmPlatformPkg/PrePi/PeiUniCore.inf
ArmPlatformPkg/PrePi/PrePi.c
ArmPlatformPkg/Sec/Sec.c
ArmPlatformPkg/Sec/SecEntryPoint.S
ArmPlatformPkg/Sec/SecEntryPoint.asm

index 2e285d54c7cdedafd45f974f2222cf50ba9c7ac1..a08b7b1aee3f7d927ed260578c8d1c4c5cad8854 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2011, ARM Limited. All rights reserved.\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
 #include <Base.h>\r
 #include <Library/ArmLib.h>\r
 #include <Library/ArmCpuLib.h>\r
-#include <Library/ArmGicLib.h>\r
 #include <Library/IoLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
-VOID\r
-ArmCpuSynchronizeSignal (\r
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-  )\r
-{\r
-  if (Event == ARM_CPU_EVENT_BOOT_MEM_INIT) {\r
-    // Do nothing, Cortex A9 secondary cores are waiting for the SCU to be\r
-    // enabled (done by ArmCpuSetup()) as a way to know when the Init Boot\r
-    // Mem as been initialized\r
-  } else {\r
-    // Send SGI to all Secondary core to wake them up from WFI state.\r
-    ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E);\r
-  }\r
-}\r
-\r
-VOID\r
-CArmCpuSynchronizeWait (\r
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-  )\r
-{\r
-  // Waiting for the SGI from the primary core\r
-  ArmCallWFI ();\r
-\r
-  // Acknowledge the interrupt and send End of Interrupt signal.\r
-  ArmGicAcknowledgeSgiFrom (PcdGet32(PcdGicInterruptInterfaceBase), PRIMARY_CORE_ID);\r
-}\r
-\r
-#if 0\r
-VOID\r
-ArmEnableScu (\r
-  VOID\r
-  )\r
-{\r
-  INTN          ScuBase;\r
-\r
-  ScuBase = ArmGetScuBaseAddress();\r
-\r
-  // Invalidate all: write -1 to SCU Invalidate All register\r
-  MmioWrite32(ScuBase + A9_SCU_INVALL_OFFSET, 0xffffffff);\r
-  // Enable SCU\r
-  MmioWrite32(ScuBase + A9_SCU_CONTROL_OFFSET, 0x1);\r
-}\r
-#endif\r
-\r
 VOID\r
 ArmCpuSetup (\r
   IN  UINTN         MpId\r
   )\r
 {\r
-  /*AMP mode and SMP mode\r
-\r
-   By default, the processor is in AMP mode (bit 5 reset to 0). To prevent coherent data corruption the sequence to turn on MP11 CPUs in SMP mode is:\r
-\r
-   1.Write the SCU register to change CPU mode.\r
-   2.Disable interrupts.\r
-   3.Clean and invalidate all the D-cache.\r
-   4.Write SMP/nAMP bit as 1.\r
-   5.Enable interrupts.\r
-\r
-  Source: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0360e/BIHHFGEC.html\r
-  */\r
-\r
-  // If MPCore then Enable the SCU\r
-  if (ArmIsMpCore()) {\r
-    //ArmEnableScu ();\r
-  }\r
+  ASSERT(0); //TODO: Implement me\r
 }\r
 \r
 \r
@@ -93,20 +32,6 @@ ArmCpuSetupSmpNonSecure (
   IN  UINTN         MpId\r
   )\r
 {\r
-#if 0\r
-  INTN          ScuBase;\r
-\r
-  ArmSetAuxCrBit (A9_FEATURE_SMP);\r
-\r
-  // Make the SCU accessible in Non Secure world\r
-  if (IS_PRIMARY_CORE(MpId)) {\r
-    ScuBase = ArmGetScuBaseAddress();\r
-\r
-    // Allow NS access to SCU register\r
-    MmioOr32 (ScuBase + A9_SCU_SACR_OFFSET, 0xf);\r
-    // Allow NS access to Private Peripherals\r
-    MmioOr32 (ScuBase + A9_SCU_SSACR_OFFSET, 0xfff);\r
-  }\r
-#endif\r
+  ASSERT(0); //TODO: Implement me\r
 }\r
 \r
index 2b9621c6ec524e98027d0b31b01dd366a46c8539..f7ecfb0900d47ea3be3207f8f7fd9379fedb8dbc 100644 (file)
@@ -1,5 +1,5 @@
 #/* @file\r
-#  Copyright (c) 2011, ARM Limited. All rights reserved.\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
 \r
 [LibraryClasses]\r
   ArmLib\r
-  ArmGicSecLib\r
   IoLib\r
   PcdLib\r
 \r
 [Sources.common]\r
   Arm11Lib.c\r
-  Arm11Helper.asm     | RVCT\r
-  Arm11Helper.S       | GCC\r
-\r
-[FixedPcd]\r
-  gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
-  gArmTokenSpaceGuid.PcdArmPrimaryCore\r
-\r
-  gArmTokenSpaceGuid.PcdGicDistributorBase\r
-  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
index a3af3a8c55f5a20d73d241e4dcc29334941901cc..9b64d662d9d70f92f0038d555f9b1c7d87335f00 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2011, ARM Limited. All rights reserved.\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
@@ -15,7 +15,6 @@
 #include <Base.h>\r
 #include <Library/ArmLib.h>\r
 #include <Library/ArmCpuLib.h>\r
-#include <Library/ArmGicLib.h>\r
 #include <Library/ArmV7ArchTimerLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/IoLib.h>\r
 \r
 #include <Chipset/ArmV7.h>\r
 \r
-VOID\r
-ArmCpuSynchronizeSignal (\r
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-  )\r
-{\r
-  if (Event == ARM_CPU_EVENT_BOOT_MEM_INIT) {\r
-    // Do nothing, Cortex A15 secondary cores are waiting for the GIC Distributor\r
-    // to be enabled (done by the Sec module itself) as a way to know when the Init Boot\r
-    // Mem as been initialized\r
-  } else {\r
-    // Send SGI to all Secondary core to wake them up from WFI state.\r
-    ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E);\r
-  }\r
-}\r
-\r
-VOID\r
-CArmCpuSynchronizeWait (\r
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-  )\r
-{\r
-  // Waiting for the SGI from the primary core\r
-  ArmCallWFI ();\r
-\r
-  // Acknowledge the interrupt and send End of Interrupt signal.\r
-  ArmGicAcknowledgeSgiFrom (PcdGet32(PcdGicInterruptInterfaceBase), PRIMARY_CORE_ID);\r
-}\r
-\r
 VOID\r
 ArmCpuSetup (\r
   IN  UINTN         MpId\r
index 69ecfb109c0d92587ad5f66109eab912b99ab15e..bcf7f6bfba49f24a09b30bee125fd45ddc7422f4 100644 (file)
@@ -1,5 +1,5 @@
 #/* @file\r
-#  Copyright (c) 2011, ARM Limited. All rights reserved.\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
 \r
 [LibraryClasses]\r
   ArmLib\r
-  ArmGicSecLib\r
   IoLib\r
   PcdLib\r
 \r
 [Sources.common]\r
   ArmCortexA15Lib.c\r
-  ArmCortexA15Helper.asm     | RVCT\r
-  ArmCortexA15Helper.S       | GCC\r
 \r
 [FeaturePcd]\r
 \r
@@ -40,7 +37,4 @@
   gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
   gArmTokenSpaceGuid.PcdArmPrimaryCore\r
 \r
-  gArmTokenSpaceGuid.PcdGicDistributorBase\r
-  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
-\r
   gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz\r
index d755f6824303a8a9487702b0ab47e92a2c4a567f..e0ba1fab8d90e9d957f90062a863f46c6f1c190a 100644 (file)
 \r
 #include <Chipset/ArmV7.h>\r
 \r
-VOID\r
-ArmCpuSynchronizeWait (\r
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-  )\r
-{\r
-  // The CortexA8 is a Unicore CPU. We must not use Synchronization functions\r
-  ASSERT(0);\r
-}\r
-\r
-VOID\r
-ArmCpuSynchronizeSignal (\r
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-  )\r
-{\r
-  // The CortexA8 is a Unicore CPU. We must not use Synchronization functions\r
-  ASSERT(0);\r
-}\r
-\r
 VOID\r
 ArmCpuSetup (\r
   IN  UINTN         MpId\r
index c69c8d44c5d007e9fd0ead3a4472590d22d21201..5db58619220636d3dfabcc3a620124cf1c18c3b4 100644 (file)
@@ -1,5 +1,5 @@
 //\r
-//  Copyright (c) 2011, ARM Limited. All rights reserved.\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
 .text\r
 .align 3\r
 \r
-GCC_ASM_EXPORT(ArmCpuSynchronizeWait)\r
 GCC_ASM_EXPORT(ArmGetScuBaseAddress)\r
-GCC_ASM_IMPORT(CArmCpuSynchronizeWait)\r
-\r
-// VOID\r
-// ArmCpuSynchronizeWait (\r
-//   IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-//   );\r
-ASM_PFX(ArmCpuSynchronizeWait):\r
-  cmp   r0, #ARM_CPU_EVENT_BOOT_MEM_INIT\r
-  // The SCU enabled is the event to tell us the Init Boot Memory is initialized\r
-  beq   ASM_PFX(ArmWaitScuEnabled)\r
-  // Case when the stack has been set up\r
-  push {r1,lr}\r
-  LoadConstantToReg (ASM_PFX(CArmCpuSynchronizeWait), r1)\r
-  blx   r1\r
-  pop  {r1,lr}\r
-  bx   lr\r
 \r
 // IN None\r
 // OUT r0 = SCU Base Address\r
@@ -45,14 +28,3 @@ ASM_PFX(ArmGetScuBaseAddress):
   // offset 0x0000 from the Private Memory Region.\r
   mrc   p15, 4, r0, c15, c0, 0\r
   bx  lr\r
-\r
-ASM_PFX(ArmWaitScuEnabled):\r
-  // Read Configuration Base Address Register. ArmCBar cannot be called to get\r
-  // the Configuration BAR as a stack is not necessary setup. The SCU is at the\r
-  // offset 0x0000 from the Private Memory Region.\r
-  mrc   p15, 4, r0, c15, c0, 0\r
-  add   r0, r0, #A9_SCU_CONTROL_OFFSET\r
-  ldr   r0, [r0]\r
-  cmp   r0, #1\r
-  bne   ASM_PFX(ArmWaitScuEnabled)\r
-  bx    lr\r
index ef5015c1896d12db6f4d2895160a82fe980dbb2c..7150834b023a697c0e2dec5a3d122677dc72c97e 100644 (file)
@@ -1,5 +1,5 @@
 //\r
-//  Copyright (c) 2011, ARM Limited. All rights reserved.\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
 \r
   INCLUDE AsmMacroIoLib.inc\r
 \r
-  EXPORT  ArmCpuSynchronizeWait\r
   EXPORT  ArmGetScuBaseAddress\r
-  IMPORT  CArmCpuSynchronizeWait\r
 \r
   PRESERVE8\r
   AREA    ArmCortexA9Helper, CODE, READONLY\r
 \r
-// VOID\r
-// ArmCpuSynchronizeWait (\r
-//   IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-//   );\r
-ArmCpuSynchronizeWait\r
-  cmp   r0, #ARM_CPU_EVENT_BOOT_MEM_INIT\r
-  // The SCU enabled is the event to tell us the Init Boot Memory is initialized\r
-  beq   ArmWaitScuEnabled\r
-  // Case when the stack has been set up\r
-  push {r1,lr}\r
-  LoadConstantToReg (CArmCpuSynchronizeWait, r1)\r
-  blx   r1\r
-  pop  {r1,lr}\r
-  bx   lr\r
-\r
 // IN None\r
 // OUT r0 = SCU Base Address\r
 ArmGetScuBaseAddress\r
@@ -48,15 +31,4 @@ ArmGetScuBaseAddress
   mrc   p15, 4, r0, c15, c0, 0\r
   bx  lr\r
 \r
-ArmWaitScuEnabled\r
-  // Read Configuration Base Address Register. ArmCBar cannot be called to get\r
-  // the Configuration BAR as a stack is not necessary setup. The SCU is at the\r
-  // offset 0x0000 from the Private Memory Region.\r
-  mrc   p15, 4, r0, c15, c0, 0\r
-  add   r0, r0, #A9_SCU_CONTROL_OFFSET\r
-  ldr   r0, [r0]\r
-  cmp   r0, #1\r
-  bne   ArmWaitScuEnabled\r
-  bx    lr\r
-\r
   END\r
index 7c5c3ee6a99b9f254c2434583c216f84db7dd4db..324ddb58509fbd70fc71803e9f0937686adbb566 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2011, ARM Limited. All rights reserved.\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
 #include <Base.h>\r
 #include <Library/ArmLib.h>\r
 #include <Library/ArmCpuLib.h>\r
-#include <Library/ArmGicLib.h>\r
 #include <Library/IoLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
 #include <Chipset/ArmCortexA9.h>\r
 \r
-VOID\r
-ArmCpuSynchronizeSignal (\r
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-  )\r
-{\r
-  if (Event == ARM_CPU_EVENT_BOOT_MEM_INIT) {\r
-    // Do nothing, Cortex A9 secondary cores are waiting for the SCU to be\r
-    // enabled (done by ArmCpuSetup()) as a way to know when the Init Boot\r
-    // Mem as been initialized\r
-  } else {\r
-    // Send SGI to all Secondary core to wake them up from WFI state.\r
-    ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E);\r
-  }\r
-}\r
-\r
-VOID\r
-CArmCpuSynchronizeWait (\r
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event\r
-  )\r
-{\r
-  // Waiting for the SGI from the primary core\r
-  ArmCallWFI ();\r
-\r
-  // Acknowledge the interrupt and send End of Interrupt signal.\r
-  ArmGicAcknowledgeSgiFrom (PcdGet32(PcdGicInterruptInterfaceBase), PRIMARY_CORE_ID);\r
-}\r
-\r
 VOID\r
 ArmEnableScu (\r
   VOID\r
index a03efd237b6008524cf3df4f5b9d558349c2f92c..866736f6ff14060e713b886b527dd74079c9b16e 100644 (file)
@@ -1,5 +1,5 @@
 #/* @file\r
-#  Copyright (c) 2011, ARM Limited. All rights reserved.\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
@@ -25,7 +25,6 @@
 \r
 [LibraryClasses]\r
   ArmLib\r
-  ArmGicSecLib\r
   IoLib\r
   PcdLib\r
 \r
@@ -39,6 +38,3 @@
 [FixedPcd]\r
   gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
   gArmTokenSpaceGuid.PcdArmPrimaryCore\r
-\r
-  gArmTokenSpaceGuid.PcdGicDistributorBase\r
-  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
index 8de5aad63282d5fedd1c4d7e8954cb79128d6f73..6f92b111d60c4aff2dea0cdb4f7d8371eb992016 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2011, ARM Limited. All rights reserved.
+  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
 #ifndef __ARMCPU_LIB__
 #define __ARMCPU_LIB__
 
-// These are #define and not enum to be used in assembly files
-#define ARM_CPU_EVENT_DEFAULT         0
-#define ARM_CPU_EVENT_BOOT_MEM_INIT   1
-#define ARM_CPU_EVENT_SECURE_INIT     2
-
-typedef UINTN ARM_CPU_SYNCHRONIZE_EVENT;
-
-
-VOID
-ArmCpuSynchronizeWait (
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event
-  );
-
-VOID
-ArmCpuSynchronizeSignal (
-  IN ARM_CPU_SYNCHRONIZE_EVENT   Event
-  );
-
 VOID
 ArmCpuSetup (
   IN  UINTN         MpId
index c1d4009aa5d2c2d3779f974401dae065c0c04482..9b4a036befe94d7d67db2e66c2138e0bb569e1da 100644 (file)
@@ -438,6 +438,16 @@ ArmSetAuxCrBit (
 
 VOID
 EFIAPI
+ArmCallSEV (
+  VOID
+  );
+
+VOID
+EFIAPI
+ArmCallWFE (
+  VOID
+  );
+
 ArmCallWFI (
   VOID
   );
index d00a3623c5e10c275d9b1c481443432529c62a1e..da927b9d4351fd3593e750875649c5fd97d7e112 100644 (file)
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------ \r
 #\r
 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-# Copyright (c) 2011, ARM Limited. All rights reserved.\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
@@ -40,6 +40,8 @@ GCC_ASM_EXPORT(ArmUpdateTranslationTableEntry)
 GCC_ASM_EXPORT(ArmWriteNsacr)\r
 GCC_ASM_EXPORT(ArmWriteScr)\r
 GCC_ASM_EXPORT(ArmWriteVMBar)\r
+GCC_ASM_EXPORT(ArmCallWFE)\r
+GCC_ASM_EXPORT(ArmCallSEV)\r
 \r
 #------------------------------------------------------------------------------\r
 \r
@@ -146,4 +148,12 @@ ASM_PFX(ArmWriteVMBar):
   mcr     p15, 0, r0, c12, c0, 1\r
   bx      lr\r
 \r
+ASM_PFX(ArmCallWFE):\r
+  wfe\r
+  bx      lr\r
+\r
+ASM_PFX(ArmCallSEV):\r
+  sev\r
+  bx      lr\r
+\r
 ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r
index b892603518be7456f734d450157e8b25727c0759..186ee33dfa3884ff4cef62b78eb673269a4db7e6 100644 (file)
@@ -40,6 +40,8 @@
     EXPORT ArmWriteNsacr\r
     EXPORT ArmWriteScr\r
     EXPORT ArmWriteVMBar\r
+    EXPORT ArmCallWFE\r
+    EXPORT ArmCallSEV\r
 \r
     AREA ArmLibSupport, CODE, READONLY\r
 \r
@@ -146,4 +148,12 @@ ArmWriteVMBar
   mcr     p15, 0, r0, c12, c0, 1\r
   bx      lr\r
   \r
+ArmCallWFE\r
+  wfe\r
+  blx   lr\r
+\r
+ArmCallSEV\r
+  sev\r
+  blx   lr\r
+\r
   END\r
index 4b05583779c7034466ac75eb0fcfc1b8742927b1..92c1d81f87f3671ac945c97e178684e5c9255399 100755 (executable)
@@ -38,7 +38,6 @@
   BaseLib\r
   DebugLib\r
   DebugAgentLib\r
-  ArmCpuLib\r
   ArmLib\r
   ArmGicLib\r
   IoLib\r
index 2d3617fd67a4c577b893e9171d25317734e7564c..cfd40bc155aad9204b34254d84067402747be7ac 100755 (executable)
@@ -1,6 +1,7 @@
 #/** @file\r
 #  \r
-#  Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
+#  Copyright (c) 2011-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
@@ -38,7 +39,6 @@
   BaseLib\r
   DebugLib\r
   DebugAgentLib\r
-  ArmCpuLib\r
   ArmLib\r
   IoLib\r
   TimerLib\r
index f3cb3a121f90b657ccc452ab96c1a51dd944be5f..5090c251232cd79cff1693daec7060dc1d86bb86 100755 (executable)
@@ -14,7 +14,6 @@
 \r
 #include <PiPei.h>\r
 \r
-#include <Library/ArmCpuLib.h>\r
 #include <Library/DebugAgentLib.h>\r
 #include <Library/PrePiLib.h>\r
 #include <Library/PrintLib.h>\r
@@ -204,11 +203,12 @@ CEntryPoint (
     if (IS_PRIMARY_CORE(MpId)) {\r
       mGlobalVariableBase = GlobalVariableBase;\r
       if (ArmIsMpCore()) {\r
-        ArmCpuSynchronizeSignal (ARM_CPU_EVENT_DEFAULT);\r
+        // Signal the Global Variable Region is defined (event: ARM_CPU_EVENT_DEFAULT)\r
+        ArmCallSEV ();\r
       }\r
     } else {\r
-      // Wait the Primay core has defined the address of the Global Variable region\r
-      ArmCpuSynchronizeWait (ARM_CPU_EVENT_DEFAULT);\r
+      // Wait the Primay core has defined the address of the Global Variable region (event: ARM_CPU_EVENT_DEFAULT)\r
+      ArmCallWFE ();\r
     }\r
   }\r
   \r
index 6939f9c6afd7664390210076346013f5a5e42fe6..a8de52fcc2bf7bf2e85dc071403cec589444842d 100644 (file)
@@ -54,7 +54,8 @@ CEntryPoint (
   // Primary CPU clears out the SCU tag RAMs, secondaries wait
   if (IS_PRIMARY_CORE(MpId)) {
     if (ArmIsMpCore()) {
-      ArmCpuSynchronizeSignal (ARM_CPU_EVENT_BOOT_MEM_INIT);
+      // Signal for the initial memory is configured (event: BOOT_MEM_INIT)
+      ArmCallSEV ();
     }
 
     // SEC phase needs to run library constructors by hand. This assumes we are linked against the SerialLib
@@ -159,18 +160,18 @@ TrustedWorldInitialization (
   // Setup the Trustzone Chipsets
   if (IS_PRIMARY_CORE(MpId)) {
     if (ArmIsMpCore()) {
-      // Waiting for the Primary Core to have finished to initialize the Secure World
-      ArmCpuSynchronizeSignal (ARM_CPU_EVENT_SECURE_INIT);
+      // Signal the secondary core the Security settings is done (event: EVENT_SECURE_INIT)
+      ArmCallSEV ();
     }
   } else {
     // The secondary cores need to wait until the Trustzone chipsets configuration is done
     // before switching to Non Secure World
 
-    // Waiting for the Primary Core to have finished to initialize the Secure World
-    ArmCpuSynchronizeWait (ARM_CPU_EVENT_SECURE_INIT);
+    // Wait for the Primary Core to finish the initialization of the Secure World (event: EVENT_SECURE_INIT)
+    ArmCallWFE ();
   }
 
-  // Call the Platform specific fucntion to execute additional actions if required
+  // Call the Platform specific function to execute additional actions if required
   JumpAddress = PcdGet32 (PcdFvBaseAddress);
   ArmPlatformSecExtraAction (MpId, &JumpAddress);
 
index 42b18c40de3075c587c01e6326be1e58cd91d30c..25b66961738c81268bdb608d691c54e6aad322c7 100644 (file)
@@ -26,7 +26,7 @@ GCC_ASM_IMPORT(ArmDisableCachesAndMmu)
 GCC_ASM_IMPORT(ArmWriteVBar)\r
 GCC_ASM_IMPORT(ArmReadMpidr)\r
 GCC_ASM_IMPORT(SecVectorTable)\r
-GCC_ASM_IMPORT(ArmCpuSynchronizeWait)\r
+GCC_ASM_IMPORT(ArmCallWFE)\r
 GCC_ASM_EXPORT(_ModuleEntryPoint)\r
 \r
 StartupAddr:        .word       ASM_PFX(CEntryPoint)\r
@@ -59,8 +59,8 @@ _IdentifyCpu:
   beq   _InitMem\r
   \r
 _WaitInitMem:\r
-  mov   r0, #ARM_CPU_EVENT_BOOT_MEM_INIT\r
-  bl    ASM_PFX(ArmCpuSynchronizeWait)\r
+  // Wait for the primary core to initialize the initial memory (event: BOOT_MEM_INIT)\r
+  bl    ASM_PFX(ArmCallWFE)\r
   // Now the Init Mem is initialized, we setup the secondary core stacks\r
   b     _SetupSecondaryCoreStack\r
   \r
index df443d055d1c9fd1373d5bc7bce0e2141d3a9410..3556ce471fa783afd86cc9187497da5978f30e99 100644 (file)
@@ -24,8 +24,8 @@
   IMPORT  ArmDisableCachesAndMmu\r
   IMPORT  ArmWriteVBar\r
   IMPORT  ArmReadMpidr\r
+  IMPORT  ArmCallWFE\r
   IMPORT  SecVectorTable\r
-  IMPORT  ArmCpuSynchronizeWait\r
   EXPORT  _ModuleEntryPoint\r
 \r
   PRESERVE8\r
@@ -61,8 +61,8 @@ _IdentifyCpu
   beq   _InitMem\r
   \r
 _WaitInitMem\r
-  mov   r0, #ARM_CPU_EVENT_BOOT_MEM_INIT\r
-  bl    ArmCpuSynchronizeWait\r
+  // Wait for the primary core to initialize the initial memory (event: BOOT_MEM_INIT)\r
+  bl    ArmCallWFE\r
   // Now the Init Mem is initialized, we setup the secondary core stacks\r
   b     _SetupSecondaryCoreStack\r
   \r