From e314d564db4d52a9e904f6049dad7fc5dece5cb4 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Wed, 2 May 2012 20:13:32 +0000 Subject: ArmPlatformPkg: Introduced 'ArmPlatformSecLib' The function only used in Secure Firmware used to be mixed with the Non-Secure/Normal functions in ArmPlatformLib. When the Secure Firmware was not required for some platforms (eg: BeagleBoard), these functions were empty functions. This new interface has been created to clean the ArmPlatformLib interface between the SEC and PEI phases. Signed-off-by: Olivier Martin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13260 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Sec/Sec.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'ArmPlatformPkg/Sec/Sec.c') diff --git a/ArmPlatformPkg/Sec/Sec.c b/ArmPlatformPkg/Sec/Sec.c index 00293f0d00..f9746ad891 100644 --- a/ArmPlatformPkg/Sec/Sec.c +++ b/ArmPlatformPkg/Sec/Sec.c @@ -19,7 +19,6 @@ #include #include #include -#include #include "SecInternal.h" @@ -50,7 +49,11 @@ CEntryPoint ( if (FixedPcdGet32 (PcdVFPEnabled)) { ArmEnableVFP(); } - + + // Initialize peripherals that must be done at the early stage + // Example: Some L2 controller, interconnect, clock, DMC, etc + ArmPlatformSecInitialize (MpId); + // Primary CPU clears out the SCU tag RAMs, secondaries wait if (IS_PRIMARY_CORE(MpId)) { if (ArmIsMpCore()) { @@ -93,19 +96,6 @@ CEntryPoint ( // Enable Full Access to CoProcessors ArmWriteCpacr (CPACR_CP_FULL_ACCESS); - if (IS_PRIMARY_CORE(MpId)) { - // Initialize peripherals that must be done at the early stage - // Example: Some L2x0 controllers must be initialized in Secure World - ArmPlatformSecInitialize (); - - // If we skip the PEI Core we could want to initialize the DRAM in the SEC phase. - // If we are in standalone, we need the initialization to copy the UEFI firmware into DRAM - if (FeaturePcdGet (PcdSystemMemoryInitializeInSec)) { - // Initialize system memory (DRAM) - ArmPlatformInitializeSystemMemory (); - } - } - // Test if Trustzone is supported on this platform if (FixedPcdGetBool (PcdTrustzoneSupport)) { if (ArmIsMpCore()) { @@ -155,7 +145,7 @@ TrustedWorldInitialization ( ArmGicSetupNonSecure (MpId, PcdGet32(PcdGicDistributorBase), PcdGet32(PcdGicInterruptInterfaceBase)); // Initialize platform specific security policy - ArmPlatformTrustzoneInit (MpId); + ArmPlatformSecTrustzoneInit (MpId); // Setup the Trustzone Chipsets if (IS_PRIMARY_CORE(MpId)) { -- cgit v1.2.3