summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-31 12:12:58 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-31 12:12:58 +0000
commit8e06b586e832e4c050eb506c2fadbdca5bf361ff (patch)
treea719b2610ed4bcbfe324aee2420cd90e045b09c1 /ArmPlatformPkg
parent262a9b04441b9e38b8c43ae0e4c60ae62df35504 (diff)
downloadedk2-platforms-8e06b586e832e4c050eb506c2fadbdca5bf361ff.tar.xz
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
Diffstat (limited to 'ArmPlatformPkg')
-rw-r--r--ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c14
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc4
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressLib.inf3
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressSecLib.inf3
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c17
-rw-r--r--ArmPlatformPkg/Include/Library/ArmPlatformLib.h12
-rw-r--r--ArmPlatformPkg/Sec/Sec.c6
-rw-r--r--ArmPlatformPkg/Sec/Sec.inf4
8 files changed, 54 insertions, 9 deletions
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c
index 2bbca875e8..003f657163 100644
--- a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c
+++ b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEb.c
@@ -58,6 +58,20 @@ VOID ArmPlatformBootRemapping(VOID) {
}
/**
+ 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
+ ) {
+ // Do nothing yet
+}
+
+/**
Initialize the system (or sometimes called permanent) memory
This memory is generally represented by the DRAM.
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
index c5aa4772b9..c0e3103a73 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
@@ -90,6 +90,8 @@
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
+ # ARM PL310 L2 Cache Driver
+ L2X0CacheLib|ArmPkg/Drivers/PL310L2Cache/PL310L2CacheSec.inf
# ARM PL341 DMC Driver
PL341DmcLib|ArmPkg/Drivers/PL34xDmc/PL341Dmc.inf
# ARM PL301 Axi Driver
@@ -132,8 +134,6 @@
# ARM PL354 SMC Driver
PL354SmcSecLib|ArmPkg/Drivers/PL35xSmc/PL354SmcSec.inf
- # ARM PL310 L2 Cache Driver
- L2X0CacheLib|ArmPkg/Drivers/PL310L2Cache/PL310L2CacheSec.inf
# ARM PL390 General Interrupt Driver in Secure and Non-secure
PL390GicSecLib|ArmPkg/Drivers/PL390Gic/PL390GicSec.inf
PL390GicNonSecLib|ArmPkg/Drivers/PL390Gic/PL390GicNonSec.inf
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 <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <Drivers/PL341Dmc.h>
+#include <Drivers/PL301Axi.h>
+#include <Library/L2X0CacheLib.h>
#include <Library/SerialPortLib.h>
#define SerialPrint(txt) SerialPortWrite (txt, AsciiStrLen(txt)+1);
@@ -149,6 +151,21 @@ VOID ArmPlatformBootRemapping(VOID) {
}
/**
+ 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
This memory is generally represented by the DRAM.
diff --git a/ArmPlatformPkg/Include/Library/ArmPlatformLib.h b/ArmPlatformPkg/Include/Library/ArmPlatformLib.h
index fe57c5a353..c9b215e6dc 100644
--- a/ArmPlatformPkg/Include/Library/ArmPlatformLib.h
+++ b/ArmPlatformPkg/Include/Library/ArmPlatformLib.h
@@ -68,6 +68,18 @@ VOID ArmPlatformIsMemoryInitialized(VOID);
VOID ArmPlatformInitializeBootMemory(VOID);
/**
+ 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
+ );
+
+/**
Initialize the system (or sometimes called permanent) memory
This memory is generally represented by the DRAM.
diff --git a/ArmPlatformPkg/Sec/Sec.c b/ArmPlatformPkg/Sec/Sec.c
index 4199f381ba..7106e90026 100644
--- a/ArmPlatformPkg/Sec/Sec.c
+++ b/ArmPlatformPkg/Sec/Sec.c
@@ -21,7 +21,6 @@
#include <Library/ArmLib.h>
#include <Chipset/ArmV7.h>
#include <Drivers/PL390Gic.h>
-#include <Library/L2X0CacheLib.h>
#include <Library/SerialPortLib.h>
#include <Library/ArmPlatformLib.h>
@@ -106,8 +105,9 @@ CEntryPoint (
}
if (CoreId == 0) {
- // Initialize L2X0 but not enabled
- L2x0CacheInit(PcdGet32(PcdL2x0ControllerBase), FALSE);
+ // Initialize peripherals that must be done at the early stage
+ // Example: Some L2x0 controllers must be initialized in Secure World
+ ArmPlatformInitialize ();
// 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
diff --git a/ArmPlatformPkg/Sec/Sec.inf b/ArmPlatformPkg/Sec/Sec.inf
index e3ab22150e..38bd8b9be3 100644
--- a/ArmPlatformPkg/Sec/Sec.inf
+++ b/ArmPlatformPkg/Sec/Sec.inf
@@ -32,7 +32,6 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
@@ -42,7 +41,6 @@
IoLib
ArmLib
ArmPlatformLib
- L2X0CacheLib
PL390GicSecLib
SerialPortLib
@@ -61,7 +59,5 @@
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize
- gArmTokenSpaceGuid.PcdL2x0ControllerBase
-
gArmTokenSpaceGuid.PcdGicDistributorBase
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase