diff options
author | Randall Spangler <rspangler@chromium.org> | 2014-06-24 15:31:04 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-06-28 00:56:17 +0000 |
commit | 9e1da784487fb8cfbe4e76693e07205b66675bda (patch) | |
tree | 9beada3e8c3667c27765702708b537aaa76d5062 /firmware/include | |
parent | d11086caf05c692815ae6f90aa83a4fc30d50ed7 (diff) | |
download | vboot-9e1da784487fb8cfbe4e76693e07205b66675bda.tar.gz |
Add nvstorage / crossystem support for new vboot2 fields
This allows testing vboot2. These fields are ignored by original
vboot firmware.
BUG=chromium:370082
BRANCH=none
TEST=manual
crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=A
crossystem fw_tried=B
echo $? -> 1
crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=A
crossystem fw_try_next=B
crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=B
crossystem fw_try_next=beats_me
echo $? -> 1
crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=B
crossystem fw_try_next=A
crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=A
crossystem fw_result=trying
crossystem -> fw_tried=A, fw_result=trying, fw_try_next=A
crossystem fw_result=bupkis
echo $? -> 1
crossystem -> fw_tried=A, fw_result=trying, fw_try_next=A
crossystem fw_result=success
crossystem -> fw_tried=A, fw_result=success, fw_try_next=A
crossystem fw_result=failure
crossystem -> fw_tried=A, fw_result=failure, fw_try_next=A
crossystem fw_result=unknown
crossystem -> fw_tried=A, fw_result=unknown, fw_try_next=A
crossystem -> fw_try_count = 0, fwb_tries = 0
crossystem fw_try_count=6
crossystem -> fw_try_count = 6, fwb_tries = 6
crossystem fwb_tries=0
crossystem -> fw_try_count = 0, fwb_tries = 0
Change-Id: I1532f3384f8c05de2a7ff3f35abcc35d18049491
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/205475
Diffstat (limited to 'firmware/include')
-rw-r--r-- | firmware/include/vboot_nvstorage.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/firmware/include/vboot_nvstorage.h b/firmware/include/vboot_nvstorage.h index 534fb7e4..0a9a4841 100644 --- a/firmware/include/vboot_nvstorage.h +++ b/firmware/include/vboot_nvstorage.h @@ -45,8 +45,14 @@ typedef enum VbNvParam { /* * Number of times to try booting RW firmware slot B before slot A. * Valid range: 0-15. + * + * Vboot2: Number of times to try the firmware in VBNV_FW_TRY_NEXT. + * + * These refer to the same field, but have different enum values so + * case statement don't complain about duplicates. */ VBNV_TRY_B_COUNT, + VBNV_FW_TRY_COUNT, /* * Request recovery mode on next boot; see VBNB_RECOVERY_* below for * currently defined reason codes. 8-bit value. @@ -85,8 +91,33 @@ typedef enum VbNvParam { VBNV_RECOVERY_SUBCODE, /* Request that NVRAM be backed up at next boot if possible. */ VBNV_BACKUP_NVRAM_REQUEST, + + /* Vboot2: Firmware slot to try next. 0=A, 1=B */ + VBNV_FW_TRY_NEXT, + /* Vboot2: Firmware slot tried this boot (0=A, 1=B) */ + VBNV_FW_TRIED, + /* Vboot2: Result of trying that firmware (see vb2_fw_result) */ + VBNV_FW_RESULT, + + } VbNvParam; +/* Result of trying the firmware in VBNV_FW_TRIED */ +typedef enum VbFwResult { + /* Unknown */ + VBNV_FW_RESULT_UNKNOWN = 0, + + /* Trying a new slot, but haven't reached success/failure */ + VBNV_FW_RESULT_TRYING = 1, + + /* Successfully booted to the OS */ + VBNV_FW_RESULT_SUCCESS = 2, + + /* Known failure */ + VBNV_FW_RESULT_FAILURE = 3, + +} VbFwResult; + /* Recovery reason codes for VBNV_RECOVERY_REQUEST */ /* Recovery not requested. */ #define VBNV_RECOVERY_NOT_REQUESTED 0x00 |