]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/CpuDxe/CpuDxe.c
ArmPkg: delete references to unused guids/Pcds from CpuDxe
[mirror_edk2.git] / ArmPkg / Drivers / CpuDxe / CpuDxe.c
index b1cac31d671b50e8dbb6c4b3cb037522d34de896..5e923d45b71531ba5947135f161024228a27b5e6 100644 (file)
@@ -17,6 +17,7 @@
 \r
 #include <Guid/IdleLoopEvent.h>\r
 \r
+BOOLEAN                   mIsFlushingGCD;\r
 \r
 /**\r
   This function flushes the range of addresses from Start to Start+Length\r
@@ -39,7 +40,7 @@
 \r
   @retval EFI_SUCCESS           The address range from Start to Start+Length was flushed from\r
                                 the processor's data cache.\r
-  @retval EFI_UNSUPPORTEDT      The processor does not support the cache flush type specified\r
+  @retval EFI_UNSUPPORTED       The processor does not support the cache flush type specified\r
                                 by FlushType.\r
   @retval EFI_DEVICE_ERROR      The address range from Start to Start+Length could not be flushed\r
                                 from the processor's data cache.\r
@@ -225,9 +226,18 @@ EFI_CPU_ARCH_PROTOCOL mCpu = {
   CpuGetTimerValue,\r
   CpuSetMemoryAttributes,\r
   0,          // NumberOfTimers\r
-  4,          // DmaBufferAlignment\r
+  2048,       // DmaBufferAlignment\r
 };\r
 \r
+STATIC\r
+VOID\r
+InitializeDma (\r
+  IN OUT  EFI_CPU_ARCH_PROTOCOL   *CpuArchProtocol\r
+  )\r
+{\r
+  CpuArchProtocol->DmaBufferAlignment = ArmCacheWritebackGranule ();\r
+}\r
+\r
 EFI_STATUS\r
 CpuDxeInitialize (\r
   IN EFI_HANDLE         ImageHandle,\r
@@ -239,10 +249,11 @@ CpuDxeInitialize (
 \r
   InitializeExceptions (&mCpu);\r
 \r
+  InitializeDma (&mCpu);\r
+\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                 &mCpuHandle,\r
                 &gEfiCpuArchProtocolGuid,           &mCpu,\r
-                &gVirtualUncachedPagesProtocolGuid, &gVirtualUncachedPages,\r
                 NULL\r
                 );\r
 \r
@@ -251,7 +262,9 @@ CpuDxeInitialize (
   // and that calls EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes, so this code needs to go\r
   // after the protocol is installed\r
   //\r
+  mIsFlushingGCD = TRUE;\r
   SyncCacheConfig (&mCpu);\r
+  mIsFlushingGCD = FALSE;\r
 \r
   // If the platform is a MPCore system then install the Configuration Table describing the\r
   // secondary core states\r