]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci: Mask the ROM address in case it is already enabled
authorSimon Glass <sjg@chromium.org>
Sun, 16 Jul 2023 03:39:03 +0000 (21:39 -0600)
committerBin Meng <bmeng@tinylab.org>
Mon, 17 Jul 2023 09:12:26 +0000 (17:12 +0800)
In some cases the video ROM may have been enabled previously, such as by
a previous firmware stage. Use the correct address in that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/pci/pci_rom.c

index 503feb1e6d44bb6033ca114c5b42f022ce77c9f7..438583aa01795187e3e3eca147729b8b8bedf977 100644 (file)
@@ -93,6 +93,7 @@ static int pci_rom_probe(struct udevice *dev, struct pci_rom_header **hdrp)
                debug("%s: rom_address=%x\n", __func__, rom_address);
                return -ENOENT;
        }
+       rom_address &= PCI_ROM_ADDRESS_MASK;
 
        /* Enable expansion ROM address decoding. */
        dm_pci_write_config32(dev, PCI_ROM_ADDRESS,