]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Sec/SecEntryPoint.S
ArmPlatformPkg/Sec: Added support for Non Cold Boot Paths
[mirror_edk2.git] / ArmPlatformPkg / Sec / SecEntryPoint.S
index 8266dad9776b55522c4537870a7b4bda2e3ee187..ed7448af215c75a2387ed3886b0e125883eb73fd 100644 (file)
@@ -38,6 +38,9 @@ ASM_PFX(_ModuleEntryPoint):
   // Ensure that the MMU and caches are off\r
   bl    ASM_PFX(ArmDisableCachesAndMmu)\r
 \r
+  // By default, we are doing a cold boot\r
+  mov   r10, #ARM_SEC_COLD_BOOT\r
+\r
   // Jump to Platform Specific Boot Action function\r
   blx   ASM_PFX(ArmPlatformSecBootAction)\r
 \r
@@ -59,6 +62,11 @@ _IdentifyCpu:
   beq   _InitMem\r
   \r
 _WaitInitMem:\r
+  // If we are not doing a cold boot in this case we should assume the Initial Memory to be already initialized\r
+  // Otherwise we have to wait the Primary Core to finish the initialization\r
+  cmp   r10, #ARM_SEC_COLD_BOOT\r
+  bne   _SetupSecondaryCoreStack\r
+\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
@@ -108,7 +116,9 @@ _PrepareArguments:
   \r
   // Jump to SEC C code\r
   //    r0 = mp_id\r
+  //    r1 = Boot Mode\r
   mov   r0, r5\r
+  mov   r1, r10\r
   blx   r3\r
   \r
 _NeverReturn:\r