summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-04-29 16:43:56 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-18 12:40:42 +0800
commitc4a5d550a0892e9ffb0b22c88665162c42039a53 (patch)
treef4e1f21991bc65de7131572b6ce59477734d0aae
parent9739b46f204a6ddd7b43e97c5a8b0803bed6c8bc (diff)
downloadedk2-platforms-c4a5d550a0892e9ffb0b22c88665162c42039a53.tar.xz
MdeModulePkg/PciHostBridgeLib: Add ResourceAssigned field
Some platform doesn't require PciBus driver to assign resource to PCI devices which causes PciRootBridgeIo.Configuration() cannot return correct resource information to caller. When resource assignment by PciBus is not mandatory, only light version of PCI bus enumeration is performed, which only collects the device resource consumption and publishes the PciIo instance. The corresponding logic is in PciEnumeratorLight() in PciBus driver. But PciEnumeratorLight() still depends on PciRootBridgeIo.Configuration() returns the starting bus number in order to search down to find all PCI devices under the root bridge. When ResourceAssigned in PCI_ROOT_BRIDGE returned by PciHostBridgeGetRootBridges() is TRUE, PciHostBridge driver treats the Bus/Io/Mem/MemAbove4G/PMem/PMemAbove4G as the resource that are *actually assigned* to the root bridge, instead of the resource that *can be assigned* to the root bridge. So that PciRootBridgeIo.Configuration() can return the correct information. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit c5be19f378216a07c7783e07973d976407885e75)
-rw-r--r--MdeModulePkg/Include/Library/PciHostBridgeLib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/MdeModulePkg/Include/Library/PciHostBridgeLib.h b/MdeModulePkg/Include/Library/PciHostBridgeLib.h
index eb45cfdd79..d42e9ecdd7 100644
--- a/MdeModulePkg/Include/Library/PciHostBridgeLib.h
+++ b/MdeModulePkg/Include/Library/PciHostBridgeLib.h
@@ -38,6 +38,8 @@ typedef struct {
///< Extended (4096-byte) Configuration Space.
///< When TRUE, the root bridge supports
///< 256-byte Configuration Space only.
+ BOOLEAN ResourceAssigned; ///< Resource assignment status of the root bridge.
+ ///< Set to TRUE if Bus/IO/MMIO resources for root bridge have been assigned.
UINT64 AllocationAttributes; ///< Allocation attributes.
///< Refer to EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM and
///< EFI_PCI_HOST_BRIDGE_MEM64_DECODE used by GetAllocAttributes()