]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/Sec: Fixed Primary Non-Cold Boot Path
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 4 Jul 2012 20:20:21 +0000 (20:20 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 4 Jul 2012 20:20:21 +0000 (20:20 +0000)
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13499 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Sec/Sec.c
ArmPlatformPkg/Sec/SecEntryPoint.S
ArmPlatformPkg/Sec/SecEntryPoint.asm

index 6734653c3e0e98d21c9c5ee8a9ce804e4bb8d99b..b8cc4973d8f0afb05686fe1cc06c3708b9bceb4c 100644 (file)
@@ -56,7 +56,7 @@ CEntryPoint (
   ArmPlatformSecInitialize (MpId);
 
   // Primary CPU clears out the SCU tag RAMs, secondaries wait
-  if (IS_PRIMARY_CORE(MpId)) {
+  if (IS_PRIMARY_CORE(MpId) && (SecBootMode == ARM_SEC_COLD_BOOT)) {
     if (ArmIsMpCore()) {
       // Signal for the initial memory is configured (event: BOOT_MEM_INIT)
       ArmCallSEV ();
@@ -150,17 +150,19 @@ TrustedWorldInitialization (
   ArmPlatformSecTrustzoneInit (MpId);
 
   // Setup the Trustzone Chipsets
-  if (IS_PRIMARY_CORE(MpId)) {
-    if (ArmIsMpCore()) {
-      // Signal the secondary core the Security settings is done (event: EVENT_SECURE_INIT)
-      ArmCallSEV ();
-    }
-  } else if ((SecBootMode & ARM_SEC_BOOT_MASK) == ARM_SEC_COLD_BOOT) {
-    // The secondary cores need to wait until the Trustzone chipsets configuration is done
-    // before switching to Non Secure World
+  if (SecBootMode == ARM_SEC_COLD_BOOT) {
+    if (IS_PRIMARY_CORE(MpId)) {
+      if (ArmIsMpCore()) {
+        // 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
 
-    // Wait for the Primary Core to finish the initialization of the Secure World (event: EVENT_SECURE_INIT)
-    ArmCallWFE ();
+      // Wait for the Primary Core to finish the initialization of the Secure World (event: EVENT_SECURE_INIT)
+      ArmCallWFE ();
+    }
   }
 
   // Call the Platform specific function to execute additional actions if required
index 0c42a7baa500c54b7daad77a77c7e8941d4b4b86..5095c41697a7a9dd26d67b90e747915a2bcc0aab 100644 (file)
@@ -73,6 +73,10 @@ _WaitInitMem:
   b     _SetupSecondaryCoreStack\r
   \r
 _InitMem:\r
+  // If we are not doing a cold boot in this case we should assume the Initial Memory to be already initialized\r
+  cmp   r10, #ARM_SEC_COLD_BOOT\r
+  bne   _SetupPrimaryCoreStack\r
+\r
   // Initialize Init Boot Memory\r
   bl    ASM_PFX(ArmPlatformSecBootMemoryInit)\r
   \r
index 6af11bb5063ef828846e8ff23c1864620f798052..e0d5922f15eb80cdae297efad512fd11ffffba5b 100644 (file)
@@ -75,6 +75,10 @@ _WaitInitMem
   b     _SetupSecondaryCoreStack\r
   \r
 _InitMem\r
+  // If we are not doing a cold boot in this case we should assume the Initial Memory to be already initialized\r
+  cmp   r10, #ARM_SEC_COLD_BOOT\r
+  bne   _SetupPrimaryCoreStack\r
+\r
   // Initialize Init Boot Memory\r
   bl    ArmPlatformSecBootMemoryInit\r
   \r