From 90d6a1bbf11487d679c21f54fb79e538574944ea Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Tue, 27 Sep 2011 16:22:09 +0000 Subject: ArmPkg: Introduce ArmCpuLib to abstract ARM Cpu specific initialization Every CPUs have their own initialization requirements. This library allows to allows to abstract these initialization requirements into the ARM Platform common components. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12448 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Sec/SecEntryPoint.S | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'ArmPlatformPkg/Sec/SecEntryPoint.S') diff --git a/ArmPlatformPkg/Sec/SecEntryPoint.S b/ArmPlatformPkg/Sec/SecEntryPoint.S index 7f13057f6b..f92a2dffba 100644 --- a/ArmPlatformPkg/Sec/SecEntryPoint.S +++ b/ArmPlatformPkg/Sec/SecEntryPoint.S @@ -13,15 +13,11 @@ #include #include -#include -#include -#include +#include "SecInternal.h" .text .align 3 -GCC_ASM_EXPORT(_ModuleEntryPoint) - GCC_ASM_IMPORT(CEntryPoint) GCC_ASM_IMPORT(ArmPlatformSecBootAction) GCC_ASM_IMPORT(ArmPlatformInitializeBootMemory) @@ -30,13 +26,10 @@ GCC_ASM_IMPORT(ArmDisableCachesAndMmu) GCC_ASM_IMPORT(ArmWriteVBar) GCC_ASM_IMPORT(ArmReadMpidr) GCC_ASM_IMPORT(SecVectorTable) - -#if (FixedPcdGet32(PcdMPCoreSupport)) -GCC_ASM_IMPORT(ArmIsScuEnable) -#endif +GCC_ASM_IMPORT(ArmCpuSynchronizeWait) +GCC_ASM_EXPORT(_ModuleEntryPoint) StartupAddr: .word ASM_PFX(CEntryPoint) -SecVectorTableAddr: .word ASM_PFX(SecVectorTable) ASM_PFX(_ModuleEntryPoint): // First ensure all interrupts are disabled @@ -65,14 +58,11 @@ _IdentifyCpu: // Only the primary core initialize the memory (SMC) beq _InitMem -#if (FixedPcdGet32(PcdMPCoreSupport)) - // ... The secondary cores wait for SCU to be enabled -_WaitForEnabledScu: - bl ASM_PFX(ArmIsScuEnable) - tst r1, #1 - beq _WaitForEnabledScu +_WaitInitMem: + mov r0, #ARM_CPU_EVENT_BOOT_MEM_INIT + bl ASM_PFX(ArmCpuSynchronizeWait) + // Now the Init Mem is initialized, we setup the secondary core stacks b _SetupSecondaryCoreStack -#endif _InitMem: // Initialize Init Boot Memory @@ -110,7 +100,7 @@ _SetupSecondaryCoreStack: // Get the base of the stack for the secondary cores LoadConstantToReg (FixedPcdGet32(PcdCPUCoresSecStackBase), r1) - LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecPrimaryStackSize), r2) + LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecSecondaryStackSize), r2) add r1, r1, r2 // StackOffset = CorePos * StackSize -- cgit v1.2.3