diff --git a/ArmPlatformPkg/PrePi/PeiMPCore.inf b/ArmPlatformPkg/PrePi/PeiMPCore.inf index 9c5da0d42a..053f9fd9e6 100644 --- a/ArmPlatformPkg/PrePi/PeiMPCore.inf +++ b/ArmPlatformPkg/PrePi/PeiMPCore.inf @@ -37,6 +37,7 @@ [LibraryClasses] BaseLib + CacheMaintenanceLib DebugLib DebugAgentLib ArmLib diff --git a/ArmPlatformPkg/PrePi/PeiUniCore.inf b/ArmPlatformPkg/PrePi/PeiUniCore.inf index ee9b05b253..78d218ae09 100644 --- a/ArmPlatformPkg/PrePi/PeiUniCore.inf +++ b/ArmPlatformPkg/PrePi/PeiUniCore.inf @@ -37,6 +37,7 @@ [LibraryClasses] BaseLib + CacheMaintenanceLib DebugLib DebugAgentLib ArmLib diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c index 74284f1883..5129dd09a8 100644 --- a/ArmPlatformPkg/PrePi/PrePi.c +++ b/ArmPlatformPkg/PrePi/PrePi.c @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -178,8 +179,6 @@ CEntryPoint ( // Data Cache enabled on Primary core when MMU is enabled. ArmDisableDataCache (); - // Invalidate Data cache - ArmInvalidateDataCache (); // Invalidate instruction cache ArmInvalidateInstructionCache (); // Enable Instruction Caches on all cores. @@ -200,6 +199,10 @@ CEntryPoint ( // If not primary Jump to Secondary Main if (ArmPlatformIsPrimaryCore (MpId)) { + + InvalidateDataCacheRange ((VOID *)UefiMemoryBase, + FixedPcdGet32 (PcdSystemMemoryUefiRegionSize)); + // Goto primary Main. PrimaryMain (UefiMemoryBase, StacksBase, StartTimeStamp); } else { @@ -209,4 +212,3 @@ CEntryPoint ( // DXE Core should always load and never return ASSERT (FALSE); } -