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