summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2016-02-19 20:26:07 -0800
committerMartin Roth <martinroth@google.com>2016-02-29 20:18:33 +0100
commit1cdaccab1ce3878d01de8d47fe83874fe8ec5b58 (patch)
tree5b4b72b731cb89fc0954b6533fdc766dd064eb2f
parentefcddd971779b10764985caa485091e194e12529 (diff)
downloadcoreboot-1cdaccab1ce3878d01de8d47fe83874fe8ec5b58.tar.xz
vboot: Set S3_RESUME flag for vboot context if necessary
If a platform does verification of the memory init step, and it must resume with the same slot that it booted from then it needs to set the vboot context flag when resuming instead of booting. This will affect the slot that is selected to verify and resume from. BUG=chromium:577269 BRANCH=glados TEST=manually tested on chell: 1) ensure that booting from slot A resumes from slot A. 2) ensure that booting from slot B resumes from slot B. 3) do RW update while booted from slot A (so the flags are set to try slot B) and ensure that suspend/resume still functions properly using current slot A. 4) do RW update while booted from slot B (so the flags are set to try slot A) and ensure that suspend/resume still functions properly using current slot B. Change-Id: I77e6320e36b4d2cbc308cfb39f0d4999e3497be3 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 4c84af7eae7b2a52a28cc3ef8a80649301215a68 Original-Change-Id: I395e5abaccd6f578111f242d1e85e28dced469ea Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/328775 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/13834 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--src/vendorcode/google/chromeos/vboot2/vboot_logic.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/vboot2/vboot_logic.c b/src/vendorcode/google/chromeos/vboot2/vboot_logic.c
index a4829c097e..d43fb276d0 100644
--- a/src/vendorcode/google/chromeos/vboot2/vboot_logic.c
+++ b/src/vendorcode/google/chromeos/vboot2/vboot_logic.c
@@ -311,6 +311,15 @@ void verstage_main(void)
antirollback_read_space_firmware(&ctx);
timestamp_add_now(TS_END_TPMINIT);
+ /* Set S3 resume flag if vboot should behave differently when selecting
+ * which slot to boot. This is only relevant to vboot if the platform
+ * does verification of memory init and thus must ensure it resumes with
+ * the same slot that it booted from. */
+ if (IS_ENABLED(CONFIG_RESUME_PATH_SAME_AS_BOOT) &&
+ IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK) &&
+ vboot_platform_is_resuming())
+ ctx.flags |= VB2_CONTEXT_S3_RESUME;
+
if (!IS_ENABLED(CONFIG_VIRTUAL_DEV_SWITCH) &&
get_developer_mode_switch())
ctx.flags |= VB2_CONTEXT_FORCE_DEVELOPER_MODE;