pci: Fix expansion ROM programming for multi-function devices
authorBin Meng <bmeng.cn@gmail.com>
Wed, 7 Oct 2015 09:13:18 +0000 (02:13 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 8 Oct 2015 18:09:09 +0000 (20:09 +0200)
PCI_HEADER_TYPE register (offset 0x0e) bit 7 is an indicator
for multi-function devices. We should mask it off before using
it as the header type.

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

index 41d5447f122b129b65adc1b25484657663e601d4..79f27c744b295c4d25aeaddd99e9a87b23427c17 100644 (file)
@@ -185,6 +185,7 @@ void pciauto_setup_device(struct pci_controller *hose,
 #ifndef CONFIG_PCI_ENUM_ONLY
        /* Configure the expansion ROM address */
        pci_hose_read_config_byte(hose, dev, PCI_HEADER_TYPE, &header_type);
+       header_type &= 0x7f;
        if (header_type != PCI_HEADER_TYPE_CARDBUS) {
                rom_addr = (header_type == PCI_HEADER_TYPE_NORMAL) ?
                           PCI_ROM_ADDRESS : PCI_ROM_ADDRESS1;