nb/intel/sandybridge: Advertise all MCH BARs

Currently not all fixed	MMIO ranges are	advertised to the resource
allocator. This	is not an issue	as long	bottom-up allocation is
used and as long as only small PCI BARs are present on the system.

Tell the PCI resource allocator about active MCH BARs to not overlap
PCI BARs with MCH BARs.

TEST=Can still boot on Lenovo X220. No issues seen in coreboot or Linux.

Change-Id: I9148ce492b3b16542bae2737c98b0e6fd0701745
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91039
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Patrick Rudolph 2026-02-01 10:00:03 +01:00 committed by Matt DeVillier
commit be31c8a212

View file

@ -201,6 +201,20 @@ static void mc_read_resources(struct device *dev)
printk(BIOS_DEBUG, "DPR base 0x%08x size %uM\n", dpr_base_k * KiB, dpr.size);
}
/* Non standard BARs */
u64 bar = pci_read_config32(dev, MCHBAR);
bar |= ((u64)pci_read_config32(dev, MCHBAR + 4) << 32);
if (bar & 1)
mmio_range(dev, index++, bar & ~0xf, 0x8000);
bar = pci_read_config32(dev, DMIBAR);
bar |= ((u64)pci_read_config32(dev, DMIBAR + 4) << 32);
if (bar & 1)
mmio_range(dev, index++, bar & ~0xf, 0x1000);
bar = pci_read_config32(dev, EPBAR);
bar |= ((u64)pci_read_config32(dev, EPBAR + 4) << 32);
if (bar & 1)
mmio_range(dev, index++, bar & ~0xf, 0x1000);
printk(BIOS_INFO, "Available memory below 4GB: %lluM\n", tomk >> 10);
/* Report the memory regions */