// 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
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
\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