]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/PrePi/PrePi.c
DynamicTablesPkg: SsdtSerialPortLibArm fix ECC error
[mirror_edk2.git] / ArmPlatformPkg / PrePi / PrePi.c
index 2bb144958139389c4dea3f21d9110cecbf2ffba2..5129dd09a85ef71d2e30ecff605cf49c4e78119b 100644 (file)
@@ -8,6 +8,7 @@
 \r
 #include <PiPei.h>\r
 \r
+#include <Library/CacheMaintenanceLib.h>\r
 #include <Library/DebugAgentLib.h>\r
 #include <Library/PrePiLib.h>\r
 #include <Library/PrintLib.h>\r
@@ -22,7 +23,7 @@
 #include "PrePi.h"\r
 \r
 #define IS_XIP() (((UINT64)FixedPcdGet64 (PcdFdBaseAddress) > mSystemMemoryEnd) || \\r
-                  ((FixedPcdGet64 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase)))\r
+                  ((FixedPcdGet64 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= FixedPcdGet64 (PcdSystemMemoryBase)))\r
 \r
 UINT64 mSystemMemoryEnd = FixedPcdGet64(PcdSystemMemoryBase) +\r
                           FixedPcdGet64(PcdSystemMemorySize) - 1;\r
@@ -178,8 +179,6 @@ CEntryPoint (
 \r
   // Data Cache enabled on Primary core when MMU is enabled.\r
   ArmDisableDataCache ();\r
-  // Invalidate Data cache\r
-  ArmInvalidateDataCache ();\r
   // Invalidate instruction cache\r
   ArmInvalidateInstructionCache ();\r
   // Enable Instruction Caches on all cores.\r
@@ -200,6 +199,10 @@ CEntryPoint (
 \r
   // If not primary Jump to Secondary Main\r
   if (ArmPlatformIsPrimaryCore (MpId)) {\r
+\r
+    InvalidateDataCacheRange ((VOID *)UefiMemoryBase,\r
+                              FixedPcdGet32 (PcdSystemMemoryUefiRegionSize));\r
+\r
     // Goto primary Main.\r
     PrimaryMain (UefiMemoryBase, StacksBase, StartTimeStamp);\r
   } else {\r
@@ -209,4 +212,3 @@ CEntryPoint (
   // DXE Core should always load and never return\r
   ASSERT (FALSE);\r
 }\r
-\r