]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePeiCore/PrePeiCore.c
ArmPlatformPkg/PrePeiCore: permit entry with the MMU enabled
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / PrePeiCore.c
index 9c4b25df953dc371084790e468fda3371cbeb44b..8b86c6e69abdde98a0f58de07dd8812abad5f250 100644 (file)
@@ -58,17 +58,19 @@ CEntryPoint (
   IN  EFI_PEI_CORE_ENTRY_POINT  PeiCoreEntryPoint\r
   )\r
 {\r
-  // Data Cache enabled on Primary core when MMU is enabled.\r
-  ArmDisableDataCache ();\r
-  // Invalidate instruction cache\r
-  ArmInvalidateInstructionCache ();\r
-  // Enable Instruction Caches on all cores.\r
-  ArmEnableInstructionCache ();\r
-\r
-  InvalidateDataCacheRange (\r
-    (VOID *)(UINTN)PcdGet64 (PcdCPUCoresStackBase),\r
-    PcdGet32 (PcdCPUCorePrimaryStackSize)\r
-    );\r
+  if (!ArmMmuEnabled ()) {\r
+    // Data Cache enabled on Primary core when MMU is enabled.\r
+    ArmDisableDataCache ();\r
+    // Invalidate instruction cache\r
+    ArmInvalidateInstructionCache ();\r
+    // Enable Instruction Caches on all cores.\r
+    ArmEnableInstructionCache ();\r
+\r
+    InvalidateDataCacheRange (\r
+      (VOID *)(UINTN)PcdGet64 (PcdCPUCoresStackBase),\r
+      PcdGet32 (PcdCPUCorePrimaryStackSize)\r
+      );\r
+  }\r
 \r
   //\r
   // Note: Doesn't have to Enable CPU interface in non-secure world,\r