diff mbox

[edk2,5/5] OvmfPkg: PciHostBridgeLib: permit access to the full extended config space

Message ID 1457102794-25499-6-git-send-email-lersek@redhat.com
State Superseded
Headers show

Commit Message

Laszlo Ersek March 4, 2016, 2:46 p.m. UTC
By now OVMF makes MdeModulePkg/Bus/Pci/PciHostBridgeDxe go through
MMCONFIG (when running on Q35). Enable the driver to address each B/D/F's
config space up to and including offset 0xFFF.

Cc: Gabriel Somlo <somlo@cmu.edu>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: MichaƂ Zegan <webczat_200@poczta.onet.pl>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf | 1 +
 OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c   | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
index 5467fff8aa15..bbec74645c83 100644
--- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
@@ -51,3 +51,4 @@  [Pcd]
   gUefiOvmfPkgTokenSpaceGuid.PcdPciIoSize
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Base
   gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio32Size
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId
diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 582e87dd9ac0..3e02778492a8 100644
--- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -16,6 +16,7 @@ 
 #include <PiDxe.h>
 
 #include <IndustryStandard/Pci.h>
+#include <IndustryStandard/Q35MchIch9.h>
 
 #include <Protocol/PciHostBridgeResourceAllocation.h>
 #include <Protocol/PciRootBridgeIo.h>
@@ -139,7 +140,8 @@  InitRootBridge (
   RootBus->Mem.Limit = PcdGet64 (PcdPciMmio32Base) +
                        (PcdGet64 (PcdPciMmio32Size) - 1);
 
-  RootBus->NoExtendedConfigSpace = TRUE;
+  RootBus->NoExtendedConfigSpace = (PcdGet16 (PcdOvmfHostBridgePciDevId) !=
+                                    INTEL_Q35_MCH_DEVICE_ID);
 
   DevicePath = AllocateCopyPool (sizeof mRootBridgeDevicePathTemplate,
                  &mRootBridgeDevicePathTemplate);