summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-01-26 00:11:43 +0100
committerLaszlo Ersek <lersek@redhat.com>2016-03-03 18:18:39 +0100
commit0dcd1b1b2a8e3c2548ab552b9b3ba2d9f25d515f (patch)
tree3ce06624e5a205b426116135fe3f11bc7690e417
parentc789d61dcb6b1990133a947351f67751cf0c4e31 (diff)
downloadedk2-0dcd1b1b2a8e3c2548ab552b9b3ba2d9f25d515f.tar.gz
edk2-0dcd1b1b2a8e3c2548ab552b9b3ba2d9f25d515f.tar.bz2
edk2-0dcd1b1b2a8e3c2548ab552b9b3ba2d9f25d515f.zip
OvmfPkg: PciHostBridgeLib: set RootBus->AllocationAttributes
InitRootBridge() in "OvmfPkg/PciHostBridgeDxe/PciHostBridge.c" passes the EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM allocation attribute to RootBridgeConstructor(); we should do the same here. From "MdePkg/Include/Protocol/PciHostBridgeResourceAllocation.h": /// If this bit is set, then the PCI Root Bridge does not support separate /// windows for Non-prefetchable and Prefetchable memory. A PCI bus driver /// needs to include requests for Prefetchable memory in the /// Non-prefetchable memory pool. Which implies that both the 32-bit and 64-bit prefetchable MMIO apertures should be marked empty. (The CreateRootBridge() function actually enforces this in "MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c".) Furthermore, since OvmfPkg/PciHostBridgeDxe does *not* set the EFI_PCI_HOST_BRIDGE_MEM64_DECODE allocation attribute: /// If this bit is set, then the PCI Root Bridge supports 64 bit memory /// windows. If this bit is not set, the PCI bus driver needs to include /// requests for 64 bit memory address in the corresponding 32 bit memory /// pool. we follow suit in the PciHostBridgeLib instance. In turn, the 64-bit MMIO apertures (both prefetchable and non-prefetchable) should be marked empty. MdeModulePkg/Bus/Pci/PciHostBridgeDxe enforces this too. (64-bit MMIO aperture support, based on yet more fw_cfg files, is a planned future improvement.) Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r--OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index f1cefe4169..b238a8544d 100644
--- a/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -17,6 +17,7 @@
#include <IndustryStandard/Pci.h>
+#include <Protocol/PciHostBridgeResourceAllocation.h>
#include <Protocol/PciRootBridgeIo.h>
#include <Library/BaseMemoryLib.h>
@@ -84,6 +85,14 @@ InitRootBridge (
RootBus->DmaAbove4G = FALSE;
+ RootBus->AllocationAttributes = EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM;
+ RootBus->PMem.Base = 0;
+ RootBus->PMem.Limit = 0;
+ RootBus->PMemAbove4G.Base = 0;
+ RootBus->PMemAbove4G.Limit = 0;
+ RootBus->MemAbove4G.Base = 0;
+ RootBus->MemAbove4G.Limit = 0;
+
return EFI_OUT_OF_RESOURCES;
}