]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci: Skip configuring PCI Rom Address for unsupported header types
authorPali Rohár <pali@kernel.org>
Thu, 7 Oct 2021 12:50:57 +0000 (14:50 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 14 Oct 2021 23:45:07 +0000 (19:45 -0400)
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>
drivers/pci/pci_auto.c

index 08082460eb8631cc051b0d6983979f0951e5c0d1..288f7996c7c0710033f5021c3fed76621b8376ed 100644 (file)
@@ -131,7 +131,8 @@ static void dm_pciauto_setup_device(struct udevice *dev, int bars_num,
        /* Configure the expansion ROM address */
        dm_pci_read_config8(dev, PCI_HEADER_TYPE, &header_type);
        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) ?
                        PCI_ROM_ADDRESS : PCI_ROM_ADDRESS1;
                dm_pci_write_config32(dev, rom_addr, 0xfffffffe);