summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2024-05-21 19:22:35 +0200
committerFelix Held <felix-coreboot@felixheld.de>2024-05-24 13:16:27 +0000
commit8ed95c3d2b349c6fb105c8b72bd99b0b584073af (patch)
treeb1be38bb95973ee00f8ea372cdea0c7277e596e4 /src
parentebfb285085dbc3f20c21c579400499f1243459d4 (diff)
device/pci_rom: handle non-remapped VGA_BIOS_ID
While the SoC-level defaults for VGA_BIOS_ID are the expected correctly remapped PCI VID/PID of the GPU which matches the PCI VID/DID inside the VBIOS file, some mainboards override the VGA_BIOS_ID setting to the non-remapped PCI ID. This resulted in coreboot not finding the VBIOS file after commit 42f0396a1028 ("device/pci_rom: rework PCI ID remapping in pci_rom_probe"). The proper solution would be to not override this SoC-level config in neither the mainboard code nor some external config file. This however requires adding/using some mechanism to tell SeaBIOS which VBIOS image to use for the GPU device. Once this is implemented, the SoC default for VGA_BIOS_ID shouldn't be overridden any more and this patch can be reverted again. This sort-of reverts parts of commit 42f0396a1028 ("device/pci_rom: rework PCI ID remapping in pci_rom_probe"), but it still tries to find the VBIOS image with the expected remapped PCI ID and only adds trying the non-remapped PCI ID as a fallback when the file with the remapped PCI ID doesn't exist and prints a notice in that case. Before the patch referenced above, using the correct remapped PCI VID/DID resulted in a warning about the CBFS file with the non-remapped name not being found, but first checking the remapped version solves that problem. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I7cd8e2036250f4ca2239b04cd070bbf0778b13aa Reviewed-on: https://review.coreboot.org/c/coreboot/+/82592 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Diffstat (limited to 'src')
-rw-r--r--src/device/pci_rom.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c
index b9210b0d65..7679552c59 100644
--- a/src/device/pci_rom.c
+++ b/src/device/pci_rom.c
@@ -49,6 +49,17 @@ struct rom_header *pci_rom_probe(const struct device *dev)
mapped_vendev = map_oprom_vendev(vendev);
rom_header = cbfs_boot_map_optionrom(mapped_vendev >> 16, mapped_vendev & 0xffff);
+ /* Handle the case of VGA_BIOS_ID not being set to the remapped PCI ID. This is a
+ workaround that should be removed once the underlying issue is fixed. */
+ if (!rom_header && vendev != mapped_vendev) {
+ rom_header = cbfs_boot_map_optionrom(vendev >> 16, vendev & 0xffff);
+ if (rom_header) {
+ printk(BIOS_NOTICE, "VGA_BIOS_ID should be the remapped PCI ID "
+ "%04hx,%04hx in the VBIOS file\n",
+ mapped_vendev >> 16, mapped_vendev & 0xffff);
+ }
+ }
+
if (rom_header) {
printk(BIOS_DEBUG, "In CBFS, ROM address for %s = %p\n",
dev_path(dev), rom_header);