Hello, I want to start a discussion about PCI MMIO size that hit me a couple of times using coreboot. I'm focused on Intel Sandybridge, but I guess this topic applies to all x86 systems.
On most Intel systems the PCI mmio size is hard-coded in coreboot to 1024Mbyte, but the value is hidden deep inside raminit code. The mmio size for dynamic resources is limited on top by PCIEXBAR, IOAPIC, ME stolen, ... that takes 128Mbyte and on the other end it's limited by graphics stolen and TSEG that require at least 40Mbyte. In total there's only space for two 256Mbyte PCI BARs, due to alignment. That's enough for systems that only do have an Intel GPU, but it fails as soon as PCI devices use more than a single 256Mbyte BAR. The PCI mmio size is set in romstage, but PCI BARs are configured in ramstage.
Following questions came to my mind: * How does the MRC handle this ? * Should the user be able to modify PCI mmio size ? * How to pass the required PCI mmio size to romstage ? A good place seems to be the mrc cache, but ramstage doesn't know about it's structure. * How is this solved on AMD systems ? * Should the romstage scan PCI devices and count required BAR size ?
Regards, Patrick