diff mbox

[edk2,3/7] MdeModulePkg/NvmExpressDxe: enable 64-bit PCI DMA

Message ID 1473067049-16252-4-git-send-email-ard.biesheuvel@linaro.org
State Accepted
Commit 4e28ea2c29e008e1390ea87c6e5a78d65ee33d5c
Headers show

Commit Message

Ard Biesheuvel Sept. 5, 2016, 9:17 a.m. UTC
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>

---
 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

-- 
2.7.4

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
index a173504cdf4d..51cff3c96c29 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
@@ -863,6 +863,19 @@  NvmeControllerInit (
   }
 
   //
+  // Enable 64-bit DMA support in the PCI layer.
+  //
+  Status = PciIo->Attributes (
+                    PciIo,
+                    EfiPciIoAttributeOperationEnable,
+                    EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE,
+                    NULL
+                    );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((EFI_D_WARN, "NvmeControllerInit: failed to enable 64-bit DMA (%r)\n", Status));
+  }
+
+  //
   // Read the Controller Capabilities register and verify that the NVM command set is supported
   //
   Status = ReadNvmeControllerCapabilities (Private, &Private->Cap);