From 8e06b586e832e4c050eb506c2fadbdca5bf361ff Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Thu, 31 Mar 2011 12:12:58 +0000 Subject: ArmPlatformPkg: Introduce ArmPlatformInitialize() function This function is responsible to handle all the specific platform code that must be run in secure world to initialize some controllers. ArmPlatformPkg/Sec: Move the L2x0 initialization to ArmPlatformLib The L2x0 controller must be initialized in secure world. Move its initialization into the ArmPlatformInitialize() of the Cortex A9x4 Core Tile PlatformLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11476 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/ArmVExpressLibCTA9x4/ArmVExpressLib.inf | 3 +++ .../Library/ArmVExpressLibCTA9x4/ArmVExpressSecLib.inf | 3 +++ .../Library/ArmVExpressLibCTA9x4/CTA9x4.c | 17 +++++++++++++++++ 3 files changed, 23 insertions(+) (limited to 'ArmPlatformPkg/ArmVExpressPkg/Library') diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressLib.inf b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressLib.inf index 15e20b6783..80631240a7 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressLib.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressLib.inf @@ -33,6 +33,7 @@ MemoryAllocationLib PL341DmcLib PL301AxiLib + L2X0CacheLib [Sources.common] CTA9x4.c @@ -47,3 +48,5 @@ [FixedPcd] gArmTokenSpaceGuid.PcdNormalFdBaseAddress gArmTokenSpaceGuid.PcdNormalFdSize + + gArmTokenSpaceGuid.PcdL2x0ControllerBase diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressSecLib.inf b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressSecLib.inf index aef37b2f7e..aefd53c486 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressSecLib.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressSecLib.inf @@ -33,6 +33,7 @@ PL354SmcSecLib PL341DmcLib PL301AxiLib + L2X0CacheLib [Sources.common] CTA9x4.c @@ -48,3 +49,5 @@ [FixedPcd] gArmTokenSpaceGuid.PcdNormalFdBaseAddress gArmTokenSpaceGuid.PcdNormalFdSize + + gArmTokenSpaceGuid.PcdL2x0ControllerBase diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c index 69091d1119..2d39207e29 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c +++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #define SerialPrint(txt) SerialPortWrite (txt, AsciiStrLen(txt)+1); @@ -148,6 +150,21 @@ VOID ArmPlatformBootRemapping(VOID) { MmioWrite32(ARM_VE_SYS_CFGRW1_REG, (val32 & 0x0FFFFFFF) | ARM_VE_CFGRW1_REMAP_DRAM); } +/** + Initialize controllers that must setup at the early stage + + Some peripherals must be initialized in Secure World. + For example, some L2x0 requires to be initialized in Secure World + +**/ +VOID +ArmPlatformInitialize ( + VOID + ) { + // The L2x0 controller must be intialize in Secure World + L2x0CacheInit(PcdGet32(PcdL2x0ControllerBase), FALSE); +} + /** Initialize the system (or sometimes called permanent) memory -- cgit v1.2.3