summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2api.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2016-02-19 20:20:10 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-02-23 16:58:50 -0800
commitd187cd3fc792f8bcefbee4587c83eafbd08441fc (patch)
treed6131fce72fb414346dec9f34b3249e1007dd82d /firmware/2lib/include/2api.h
parent478b6d34afb9fd98daf0663dd6093d8f058a9f34 (diff)
downloadvboot-release-R50-7978.B.tar.gz
If a platform does verification of memory init then it must be careful to use the same slot for resume that it booted from. This is accomplished by adding a context flag to indicate this is an S3 resume and that vboot should treat it differently than a normal boot. When this flag is set then the same slot that was booted is read from VBNV and re-used for the resume path, without adjusting any try flags. If this slot is B then the related context flag is set. This will allow the firmware updater to update the other (non-booted) slot and set flags indicating that on the next boot the updated slot should be tried, while still allowing suspend/resume to work with the existing firmware slot. This assumes that the last tried slot was successfully booted, which should be a safe assumption since the system was able to boot and then suspend. It isn't reliable to check last_fw_result for "success" status because that status is only set some time after boot when chromeos-setgoodkernel calls chromeos-firmwareupdate --mode=bootok and so it may still report a status of "trying" on resume depending on how soon after boot the suspend happened. It also avoids setting the vboot flag indicating that a slot choice was made in order to avoid altering the try counter on failure since this is explicitly not attempting to boot the new slot. 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: I500faef2b5d19a02f32839976354abf6d551c9f6 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/328812 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2api.h')
-rw-r--r--firmware/2lib/include/2api.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index bf8f6393..709db48b 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -129,6 +129,9 @@ enum vb2_context_flags {
* unrecoverable crash loop.
*/
VB2_CONTEXT_SECDATA_WANTS_REBOOT = (1 << 13),
+
+ /* Boot is S3->S0 resume, not S5->S0 normal boot */
+ VB2_CONTEXT_S3_RESUME = (1 << 14),
};
/*