From: Laszlo Ersek Date: Mon, 25 Jan 2016 23:36:46 +0000 (+0100) Subject: OvmfPkg: PciHostBridgeLib: set bus, IO and 32-bit MMIO windows in RootBus X-Git-Tag: edk2-stable201903~7718 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=390951c2b803535e7fe8ecbba3fc1ff6bdaa3da5 OvmfPkg: PciHostBridgeLib: set bus, IO and 32-bit MMIO windows in RootBus The bus aperture is copied verbatim from InitRootBridge() [OvmfPkg/PciHostBridgeDxe/PciHostBridge.c]. The IO and 32-bit MMIO apertures are matched to PlatformPei's settings. PciHostBridgeLibDxe expects PciHostBridgeLib instances to advertize the exact apertures. Cc: Jordan Justen Cc: Ruiyu Ni Cc: Marcel Apfelbaum Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen --- diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c index b238a8544d..b23939d166 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c @@ -93,6 +93,14 @@ InitRootBridge ( RootBus->MemAbove4G.Base = 0; RootBus->MemAbove4G.Limit = 0; + RootBus->Bus.Base = RootBusNumber; + RootBus->Bus.Limit = MaxSubBusNumber; + RootBus->Io.Base = PcdGet64 (PcdPciIoBase); + RootBus->Io.Limit = PcdGet64 (PcdPciIoBase) + (PcdGet64 (PcdPciIoSize) - 1); + RootBus->Mem.Base = PcdGet64 (PcdPciMmio32Base); + RootBus->Mem.Limit = PcdGet64 (PcdPciMmio32Base) + + (PcdGet64 (PcdPciMmio32Size) - 1); + return EFI_OUT_OF_RESOURCES; } diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf index 096d728f3c..e95ebfdc93 100644 --- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf @@ -44,3 +44,9 @@ MemoryAllocationLib PciLib QemuFwCfgLib + +[Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdPciIoBase + gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize + gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base + gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size