]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/PlatformPei/Platform.c
OvmfPkg/PlatformPei: set PCI IO port aperture dynamically
[mirror_edk2.git] / OvmfPkg / PlatformPei / Platform.c
index a5654a51183bf36c2a8d68e78b0f91c23ad77e6d..b03b577013beb39456e03aaed797a9d8d940e20f 100644 (file)
@@ -156,6 +156,12 @@ MemMapInitialization (
   VOID\r
   )\r
 {\r
+  UINT64 PciIoBase;\r
+  UINT64 PciIoSize;\r
+\r
+  PciIoBase = 0xC000;\r
+  PciIoSize = 0x4000;\r
+\r
   //\r
   // Create Memory Type Information HOB\r
   //\r
@@ -165,17 +171,6 @@ MemMapInitialization (
     sizeof(mDefaultMemoryTypeInformation)\r
     );\r
 \r
-  //\r
-  // Add PCI IO Port space available for PCI resource allocations.\r
-  //\r
-  BuildResourceDescriptorHob (\r
-    EFI_RESOURCE_IO,\r
-    EFI_RESOURCE_ATTRIBUTE_PRESENT     |\r
-    EFI_RESOURCE_ATTRIBUTE_INITIALIZED,\r
-    PcdGet64 (PcdPciIoBase),\r
-    PcdGet64 (PcdPciIoSize)\r
-    );\r
-\r
   //\r
   // Video memory + Legacy BIOS region\r
   //\r
@@ -250,6 +245,19 @@ MemMapInitialization (
     }\r
     AddIoMemoryBaseSizeHob (PcdGet32(PcdCpuLocalApicBaseAddress), SIZE_1MB);\r
   }\r
+\r
+  //\r
+  // Add PCI IO Port space available for PCI resource allocations.\r
+  //\r
+  BuildResourceDescriptorHob (\r
+    EFI_RESOURCE_IO,\r
+    EFI_RESOURCE_ATTRIBUTE_PRESENT     |\r
+    EFI_RESOURCE_ATTRIBUTE_INITIALIZED,\r
+    PciIoBase,\r
+    PciIoSize\r
+    );\r
+  PcdSet64 (PcdPciIoBase, PciIoBase);\r
+  PcdSet64 (PcdPciIoSize, PciIoSize);\r
 }\r
 \r
 EFI_STATUS\r