Revert "m5a99x-evo: ugly quirks, but WOOT: ohai seabios :-)"
[coreboot.git] / src / devices / pci_device.c
index 2ccb38a75eed74af175abbc65e2ec5a306068486..c0559956b39e94a196ee79b7000202ada316fbfb 100644 (file)
 #if CONFIG_PC80_SYSTEM == 1
 #include <pc80/i8259.h>
 #endif
+#if CONFIG_HAVE_ACPI_RESUME && !CONFIG_S3_VGA_ROM_RUN
+#include <arch/acpi.h>
+#endif
+#if CONFIG_CHROMEOS
+#include <vendorcode/google/chromeos/chromeos.h>
+#endif
 
 u8 pci_moving_config8(struct device *dev, unsigned int reg)
 {
@@ -664,6 +670,15 @@ void pci_dev_init(struct device *dev)
            ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA))
                return;
 
+#if CONFIG_CHROMEOS
+       /* In ChromeOS we want to boot blazingly fast. Therefore
+        * we don't run (VGA) option ROMs, unless we have to print
+        * something on the screen before the kernel is loaded.
+        */
+       if (!developer_mode_enabled() && !recovery_mode_enabled())
+               return;
+#endif
+
        rom = pci_rom_probe(dev);
        if (rom == NULL)
                return;
@@ -672,6 +687,14 @@ void pci_dev_init(struct device *dev)
        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.
+        */
+       if ((acpi_slp_type == 3) &&
+               ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA))
+               return;
+#endif
        run_bios(dev, (unsigned long)ram);
 #endif /* CONFIG_PCI_ROM_RUN || CONFIG_VGA_ROM_RUN */
 }