]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/AtaAtapiPassThru: enable 64-bit PCI DMA
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 5 Sep 2016 08:49:44 +0000 (09:49 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 6 Sep 2016 14:40:49 +0000 (15:40 +0100)
PCI controller drivers must set the EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE
attribute if the controller supports 64-bit DMA addressing.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c

index 469a40ac392a6fafb1363bf08438b990681beea2..68bce94810a6357ebe8fa73eb88e3ab53507a89e 100644 (file)
@@ -2258,7 +2258,25 @@ AhciModeInitialization (
   if ((Capability & EFI_AHCI_CAP_SAM) == 0) {\r
     AhciOrReg (PciIo, EFI_AHCI_GHC_OFFSET, EFI_AHCI_GHC_ENABLE);\r
   }\r
   if ((Capability & EFI_AHCI_CAP_SAM) == 0) {\r
     AhciOrReg (PciIo, EFI_AHCI_GHC_OFFSET, EFI_AHCI_GHC_ENABLE);\r
   }\r
-  \r
+\r
+  //\r
+  // Enable 64-bit DMA support in the PCI layer if this controller\r
+  // supports it.\r
+  //\r
+  if ((Capability & EFI_AHCI_CAP_S64A) != 0) {\r
+    Status = PciIo->Attributes (\r
+                      PciIo,\r
+                      EfiPciIoAttributeOperationEnable,\r
+                      EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE,\r
+                      NULL\r
+                      );\r
+    if (EFI_ERROR (Status)) {\r
+      DEBUG ((EFI_D_WARN,\r
+        "AhciModeInitialization: failed to enable 64-bit DMA on 64-bit capable controller (%r)\n",\r
+        Status));\r
+    }\r
+  }\r
+\r
   //\r
   // Get the number of command slots per port supported by this HBA.\r
   //\r
   //\r
   // Get the number of command slots per port supported by this HBA.\r
   //\r