audk/MdeModulePkg/Bus/Pci/PciBusDxe
Ruiyu Ni 0176af142e MdeModulePkg/PciBus: Shadow option ROM after BARs are programmed
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1376

Today's implementation reuses the 32bit MMIO resource requested by
all PCI devices MMIO BARs when shadowing the option ROM.
Take a simple example, a system has only one PCI device. It requires
8MB 32bit MMIO and contains a 4MB option ROM. Today's implementation
only requests 8MB (max of 4M and 8M) 32bit MMIO from
PciHostBridgeResourceAllocation protocol. Let's assume the MMIO range
[3GB, 3GB+8MB) is allocated. The 3GB base address is firstly
programmed to the option ROM BAR for option ROM shadow. Then the
option ROM decoding is turned off and 3GB base address is programmed
to the 32bit MMIO BAR.

It doesn't cause issues when the device doesn't request too much
MMIO.
But when the device contains a 64bit MMIO BAR which requests 4GB MMIO
and a 4MB option ROM. Let's assume [3GB, 3GB+8MB) 32bit MMIO range is
allocated for the option ROM. When the option ROM is being shadowed,
64bit MMIO BAR is programmed to value 0, which means [0, 4GB) MMIO is
given to the 64bit BAR.
The range overlaps with the option ROM range which may cause the
device malfunction (e.g.: option ROM cannot be read out) when the
device has two separate decoders: one for MMIO BAR, the other for
option ROM.

The patch requests dedicated MEM32 resource for Option ROMs and
moves the Option ROM shadow logic after all MMIO BARs are programmed.
The MMIO BAR setting to 0 when shadowing Option ROM is also skipped
because the MMIO BAR already contains the correct value.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2018-12-10 10:30:13 +08:00
..
ComponentName.c Fix the comments to follow UEFI Spec regarding how to check an EFI_HANDLE is valid/invalid. 2011-07-06 03:55:36 +00:00
ComponentName.h Fix the comments to follow UEFI Spec regarding how to check an EFI_HANDLE is valid/invalid. 2011-07-06 03:55:36 +00:00
PciBus.c MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
PciBus.h MdeModulePkg/PciBus: Shadow option ROM after BARs are programmed 2018-12-10 10:30:13 +08:00
PciBusDxe.inf MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
PciBusDxe.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
PciBusDxeExtra.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
PciCommand.c MdeModulePkg: Enhance PCI capability looking up logic to avoid hang 2015-09-15 08:38:16 +00:00
PciCommand.h Update the copyright notice format 2010-04-24 09:49:11 +00:00
PciDeviceSupport.c MdeModulePkg/PciBus: Restrict one VGA per HostBridge not Segment 2018-08-27 09:40:22 +08:00
PciDeviceSupport.h MdeModulePkg/PciBus: Restrict one VGA per HostBridge not Segment 2018-08-27 09:40:22 +08:00
PciDriverOverride.c MdeModulePkg/PciBus: Fix bug that doesn't produce BusOverride 2017-10-31 11:11:04 +08:00
PciDriverOverride.h MdeModulePkg/PciBus: Fix bug that doesn't produce BusOverride 2017-10-31 11:11:04 +08:00
PciEnumerator.c MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
PciEnumerator.h MdeModulePkg/PciBusDxe: reference gFullEnumeration in one file 2018-01-24 11:40:30 +08:00
PciEnumeratorSupport.c MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
PciEnumeratorSupport.h MdeModulePkg: Fix a PCI resource dumping bug in PciBusDxe driver 2015-11-03 02:33:41 +00:00
PciHotPlugSupport.c MdeModulePkg/PciBusDxe: recognize hotplug-capable PCIe ports 2016-07-13 08:39:29 +02:00
PciHotPlugSupport.h MdeModulePkg/PciBusDxe: recognize hotplug-capable PCIe ports 2016-07-13 08:39:29 +02:00
PciIo.c MdeModulePkg/PciBus: Restrict one VGA per HostBridge not Segment 2018-08-27 09:40:22 +08:00
PciIo.h MdeModulePkg PciBusDxe: Remove redundant functions 2018-08-21 16:28:57 +08:00
PciLib.c MdeModulePkg/PciBus: Shadow option ROM after BARs are programmed 2018-12-10 10:30:13 +08:00
PciLib.h MdeModulePkg PciBusDxe: The PCI Bus Driver is updated to support multiple PCI bus ranges for a PCI root bridge. 2011-10-28 09:59:40 +00:00
PciOptionRomSupport.c MdeModulePkg/PciBus: Shadow option ROM after BARs are programmed 2018-12-10 10:30:13 +08:00
PciOptionRomSupport.h Dispatch the UEFI option rom returned from PciPlatform/PciOverride protocol. 2015-01-20 06:45:01 +00:00
PciPowerManagement.c MdeModulePkg PciBusDxe and DuetPkg PciBusNoEnumerationDxe: Update ResetPowerManagementFeature() to clear 4 related R/W bits in the PMCSR register, leaving other bits preserved. 2012-04-12 01:49:27 +00:00
PciPowerManagement.h Update the copyright notice format 2010-04-24 09:49:11 +00:00
PciResourceSupport.c MdeModulePkg/PciBus: Shadow option ROM after BARs are programmed 2018-12-10 10:30:13 +08:00
PciResourceSupport.h Print resource allocation/bar programming when PciBus driver does PCI BUS enumeration. 2011-08-04 09:08:09 +00:00
PciRomTable.c MdeModulePkg/PciBus: Fix bug that doesn't produce BusOverride 2017-10-31 11:11:04 +08:00
PciRomTable.h MdeModulePkg/PciBus: Refine EFI_PCI_ROM_IMAGE_MAPPING 2017-10-31 11:11:03 +08:00