[coreboot] New patch to review for coreboot: a7f9842 cros: Inform U-Boot via fake gpio when VGA Option ROM is loaded
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Tue Nov 13 01:47:21 CET 2012
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1822
-gerrit
commit a7f9842fb310b21040ee8d7923169197b3b4c889
Author: Bill Richardson <wfrichar at chromium.org>
Date: Tue Jun 26 16:33:45 2012 -0700
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 at chromium.org>
---
src/devices/pci_device.c | 13 ++++++++++++-
src/vendorcode/google/chromeos/chromeos.h | 2 ++
src/vendorcode/google/chromeos/vbnv.c | 22 +++++++++++++++++-----
3 files changed, 31 insertions(+), 6 deletions(-)
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 @@ void pci_dev_set_subsystem(struct device *dev, unsigned vendor, unsigned device)
((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 @@ void pci_dev_init(struct device *dev)
* 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 @@ void pci_dev_init(struct device *dev)
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 */
}
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h
index ec0f3b7..37630a6 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -29,6 +29,8 @@ void save_chromeos_gpios(void);
/* functions implemented in vbnv.c: */
int get_recovery_mode_from_vbnv(void);
+int vboot_wants_oprom(void);
+extern int oprom_is_loaded;
/* functions implemented in chromeos.c: */
int developer_mode_enabled(void);
diff --git a/src/vendorcode/google/chromeos/vbnv.c b/src/vendorcode/google/chromeos/vbnv.c
index 2129461..3f333f7 100644
--- a/src/vendorcode/google/chromeos/vbnv.c
+++ b/src/vendorcode/google/chromeos/vbnv.c
@@ -38,6 +38,8 @@
#define BOOT_OFFSET 1
#define BOOT_DEBUG_RESET_MODE 0x80
+#define BOOT_DISABLE_DEV_REQUEST 0x40
+#define BOOT_OPROM_NEEDED 0x20
#define BOOT_TRY_B_COUNT_MASK 0x0F
#define RECOVERY_OFFSET 2
@@ -45,11 +47,7 @@
#define DEV_FLAGS_OFFSET 4
#define DEV_BOOT_USB_MASK 0x01
-
-#define FIRMWARE_FLAGS_OFFSET 5
-#define FIRMWARE_TEST_ERR_FUNC_MASK 0x38
-#define FIRMWARE_TEST_ERR_FUNC_SHIFT 3
-#define FIRMWARE_TEST_ERR_NUM_MASK 0x07
+#define DEV_BOOT_SIGNED_ONLY_MASK 0x02
#define KERNEL_FIELD_OFFSET 11
#define CRC_OFFSET 15
@@ -107,3 +105,17 @@ int get_recovery_mode_from_vbnv(void)
vbnv_setup();
return vbnv[RECOVERY_OFFSET];
}
+
+int vboot_wants_oprom(void)
+{
+ if (!vbnv_initialized)
+ vbnv_setup();
+
+ /* FIXME(crosbug.com/p/8789). The following commented-out line does the
+ * right thing, assuming that vboot has requested the option ROM and
+ * rebooted if it finds that it's needed but not loaded. At the moment,
+ * it doesn't yet do that, so we must always say we want it. */
+
+ /* return (vbnv[BOOT_OFFSET] & BOOT_OPROM_NEEDED) ? 1 : 0; */
+ return 1;
+}
More information about the coreboot
mailing list