[coreboot-gerrit] New patch to review for coreboot: d9f9901 vboot: Add support for OPROM_MATTERS and SLOW_EC

Aaron Durbin (adurbin@google.com) gerrit at coreboot.org
Mon Mar 23 23:44:16 CET 2015


Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8887

-gerrit

commit d9f9901713b44d3afac30d87604e7faad4217379
Author: Duncan Laurie <dlaurie at chromium.org>
Date:   Thu Oct 16 17:00:23 2014 -0700

    vboot: Add support for OPROM_MATTERS and SLOW_EC
    
    In order to display a "update in progress" screen on devices with
    a slow EC or PD chip it may be necessary to also load the VGA
    Option ROM when doing EC software sync.
    
    This adds config options for VBOOT_EC_SLOW_UPDATE which simply sets
    a flag in the input parameters that is already handled by vboot.
    
    It also adds a config option for VBOOT_OPROM_MATTERS which is a bit
    more tricky in that it sets a flag in input parameters, but also
    needs to keep track of the option rom being loaded and pass that
    flag into VbInit as well.
    
    Since VbInit will clear the NV bit for option rom loaded the check
    that is done in vboot_wants_oprom() needs to first compare against
    the vboot handoff copy of the input flags.
    
    BUG=chrome-os-partner:32379
    BRANCH=samus
    TEST=manual testing:
    1) in normal mode, with EC/PD in RW, ensure that they are rebooted
    to RO and the VGA Option ROM is loaded and the wait screen is
    displayed, and then the system is rebooted at the end and the
    VGA Option ROM is not loaded.
    2) same as #1 with EC/PD in RO already, same result
    3) same as #1 with system in developer mode, same result except
    there is no reboot at the end of software sync
    4) same as #1 with system in developer mode and EC/PD in RO,
    ensure that there is no extra reboot at the beginning or end of
    software sync.
    
    Original-Change-Id: Ic2b34bf9e7c6cc5498413fa1b8dff6e6207c9d0a
    Original-Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/223831
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
    (cherry picked from commit 7d7aa89238efb5081885f9386c8e872fc96f573f)
    
    Change-Id: Ib7fb24e6e80e1f7e836bc62246ab9b3e056fd73d
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
 src/vendorcode/google/chromeos/Kconfig        | 15 +++++++++++++++
 src/vendorcode/google/chromeos/vbnv_cmos.c    | 13 +++++++++++++
 src/vendorcode/google/chromeos/vboot_loader.c | 10 ++++++++++
 3 files changed, 38 insertions(+)

diff --git a/src/vendorcode/google/chromeos/Kconfig b/src/vendorcode/google/chromeos/Kconfig
index 668cbd0..8826a14 100644
--- a/src/vendorcode/google/chromeos/Kconfig
+++ b/src/vendorcode/google/chromeos/Kconfig
@@ -119,6 +119,21 @@ config EC_SOFTWARE_SYNC
 	  firmware similar to how vboot verifies the main system firmware. This
 	  option selects whether depthcharge should support EC software sync.
 
+config VBOOT_EC_SLOW_UPDATE
+	bool "EC is slow to update"
+	default n
+	depends on EC_SOFTWARE_SYNC
+	help
+	  Whether the EC (or PD) is slow to update and needs to display a
+	  screen that informs the user the update is happening.
+
+config VBOOT_OPROM_MATTERS
+	bool "Video option ROM matters"
+	default n
+	depends on VBOOT_VERIFY_FIRMWARE
+	help
+	  Whether the video option ROM has run matters on this platform.
+
 config VIRTUAL_DEV_SWITCH
 	bool "Virtual developer switch support"
 	default n
diff --git a/src/vendorcode/google/chromeos/vbnv_cmos.c b/src/vendorcode/google/chromeos/vbnv_cmos.c
index a13726d..7c22c6b 100644
--- a/src/vendorcode/google/chromeos/vbnv_cmos.c
+++ b/src/vendorcode/google/chromeos/vbnv_cmos.c
@@ -19,10 +19,14 @@
 
 #include <types.h>
 #include <string.h>
+#include <cbmem.h>
 #include <console/console.h>
 #include <pc80/mc146818rtc.h>
 #include <arch/early_variables.h>
 #include "chromeos.h"
+#if IS_ENABLED(CONFIG_VBOOT_VERIFY_FIRMWARE)
+#include "vboot_handoff.h"
+#endif
 
 #define VBNV_BLOCK_SIZE 16	/* Size of NV storage block in bytes */
 
@@ -140,6 +144,15 @@ int get_recovery_mode_from_vbnv(void)
 
 int vboot_wants_oprom(void)
 {
+#if IS_ENABLED(CONFIG_VBOOT_VERIFY_FIRMWARE)
+	struct vboot_handoff *vbho;
+
+	/* First check if handoff structure flag exists and is set. */
+	vbho = cbmem_find(CBMEM_ID_VBOOT_HANDOFF);
+	if (vbho && vbho->init_params.flags & VB_INIT_FLAG_OPROM_LOADED)
+		return 1;
+#endif
+
 	if (!is_vbnv_initialized())
 		vbnv_setup();
 
diff --git a/src/vendorcode/google/chromeos/vboot_loader.c b/src/vendorcode/google/chromeos/vboot_loader.c
index 2a1ee3e..d13608c 100644
--- a/src/vendorcode/google/chromeos/vboot_loader.c
+++ b/src/vendorcode/google/chromeos/vboot_loader.c
@@ -230,6 +230,16 @@ static void vboot_invoke_wrapper(struct vboot_handoff *vboot_handoff)
 		*iflags |= VB_INIT_FLAG_EC_SOFTWARE_SYNC;
 		*iflags |= VB_INIT_FLAG_VIRTUAL_REC_SWITCH;
 	}
+	if (CONFIG_VBOOT_EC_SLOW_UPDATE)
+		*iflags |= VB_INIT_FLAG_EC_SLOW_UPDATE;
+	if (CONFIG_VBOOT_OPROM_MATTERS) {
+		*iflags |= VB_INIT_FLAG_OPROM_MATTERS;
+		/* Will load VGA option rom during this boot */
+		if (developer_mode_enabled() || recovery_mode_enabled() ||
+		    vboot_wants_oprom()) {
+			*iflags |= VB_INIT_FLAG_OPROM_LOADED;
+		}
+	}
 
 	context.handoff = vboot_handoff;
 	context.cparams = &cparams;



More information about the coreboot-gerrit mailing list