device/pci_rom: Fix on-board optionrom address

The function pci_rom_probe() may be called multiple times
for a device. For cases where CBFS does not contain optionrom
file, only the first time probing for the on-board ROM
chip worked.

PCI_ROM_ADDRESS_ENABLE is set on the first run. Mask out all
the reserved bits of PCI_ROM_ADDRESS register to get correct
physical address for rom_header.

Change-Id: I14374954af09201494bf2f13e5a6e4dc640c05ee
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33908
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Mike Banon <mikebdp2@gmail.com>
This commit is contained in:
Kyösti Mälkki 2019-06-29 22:34:07 +03:00
parent a19b07fec1
commit 8c9be43271
1 changed files with 2 additions and 0 deletions

View File

@ -77,6 +77,8 @@ struct rom_header *pci_rom_probe(struct device *dev)
rom_address|PCI_ROM_ADDRESS_ENABLE); rom_address|PCI_ROM_ADDRESS_ENABLE);
} }
rom_address &= PCI_ROM_ADDRESS_MASK;
printk(BIOS_DEBUG, "Option ROM address for %s = %lx\n", printk(BIOS_DEBUG, "Option ROM address for %s = %lx\n",
dev_path(dev), (unsigned long)rom_address); dev_path(dev), (unsigned long)rom_address);
rom_header = (struct rom_header *)rom_address; rom_header = (struct rom_header *)rom_address;