Skip to contentSkip to conversation

pci: Fix expansion ROM programming for multi-function devices

PATCH New Bin Meng 2 participants 6 messages Oct 7, 2015 – Oct 19, 2015 PCI

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 pci: Fix expansion ROM programming for multi-function devices

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.

---

 drivers/pci/pci_auto.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/pci_auto.c +1 -0
index 41d5447..79f27c7 100644
@@ -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;
Signature · 1 line
1.8.2.1
author
#1 lore raw

PATCH 1/1 pci: Fix expansion ROM programming for multi-function devices

Hi Tom,

Quoted 15 lines · Bin Meng

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.

---

 drivers/pci/pci_auto.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/pci_auto.c +0 -0
index 41d5447..79f27c7 100644

drivers/pci/pci_auto.c void pciauto_setup_device(struct pci_controller *hose,

Quoted 8 lines
drivers/pci/pci_auto.c +1 -1
@@ -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;
--

I think we should get this patch in v2015.10 as it's a bug fix otherwise multi-function devices won't get ROM address assigned.

Regards,
Bin

#3 lore raw

PATCH 1/1 pci: Fix expansion ROM programming for multi-function devices

Hi Bin,

Quoted 5 lines · Simon Glass
Quoted 4 lines · Bin Meng

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.

Quoted 7 lines
Quoted 5 lines

---

 drivers/pci/pci_auto.c | 1 +
 1 file changed, 1 insertion(+)

I'm not sure if this fix actually fixes anything for existing boards, but I'll pick it up.

Is there anything else I have missed?

Regards,
Simon

author
#4 lore raw

PATCH 1/1 pci: Fix expansion ROM programming for multi-function devices

Hi Simon,

Quoted 11 lines · Simon Glass

Hi Bin,

Quoted 8 lines · Simon Glass
Quoted 7 lines · Bin Meng

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.

---

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
 drivers/pci/pci_auto.c | 1 +
 1 file changed, 1 insertion(+)

I'm not sure if this fix actually fixes anything for existing boards, but I'll pick it up.

Yes, it fixes the Crown Bay board where Topcliff PCI device D0:F0 is a multi-function device and has a ROM.

Quoted 2 lines

Is there anything else I have missed?

So far I believe everything for this release is in. Thanks!

Regards,
Bin

#5 lore raw

PATCH 1/1 pci: Fix expansion ROM programming for multi-function devices

Quoted 26 lines · Bin Meng

Hi Simon,

Quoted 11 lines · Simon Glass

Hi Bin,

Quoted 8 lines · Simon Glass
Quoted 7 lines · Bin Meng

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.

---

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
 drivers/pci/pci_auto.c | 1 +
 1 file changed, 1 insertion(+)

I'm not sure if this fix actually fixes anything for existing boards, but I'll pick it up.

Yes, it fixes the Crown Bay board where Topcliff PCI device D0:F0 is a multi-function device and has a ROM.

Quoted 7 lines
Quoted 2 lines

Is there anything else I have missed?

So far I believe everything for this release is in. Thanks!

Regards,
Bin

Applied to u-boot-x86, and now in mainline.