[U-Boot] [PATCH v2 2/2] pci: Disable expansion ROM address decoding when signature check fails

Bin Meng bmeng.cn at gmail.com
Tue Jun 23 05:45:21 CEST 2015


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

Suggested-by: Matt Porter <mporter at konsulko.com>
Signed-off-by: Bin Meng <bmeng.cn at gmail.com>

---
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 v2:
- New patch to disable expansion ROM address decoding when signature check fails

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

diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index f364799..e6f4806 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -103,6 +103,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_X86_OPTION_ROM_ADDR
+		/* Disable expansion ROM address decoding */
+		pci_write_config_dword(dev, PCI_ROM_ADDRESS, rom_address);
+#endif
 		return -EINVAL;
 	}
 
-- 
1.8.2.1



More information about the U-Boot mailing list