]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Sec/SecEntryPoint.asm
ArmPlatformPkg/Sec: Added support for Non Cold Boot Paths
[mirror_edk2.git] / ArmPlatformPkg / Sec / SecEntryPoint.asm
index a20a3fd9f619b2f4f2708d4cfc9fe2a2ac2c68b0..30cf19245cb8dd521726e50c4b3044d5ac211d78 100644 (file)
   \r
 StartupAddr        DCD      CEntryPoint\r
 \r
-_ModuleEntryPoint\r
+_ModuleEntryPoint FUNCTION\r
   // First ensure all interrupts are disabled\r
   blx   ArmDisableInterrupts\r
 \r
   // Ensure that the MMU and caches are off\r
   blx   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   ArmPlatformSecBootAction\r
 \r
@@ -61,6 +64,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    ArmCallWFE\r
   // Now the Init Mem is initialized, we setup the secondary core stacks\r
@@ -110,8 +118,11 @@ _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
+  ENDFUNC\r
   \r
 _NeverReturn\r
   b _NeverReturn\r