summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2015-02-10 14:34:01 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-23 22:41:32 +0000
commit21023ed04ee2dd6ff1bef0d5866a978001442e9a (patch)
tree04d915bb93b87ed4e26ceae1df1aa5d82524c05d
parent12587293b756dec2e725a8071fd74f044cc483be (diff)
downloadvboot-21023ed04ee2dd6ff1bef0d5866a978001442e9a.tar.gz
vboot1: Add vboot2 recovery reason strings and subcode to TAB display
vboot2 added a few new recovery reasons (and abolished many old ones). In the current vboot2/vboot1 hybrid architecture used on Veyron, the vboot1 kernel verification part controls the status display when pressing the TAB key, which may try to show recovery reasons set by the vboot2 firmware verification part. These currently result in the not very helpful "We have no idea what this means", so lets hack a few more strings into vboot1 which will be otherwise harmless. Also add the recovery_subcode field to the display, which is used much more extensively by vboot2 and often very useful in firguring out what really went wrong. BRANCH=veyron BUG=None TEST=Manually set a few recovery reasons and subcodes through crossystem and made sure they get displayed correctly on my Jerry. Change-Id: I3f3e6c6ae6e7981337841c0c5e3cd767628472c3 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/248391 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/252206 Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--firmware/include/vboot_nvstorage.h10
-rw-r--r--firmware/lib/vboot_display.c15
2 files changed, 24 insertions, 1 deletions
diff --git a/firmware/include/vboot_nvstorage.h b/firmware/include/vboot_nvstorage.h
index f71a55ab..4401777e 100644
--- a/firmware/include/vboot_nvstorage.h
+++ b/firmware/include/vboot_nvstorage.h
@@ -183,6 +183,16 @@ typedef enum VbFwResult {
#define VBNV_RECOVERY_EC_EXPECTED_HASH 0x29
/* EC software sync - expected EC image doesn't match hash */
#define VBNV_RECOVERY_EC_HASH_MISMATCH 0x2A
+/* VB2: Secure data inititalization error */
+#define VBNV_RECOVERY_VB2_SECDATA_INIT 0x2B
+/* VB2: GBB header is bad */
+#define VBNV_RECOVERY_VB2_GBB_HEADER 0x2C
+/* VB2: Unable to clear TPM owner */
+#define VBNV_RECOVERY_VB2_TPM_CLEAR_OWNER 0x2D
+/* VB2: Error determining/updating virtual dev switch */
+#define VBNV_RECOVERY_VB2_DEV_SWITCH 0x2E
+/* VB2: Error determining firmware slot */
+#define VBNV_RECOVERY_VB2_FW_SLOT 0x2F
/* Unspecified/unknown error in read-only firmware */
#define VBNV_RECOVERY_RO_UNSPECIFIED 0x3F
/*
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index c66af8df..26fa8bd4 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -430,6 +430,16 @@ const char *RecoveryReasonString(uint8_t code)
return "EC software sync unable to jump to EC-RW";
case VBNV_RECOVERY_EC_PROTECT:
return "EC software sync protection error";
+ case VBNV_RECOVERY_VB2_SECDATA_INIT:
+ return "Secure NVRAM (TPM) initialization error";
+ case VBNV_RECOVERY_VB2_GBB_HEADER:
+ return "Error parsing GBB header";
+ case VBNV_RECOVERY_VB2_TPM_CLEAR_OWNER:
+ return "Error trying to clear TPM owner";
+ case VBNV_RECOVERY_VB2_DEV_SWITCH:
+ return "Error reading or updating developer switch";
+ case VBNV_RECOVERY_VB2_FW_SLOT:
+ return "Error selecting RW firmware slot";
case VBNV_RECOVERY_RO_UNSPECIFIED:
return "Unspecified/unknown error in RO firmware";
case VBNV_RECOVERY_RW_DEV_SCREEN:
@@ -511,11 +521,14 @@ VbError_t VbDisplayDebugInfo(VbCommonParams *cparams, VbNvContext *vncptr)
used += StrnAppend(buf + used, "HWID: ", DEBUG_INFO_SIZE - used);
used += StrnAppend(buf + used, hwid, DEBUG_INFO_SIZE - used);
- /* Add recovery reason */
+ /* Add recovery reason and subcode */
+ VbNvGet(vncptr, VBNV_RECOVERY_SUBCODE, &i);
used += StrnAppend(buf + used,
"\nrecovery_reason: 0x", DEBUG_INFO_SIZE - used);
used += Uint64ToString(buf + used, DEBUG_INFO_SIZE - used,
shared->recovery_reason, 16, 2);
+ used += StrnAppend(buf + used, " / 0x", DEBUG_INFO_SIZE - used);
+ used += Uint64ToString(buf + used, DEBUG_INFO_SIZE - used, i, 16, 2);
used += StrnAppend(buf + used, " ", DEBUG_INFO_SIZE - used);
used += StrnAppend(buf + used,
RecoveryReasonString(shared->recovery_reason),