summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-03-08 15:38:01 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-03-09 20:57:40 +0000
commit42f0396a1028fa2a81a73ff6ced36585ffe219b0 (patch)
treed0ed3072353d82730927346b077a3ad5b4d31376
parentdd40122fd611cd53f87a47ae67ed703217e753a6 (diff)
device/pci_rom: rework PCI ID remapping in pci_rom_probe
Only call cbfs_boot_map_optionrom/cbfs_boot_map_optionrom_revision once and pass the already remapped PCI ID to it. This avoids the spurious warning that the CBFS file wasn't found from the first cbfs_boot_map_optionrom call in cases where the PCI ID needs to be remapped to get the right ID for which a file in CBFS exists. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: If7da78c69dd702280a78996a5823972516e0319b Reviewed-on: https://review.coreboot.org/c/coreboot/+/73612 Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/device/pci_rom.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c
index 8480626056..a454c9e0ae 100644
--- a/src/device/pci_rom.c
+++ b/src/device/pci_rom.c
@@ -60,24 +60,14 @@ struct rom_header *pci_rom_probe(const struct device *dev)
/* If the ROM is in flash, then don't check the PCI device for it. */
if (CONFIG(CHECK_REV_IN_OPROM_NAME)) {
- rom_header = cbfs_boot_map_optionrom_revision(dev->vendor, dev->device, rev);
map_oprom_vendev_rev(&mapped_vendev, &mapped_rev);
+ rom_header = cbfs_boot_map_optionrom_revision(mapped_vendev >> 16,
+ mapped_vendev & 0xffff,
+ mapped_rev);
} else {
- rom_header = cbfs_boot_map_optionrom(dev->vendor, dev->device);
mapped_vendev = map_oprom_vendev(vendev);
- }
-
- if (!rom_header) {
- if (CONFIG(CHECK_REV_IN_OPROM_NAME) &&
- (vendev != mapped_vendev || rev != mapped_rev)) {
- rom_header = cbfs_boot_map_optionrom_revision(
- mapped_vendev >> 16,
- mapped_vendev & 0xffff, mapped_rev);
- } else if (vendev != mapped_vendev) {
- rom_header = cbfs_boot_map_optionrom(
- mapped_vendev >> 16,
- mapped_vendev & 0xffff);
- }
+ rom_header = cbfs_boot_map_optionrom(mapped_vendev >> 16,
+ mapped_vendev & 0xffff);
}
if (rom_header) {