diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c index 50f61cbfff..452465afa8 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/PciHostBridgeDxe/PciHostBridge.c @@ -122,6 +122,28 @@ InitializePciHostBridge ( PcdGet64 (PcdPciIoSize) - 1; mResAperture[0][0].IoTranslation = PcdGet64 (PcdPciIoTranslation); + // + // Add IO and MMIO memory space, so that resources can be allocated in the + // EfiPciHostBridgeAllocateResources phase. + // + Status = gDS->AddIoSpace ( + EfiGcdIoTypeIo, + PcdGet64 (PcdPciIoBase), + PcdGet64 (PcdPciIoSize) + ); + ASSERT_EFI_ERROR (Status); + + Status = gDS->AddMemorySpace ( + EfiGcdMemoryTypeMemoryMappedIo, + PcdGet32 (PcdPciMmio32Base), + PcdGet32 (PcdPciMmio32Size), + EFI_MEMORY_UC + ); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "%a: AddMemorySpace: %r\n", __FUNCTION__, Status)); + return Status; + } + // // Create Host Bridge Device Handle //