]> git.proxmox.com Git - mirror_edk2.git/commit
UefiPayloadPkg: Fix PciHostBridgeLib
authorPatrick Rudolph <patrick.rudolph@9elements.com>
Wed, 16 Feb 2022 14:54:25 +0000 (07:54 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 29 Mar 2022 05:59:35 +0000 (05:59 +0000)
commitc248802e40dc2cea007a7063b73feb0d04809261
tree8ed4098dea5fb77619933f7f47be9a0fd3094587
parent449eb01a8d25dcd9683e02eec738ecb31ea542f3
UefiPayloadPkg: Fix PciHostBridgeLib

On modern platforms with TBT devices the coreboot resource allocator
opens large PCI bridge MMIO windows above 4GiB to place hotplugable
PCI BARs there as they won't fit below 4GiB. In addition modern
GPGPU devices have very big PCI bars that doesn't fit below 4GiB.

The PciHostBridgeLib made lots of assumptions about the coreboot
resource allocator that were not verified at runtime and are no
longer true.

Remove all of the 'coreboot specific' code and implement the same
logic as OvmfPkg's ScanForRootBridges.

Fixes assertion
"ASSERT [PciHostBridgeDxe] Bridge->Mem.Limit < 0x0000000100000000ULL".

Tested with coreboot as bootloader on platforms that have PCI resources
above 4GiB and on platforms that don't have resources above 4GiB.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c