]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/AcpiPlatformDxe/PciDecoding.c
MdeModulePkg: add ARM/AARCH64 requirements to .dsc
[mirror_edk2.git] / OvmfPkg / AcpiPlatformDxe / PciDecoding.c
index 3b9b12ccc8a621abd7945ca1bf1e39cc5ac876e9..d63b57e701358143e153039118837f51db121e57 100644 (file)
@@ -89,6 +89,7 @@ EnablePciDecoding (
 \r
   for (Idx = 0; Idx < NoHandles; ++Idx) {\r
     EFI_PCI_IO_PROTOCOL *PciIo;\r
+    UINT64              Attributes;\r
 \r
     //\r
     // Look up PciIo on the handle and stash it\r
@@ -109,12 +110,23 @@ EnablePciDecoding (
       goto RestoreAttributes;\r
     }\r
 \r
+    //\r
+    // Retrieve supported attributes\r
+    //\r
+    Status = PciIo->Attributes (PciIo, EfiPciIoAttributeOperationSupported, 0,\r
+                      &Attributes);\r
+    if (EFI_ERROR (Status)) {\r
+      DEBUG ((EFI_D_WARN, "%a: EfiPciIoAttributeOperationSupported: %r\n",\r
+        __FUNCTION__, Status));\r
+      goto RestoreAttributes;\r
+    }\r
+\r
     //\r
     // Enable IO and MMIO decoding\r
     //\r
+    Attributes &= EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY;\r
     Status = PciIo->Attributes (PciIo, EfiPciIoAttributeOperationEnable,\r
-                      EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY,\r
-                      NULL);\r
+                      Attributes, NULL);\r
     if (EFI_ERROR (Status)) {\r
       DEBUG ((EFI_D_WARN, "%a: EfiPciIoAttributeOperationEnable: %r\n",\r
         __FUNCTION__, Status));\r