summaryrefslogtreecommitdiff
path: root/drivers/pci/pci_rom.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-01-14 21:37:04 -0700
committerSimon Glass <sjg@chromium.org>2015-01-23 17:24:54 -0700
commit4a2708a097eacd7aa3d10ccf26a70a467fa69217 (patch)
treec2e07f6db9d83dbb45d2054343eff5172c34ae8f /drivers/pci/pci_rom.c
parent07570e709765e93f2b1e9506cfd8fa24455636b5 (diff)
x86: Access the VGA ROM when needed
Add code to the generic pci_rom file to access the VGA ROM in PCI space when needed. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pci/pci_rom.c')
-rw-r--r--drivers/pci/pci_rom.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index a16e99f1da..eb7659177b 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -81,7 +81,12 @@ static int pci_rom_probe(pci_dev_t dev, uint class,
#ifdef CONFIG_X86_OPTION_ROM_ADDR
rom_address = CONFIG_X86_OPTION_ROM_ADDR;
#else
- pci_write_config_dword(dev, PCI_ROM_ADDRESS, (u32)PCI_ROM_ADDRESS_MASK);
+
+ if (pciauto_setup_rom(pci_bus_to_hose(PCI_BUS(dev)), dev)) {
+ debug("Cannot find option ROM\n");
+ return -ENOENT;
+ }
+
pci_read_config_dword(dev, PCI_ROM_ADDRESS, &rom_address);
if (rom_address == 0x00000000 || rom_address == 0xffffffff) {
debug("%s: rom_address=%x\n", __func__, rom_address);