pci: Skip configuring PCI Rom Address for unsupported header types

PCI Rom Address is currently supported only for Normal (0x00) and
Bridge (0x01) header types. Fix code accordingly.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Pali Rohár 2021-10-07 14:50:57 +02:00 committed by Tom Rini
parent b04f64aa48
commit b9caab8b47

View File

@ -131,7 +131,8 @@ static void dm_pciauto_setup_device(struct udevice *dev, int bars_num,
/* Configure the expansion ROM address */ /* Configure the expansion ROM address */
dm_pci_read_config8(dev, PCI_HEADER_TYPE, &header_type); dm_pci_read_config8(dev, PCI_HEADER_TYPE, &header_type);
header_type &= 0x7f; header_type &= 0x7f;
if (header_type != PCI_HEADER_TYPE_CARDBUS) { if (header_type == PCI_HEADER_TYPE_NORMAL ||
header_type == PCI_HEADER_TYPE_BRIDGE) {
rom_addr = (header_type == PCI_HEADER_TYPE_NORMAL) ? rom_addr = (header_type == PCI_HEADER_TYPE_NORMAL) ?
PCI_ROM_ADDRESS : PCI_ROM_ADDRESS1; PCI_ROM_ADDRESS : PCI_ROM_ADDRESS1;
dm_pci_write_config32(dev, rom_addr, 0xfffffffe); dm_pci_write_config32(dev, rom_addr, 0xfffffffe);