]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/PlatformPei/Platform.c
Revert "OvmfPkg/PlatformPei: reorder the 32-bit PCI window vs. the PCIEXBAR on q35"
[mirror_edk2.git] / OvmfPkg / PlatformPei / Platform.c
index fd8eccaf3e50cc133cfc1acb3adb949afc324fa1..9c013613a1a0b35517bd5b7da039a5ede5c304b8 100644 (file)
@@ -184,13 +184,14 @@ MemMapInitialization (
     PciBase = (TopOfLowRam < BASE_2GB) ? BASE_2GB : TopOfLowRam;\r
     if (mHostBridgeDevId == INTEL_Q35_MCH_DEVICE_ID) {\r
       //\r
-      // The 32-bit PCI host aperture is expected to fall between the top of\r
-      // low RAM and the base of the MMCONFIG area.\r
+      // The MMCONFIG area is expected to fall between the top of low RAM and\r
+      // the base of the 32-bit PCI host aperture.\r
       //\r
       PciExBarBase = FixedPcdGet64 (PcdPciExpressBaseAddress);\r
-      ASSERT (PciBase < PciExBarBase);\r
+      ASSERT (TopOfLowRam <= PciExBarBase);\r
       ASSERT (PciExBarBase <= MAX_UINT32 - SIZE_256MB);\r
-      PciSize = (UINT32)(PciExBarBase - PciBase);\r
+      PciBase = (UINT32)(PciExBarBase + SIZE_256MB);\r
+      PciSize = 0xFC000000 - PciBase;\r
     } else {\r
       PciSize = 0xFC000000 - PciBase;\r
     }\r