diff options
author | Matt Delco <delco@google.com> | 2019-02-13 12:58:58 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-21 03:31:38 -0700 |
commit | b6f4defb81d24b696c111abae97648fe303f8322 (patch) | |
tree | 51961529a51f99c3d9fa845b2d64f0a5555b2b8f /firmware/2lib | |
parent | 90a95ea62ade991769540f4a0c0e6465f3b3926c (diff) | |
download | vboot-b6f4defb81d24b696c111abae97648fe303f8322.tar.gz |
vboot: add diagnostic mode
This change adds diagnostic mode. When enabled for a board (based on
defconfig in depthcharge) the user can press Ctrl-C or F12 at a recovery
mode screen, at which point an nv bit is set and the system reboots.
Upon reboot, if the nv bit is set then the user is prompted to confirm
launch of the diagnostic rom via the power button. If user confirms
then the diagnostic payload is verified and run (if verify fails or
payload doesn't run then a recovery reason is recorded and system
reboots to recovery mode). If the user does not confirm then the system
reboots.
BUG=b:124358784
BRANCH=None
TEST=Locally built and flashed using change that enabled feature for atlas
and set to use payload 2 (tianocore) rather than 5 (diagnostic). Confirmed
that Ctrl-C is functional or not based on defconfig and that Ctrl-C
sets NV bit and reboots. Confirmed that NV bit can be set and
queried via crossystem. Confirmed that during boot confirmation screen
appears or not based on NV bit. Confirmed that pressing power button
caused payload to be verified and run. Confirmed that non-matching hash
(build configured to use sha1 rather than sha256) caused payload to not
be run and system reboot to recovery. Confirmed that Esc or timeout
caused system to reboot.
CQ-DEPEND=CL:1471056
Change-Id: I8979d4eeb443bf64b727ee86a814c46d1d27ff37
Signed-off-by: Matt Delco <delco@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1470723
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/2lib')
-rw-r--r-- | firmware/2lib/include/2recovery_reasons.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/2lib/include/2recovery_reasons.h b/firmware/2lib/include/2recovery_reasons.h index a35892c2..f8e6dbe9 100644 --- a/firmware/2lib/include/2recovery_reasons.h +++ b/firmware/2lib/include/2recovery_reasons.h @@ -219,6 +219,12 @@ enum vb2_nv_recovery { /* Recovery hash space lock error in RO firmware */ VB2_RECOVERY_RO_TPM_REC_HASH_L_ERROR = 0x5f, + /* Failed to disable the TPM [prior to running untrusted code] */ + VB2_RECOVERY_TPM_DISABLE_FAILED = 0x60, + + /* Alt FW Failed hash verification */ + VB2_RECOVERY_ALTFW_HASH_FAILED = 0x61, + /* Unspecified/unknown error in rewritable firmware */ VB2_RECOVERY_RW_UNSPECIFIED = 0x7f, |