diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-02-28 17:29:41 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-02-28 17:29:41 +0000 |
commit | 3d93aeaef8225fca86faf9f113a2d9fb777c2a72 (patch) | |
tree | 5cd9d01de52bc63d7ef674bdef7095a19a458dcc | |
parent | a8530889115f00c668c22d26c9272b7b173fbe30 (diff) | |
download | edk2-3d93aeaef8225fca86faf9f113a2d9fb777c2a72.zip edk2-3d93aeaef8225fca86faf9f113a2d9fb777c2a72.tar.gz edk2-3d93aeaef8225fca86faf9f113a2d9fb777c2a72.tar.bz2 |
ArmPlatformPkg/Sec: Move 'ArmPlatformSecExtraAction' before we set NSACR & SCR
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13061 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | ArmPlatformPkg/Sec/Sec.c | 27 | ||||
-rw-r--r-- | ArmPlatformPkg/Sec/SecInternal.h | 3 |
2 files changed, 17 insertions, 13 deletions
diff --git a/ArmPlatformPkg/Sec/Sec.c b/ArmPlatformPkg/Sec/Sec.c index b79537f..00d042c 100644 --- a/ArmPlatformPkg/Sec/Sec.c +++ b/ArmPlatformPkg/Sec/Sec.c @@ -32,6 +32,7 @@ CEntryPoint ( { CHAR8 Buffer[100]; UINTN CharCount; + UINTN JumpAddress; // Invalidate the data cache. Doesn't have to do the Data cache clean. ArmInvalidateDataCache(); @@ -100,10 +101,6 @@ CEntryPoint ( // Test if Trustzone is supported on this platform if (FixedPcdGetBool (PcdTrustzoneSupport)) { - // Ensure the Monitor Stack Base & Size have been set - ASSERT(PcdGet32(PcdCPUCoresSecMonStackBase) != 0); - ASSERT(PcdGet32(PcdCPUCoreSecMonStackSize) != 0); - if (ArmIsMpCore()) { // Setup SMP in Non Secure world ArmCpuSetupSmpNonSecure (GET_CORE_ID(MpId)); @@ -121,7 +118,11 @@ CEntryPoint ( // Status Register as the the current one (CPSR). copy_cpsr_into_spsr (); - NonTrustedWorldTransition (MpId); + // Call the Platform specific function to execute additional actions if required + JumpAddress = PcdGet32 (PcdFvBaseAddress); + ArmPlatformSecExtraAction (MpId, &JumpAddress); + + NonTrustedWorldTransition (MpId, JumpAddress); } ASSERT (0); // We must never return from the above function } @@ -131,6 +132,8 @@ TrustedWorldInitialization ( IN UINTN MpId ) { + UINTN JumpAddress; + //-------------------- Monitor Mode --------------------- // Set up Monitor World (Vector Table, etc) @@ -155,25 +158,25 @@ TrustedWorldInitialization ( // Transfer the interrupt to Non-secure World ArmGicSetupNonSecure (PcdGet32(PcdGicDistributorBase), PcdGet32(PcdGicInterruptInterfaceBase)); + // Call the Platform specific fucntion to execute additional actions if required + JumpAddress = PcdGet32 (PcdFvBaseAddress); + ArmPlatformSecExtraAction (MpId, &JumpAddress); + // Write to CP15 Non-secure Access Control Register ArmWriteNsacr (PcdGet32 (PcdArmNsacr)); // CP15 Secure Configuration Register ArmWriteScr (PcdGet32 (PcdArmScr)); - NonTrustedWorldTransition (MpId); + NonTrustedWorldTransition (MpId, JumpAddress); } VOID NonTrustedWorldTransition ( - IN UINTN MpId + IN UINTN MpId, + IN UINTN JumpAddress ) { - UINTN JumpAddress; - - JumpAddress = PcdGet32 (PcdFvBaseAddress); - ArmPlatformSecExtraAction (MpId, &JumpAddress); - // If PcdArmNonSecModeTransition is defined then set this specific mode to CPSR before the transition // By not set, the mode for Non Secure World is SVC if (PcdGet32 (PcdArmNonSecModeTransition) != 0) { diff --git a/ArmPlatformPkg/Sec/SecInternal.h b/ArmPlatformPkg/Sec/SecInternal.h index badd004..9136db9 100644 --- a/ArmPlatformPkg/Sec/SecInternal.h +++ b/ArmPlatformPkg/Sec/SecInternal.h @@ -33,7 +33,8 @@ TrustedWorldInitialization ( VOID
NonTrustedWorldTransition (
- IN UINTN MpId
+ IN UINTN MpId,
+ IN UINTN JumpAddress
);
VOID
|