summaryrefslogtreecommitdiff
path: root/src/device/pci_device.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-03-28 15:59:19 -0500
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-04-01 20:55:56 +0200
commitce872cb9afd55bc7bee8ebf08319e1400c860e71 (patch)
treebb6802ec85f175d751dddf5a15b8bf196b99eee8 /src/device/pci_device.c
parent8b5b764af6562235823f03c04e8184f048ab6320 (diff)
pci: don't load vga option rom before S3 check
The pci device code was probing and loading the option rom before it did the S3 resume check for VGA option roms. Instead move this check before probing and loading so that we don't unnecessarily do work. Change-Id: If2e62d0c0e4b34b4f1bcd56ebcb9d3f54c6d0d24 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/2979 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/device/pci_device.c')
-rw-r--r--src/device/pci_device.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index ff334fee0e..4c5a81451c 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -685,14 +685,6 @@ void pci_dev_init(struct device *dev)
}
#endif
- rom = pci_rom_probe(dev);
- if (rom == NULL)
- return;
-
- ram = pci_rom_load(dev, rom);
- if (ram == NULL)
- return;
-
#if CONFIG_HAVE_ACPI_RESUME && !CONFIG_S3_VGA_ROM_RUN
/* If S3_VGA_ROM_RUN is disabled, skip running VGA option
* ROMs when coming out of an S3 resume.
@@ -701,6 +693,15 @@ void pci_dev_init(struct device *dev)
((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA))
return;
#endif
+
+ rom = pci_rom_probe(dev);
+ if (rom == NULL)
+ return;
+
+ ram = pci_rom_load(dev, rom);
+ if (ram == NULL)
+ return;
+
run_bios(dev, (unsigned long)ram);
#if CONFIG_CHROMEOS
oprom_is_loaded = 1;