cros: Inform U-Boot via fake gpio when VGA Option ROM is loaded

This prepares the way for vboot to inform coreboot when it needs the VGA
Option ROM loaded. Coreboot can't always know when it's needed (with
keyboard-based dev-mode, coreboot can't tell if we're in dev-mode or not).
By the time we get to U-Boot, it's too late, so we need two extra bits - one
for vboot to tell coreboot to load the Option ROM and another for coreboot
to let vboot know it's been done.

This change sets up the communication, but doesn't act on it just yet.

Even with this CL we always load the VGA Option ROM, so there's nothing to
test. There should be no user-visible change.

Change-Id: Ic4e9673a3707b6605064f4879bb3e74d4412322f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: http://review.coreboot.org/1822
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
diff --git a/src/devices/pci_device.c b/src/devices/pci_device.c
index 7fa7384..94f68ea 100644
--- a/src/devices/pci_device.c
+++ b/src/devices/pci_device.c
@@ -656,6 +656,10 @@
 			   ((device & 0xffff) << 16) | (vendor & 0xffff));
 }
 
+#if CONFIG_CHROMEOS
+int oprom_is_loaded = 0;
+#endif
+
 /** Default handler: only runs the relevant PCI BIOS. */
 void pci_dev_init(struct device *dev)
 {
@@ -675,8 +679,11 @@
 	 * 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())
+	if (!developer_mode_enabled() && !recovery_mode_enabled() &&
+	    !vboot_wants_oprom()) {
+		printk(BIOS_DEBUG, "Not loading VGA Option ROM\n");
 		return;
+	}
 #endif
 
 	rom = pci_rom_probe(dev);
@@ -696,6 +703,10 @@
 		return;
 #endif
 	run_bios(dev, (unsigned long)ram);
+#if CONFIG_CHROMEOS
+	oprom_is_loaded = 1;
+	printk(BIOS_DEBUG, "VGA Option ROM has been loaded\n");
+#endif
 #endif /* CONFIG_PCI_ROM_RUN || CONFIG_VGA_ROM_RUN */
 }