]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c
ArmPlatformPkg/ArmPlatformLib: Introduce the function ArmPlatformGetBootMode()
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ArmVExpressLibCTA9x4 / CTA9x4.c
index 69091d1119faf0a67e27cf2f4bcffd130a565b7a..490dda1a9229f82e9dccd1587b2c2ae53c5b8bb8 100644 (file)
@@ -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);
@@ -135,6 +137,22 @@ VOID ArmPlatformTrustzoneInit(VOID) {
         TZASC_REGION_SIZE_256MB, TZASC_REGION_SECURITY_NSRW);
 }
 
+/**
+  Return the current Boot Mode
+
+  This function returns the boot reason on the platform
+
+  @return   Return the current Boot Mode of the platform
+
+**/
+EFI_BOOT_MODE
+ArmPlatformGetBootMode (
+  VOID
+  )
+{
+  return BOOT_WITH_FULL_CONFIGURATION;
+}
+
 /**
   Remap the memory at 0x0
 
@@ -148,6 +166,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