]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/NvmExpressDxe: enable 64-bit PCI DMA
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 5 Sep 2016 08:51:32 +0000 (09:51 +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/Pci/NvmExpressDxe/NvmExpressHci.c

index a173504cdf4d3a46004df0c62a94816f8e705ed2..51cff3c96c29c0e9dbd2a57940135cf5f45920a4 100644 (file)
@@ -862,6 +862,19 @@ NvmeControllerInit (
     return Status;\r
   }\r
 \r
+  //\r
+  // Enable 64-bit DMA support in the PCI layer.\r
+  //\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, "NvmeControllerInit: failed to enable 64-bit DMA (%r)\n", Status));\r
+  }\r
+\r
   //\r
   // Read the Controller Capabilities register and verify that the NVM command set is supported\r
   //\r