Skip to contentSkip to conversation

pci: Disable expansion ROM address decoding when signature check fails

PATCH New Bin Meng 2 participants 3 messages Jul 8, 2015 – Jul 13, 2015 1 message not in the archive PCI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Bin Meng

author
#1 lore raw

PATCH v3 2/2 pci: Disable expansion ROM address decoding when signature check fails

We should not leave the expansion ROM address window open when there is not a valid ROM.

---
I did not update pci_rom_probe() to handle the header type1 ROM address, as I think pci_rom_probe() is a static routine which is only used for VGA ROM only so far, so we don't need consider type1 case.

Changes in v3:
- Rebase on u-boot-x86/master

Changes in v2:
- New patch to disable expansion ROM address decoding when signature check fails

 drivers/pci/pci_rom.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pci/pci_rom.c +4 -0
index aa06767..a33efae 100644
@@ -104,6 +104,10 @@ static int pci_rom_probe(pci_dev_t dev, uint class,
 	if (le16_to_cpu(rom_header->signature) != PCI_ROM_HDR) {
 		printf("Incorrect expansion ROM header signature %04x\n",
 		       le16_to_cpu(rom_header->signature));
+#ifndef CONFIG_VGA_BIOS_ADDR
+		/* Disable expansion ROM address decoding */
+		pci_write_config_dword(dev, PCI_ROM_ADDRESS, rom_address);
+#endif
 		return -EINVAL;
 	}
 
Signature · 1 line
1.8.2.1
#2 lore raw

PATCH v3 2/2 pci: Disable expansion ROM address decoding when signature check fails

Quoted 11 lines · Bin Meng

We should not leave the expansion ROM address window open when there is not a valid ROM.

---
I did not update pci_rom_probe() to handle the header type1 ROM address, as I think pci_rom_probe() is a static routine which is only used for VGA ROM only so far, so we don't need consider type1 case.

Quoted 8 lines

Changes in v3:
- Rebase on u-boot-x86/master

Changes in v2:
- New patch to disable expansion ROM address decoding when signature check fails

 drivers/pci/pci_rom.c | 4 ++++
 1 file changed, 4 insertions(+)
#3 lore raw

PATCH v3 2/2 pci: Disable expansion ROM address decoding when signature check fails

Quoted 15 lines · Simon Glass
Quoted 14 lines · Bin Meng

We should not leave the expansion ROM address window open when there is not a valid ROM.

---
I did not update pci_rom_probe() to handle the header type1 ROM address, as I think pci_rom_probe() is a static routine which is only used for VGA ROM only so far, so we don't need consider type1 case.

Changes in v3:
- Rebase on u-boot-x86/master

Quoted 8 lines
Quoted 5 lines

Changes in v2:
- New patch to disable expansion ROM address decoding when signature check fails

 drivers/pci/pci_rom.c | 4 ++++
 1 file changed, 4 insertions(+)

Applied to u-boot-x86, thanks!