@return A non-zero value if Trustzone supported.
**/
-UINTN ArmPlatformTrustzoneSupported(VOID) {
+UINTN
+ArmPlatformTrustzoneSupported (
+ VOID
+ )
+{
// There is no Trustzone controllers (TZPC & TZASC) and no Secure Memory on RTSM
- return FALSE;
+ return FALSE;
}
/**
of the secure peripherals and memory regions.
**/
-VOID ArmPlatformTrustzoneInit(VOID) {
- ASSERT(FALSE);
+VOID
+ArmPlatformTrustzoneInit (
+ VOID
+ )
+{
+ ASSERT(FALSE);
}
/**
This function can do nothing if this feature is not relevant to your platform.
**/
-VOID ArmPlatformBootRemapping(VOID) {
+VOID
+ArmPlatformBootRemapping (
+ VOID
+ )
+{
// Disable memory remapping and return to normal mapping
- MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE
+ MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE
}
/**
**/
VOID
-ArmPlatformInitialize (
+ArmPlatformSecInitialize (
VOID
) {
// Do nothing yet
}
+/**
+ Initialize controllers that must setup in the normal world
+
+ This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
+ in the PEI phase.
+
+**/
+VOID
+ArmPlatformNormalInitialize (
+ VOID
+ )
+{
+ // Nothing to do here
+}
+
/**
Initialize the system (or sometimes called permanent) memory
This memory is generally represented by the DRAM.
**/
-VOID ArmPlatformInitializeSystemMemory(VOID) {
- // We do not need to initialize the System Memory on RTSM
+VOID
+ArmPlatformInitializeSystemMemory (
+ VOID
+ )
+{
+ // We do not need to initialize the System Memory on RTSM
}
@return A non-zero value if Trustzone supported.
**/
-UINTN ArmPlatformTrustzoneSupported(VOID) {
- return (MmioRead32(ARM_VE_SYS_CFGRW1_REG) & ARM_VE_CFGRW1_TZASC_EN_BIT_MASK);
+UINTN
+ArmPlatformTrustzoneSupported (
+ VOID
+ )
+{
+ return (MmioRead32(ARM_VE_SYS_CFGRW1_REG) & ARM_VE_CFGRW1_TZASC_EN_BIT_MASK);
}
/**
This function can do nothing if this feature is not relevant to your platform.
**/
-VOID ArmPlatformBootRemapping(VOID) {
+VOID
+ArmPlatformBootRemapping (
+ VOID
+ )
+{
UINT32 val32 = MmioRead32(ARM_VE_SYS_CFGRW1_REG); //Scc - CFGRW1
// we remap the DRAM to 0x0
MmioWrite32(ARM_VE_SYS_CFGRW1_REG, (val32 & 0x0FFFFFFF) | ARM_VE_CFGRW1_REMAP_DRAM);
**/
VOID
-ArmPlatformInitialize (
+ArmPlatformSecInitialize (
VOID
) {
// The L2x0 controller must be intialize in Secure World
L2x0CacheInit(PcdGet32(PcdL2x0ControllerBase), FALSE);
}
+/**
+ Initialize controllers that must setup in the normal world
+
+ This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
+ in the PEI phase.
+
+**/
+VOID
+ArmPlatformNormalInitialize (
+ VOID
+ )
+{
+ // Nothing to do here
+}
+
/**
Initialize the system (or sometimes called permanent) memory
This memory is generally represented by the DRAM.
**/
-VOID ArmPlatformInitializeSystemMemory(VOID) {
- PL341DmcInit(&ddr_timings);
- PL301AxiInit(ARM_VE_FAXI_BASE);
+VOID
+ArmPlatformInitializeSystemMemory (
+ VOID
+ )
+{
+ PL341DmcInit(&ddr_timings);
+ PL301AxiInit(ARM_VE_FAXI_BASE);
}
pointer is not used (probably required to use assembly language)
**/
-VOID ArmPlatformInitializeBootMemory(VOID);
+VOID
+ArmPlatformInitializeBootMemory (
+ VOID
+ );
/**
Return the current Boot Mode
**/
VOID
-ArmPlatformInitialize (
+ArmPlatformSecInitialize (
+ VOID
+ );
+
+/**
+ Initialize controllers that must setup in the normal world
+
+ This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
+ in the PEI phase.
+
+**/
+VOID
+ArmPlatformNormalInitialize (
VOID
);
This memory is generally represented by the DRAM.
**/
-VOID ArmPlatformInitializeSystemMemory(VOID);
+VOID
+ArmPlatformInitializeSystemMemory (
+ VOID
+ );
/**
Remap the memory at 0x0
This function can do nothing if this feature is not relevant to your platform.
**/
-VOID ArmPlatformBootRemapping(VOID);
+VOID
+ArmPlatformBootRemapping (
+ VOID
+ );
/**
Return if Trustzone is supported by your platform
@return A non-zero value if Trustzone supported.
**/
-UINTN ArmPlatformTrustzoneSupported(VOID);
+UINTN
+ArmPlatformTrustzoneSupported (
+ VOID
+ );
/**
Initialize the Secure peripherals and memory regions
of the secure peripherals and memory regions.
**/
-VOID ArmPlatformTrustzoneInit(VOID);
+VOID
+ArmPlatformTrustzoneInit (
+ VOID
+ );
/**
Return the information about the memory region in permanent memory used by PEI
entry
**/
-VOID ArmPlatformGetVirtualMemoryMap (
- OUT ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
-);
+VOID
+ArmPlatformGetVirtualMemoryMap (
+ OUT ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
+ );
/**
Return the EFI Memory Map of your platform
\r
DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));\r
\r
+ // Initialize the platform specific controllers\r
+ ArmPlatformNormalInitialize ();\r
+\r
BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));\r
\r
BuildFvHob (FixedPcdGet32(PcdFlashFvMainBase), FixedPcdGet32(PcdFlashFvMainSize));\r
if (CoreId == ARM_PRIMARY_CORE) {
// Initialize peripherals that must be done at the early stage
// Example: Some L2x0 controllers must be initialized in Secure World
- ArmPlatformInitialize ();
+ 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