diff options
author | Mary Ruthven <mruthven@chromium.org> | 2022-07-28 09:43:22 -0500 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-18 21:32:13 +0000 |
commit | e35f5d208df8dfc2f9fc6badb8bb419794f140c2 (patch) | |
tree | cd9e7317ce82794daef9fafa0eeefaa0008a3443 | |
parent | caf0666a392c3601ec79e324d52187e17abbae61 (diff) | |
download | chrome-ec-e35f5d208df8dfc2f9fc6badb8bb419794f140c2.tar.gz |
apro: add new return codes (take two)
Add new ap_ro_integrity_check return codes. The existing AP_RO_PASS (1)
return code doesn't verify the GBB. Rename it to
AP_RO_PASS_UNVERIFIED_GBB. Shimless RMA should only treat
AP_RO_PASS (6) as a pass. Nothing returns this right now.
This CL also adds AP_RO_IN_PROGRESS(7). AP_RO_IN_PROGRESS is used if AP
RO verification is ongoing. AP_RO_FAIL_CLEARED will be used in a
followup CL.
old:
1 - AP_RO_PASS
new:
1 - AP_RO_PASS_UNVERIFIED_GBB
...
6 - AP_RO_PASS
7 - AP_RO_IN_PROGRESS
This saves 8 bytes since it also shortens a print message. The remaining
space changes from 5804 to 5812 bytes.
BUG=b:234497234
TEST=make buildall -j; make -C extra/usb_updater/ gsctool
Change-Id: I9f8b45f5564d453cbb4386b318b65d977d8b3f73
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3828596
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | common/ap_ro_integrity_check.c | 8 | ||||
-rw-r--r-- | extra/usb_updater/gsctool.c | 6 | ||||
-rw-r--r-- | include/ap_ro_integrity_check.h | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/common/ap_ro_integrity_check.c b/common/ap_ro_integrity_check.c index 8c12e851a4..44d7145b4f 100644 --- a/common/ap_ro_integrity_check.c +++ b/common/ap_ro_integrity_check.c @@ -497,7 +497,8 @@ static int verify_keyblock(const struct kb_container *kbc, /* Clear validate_ap_ro_boot state. */ void ap_ro_device_reset(void) { - if (apro_result == AP_RO_NOT_RUN || ec_rst_override()) + if (apro_result == AP_RO_NOT_RUN || apro_result == AP_RO_IN_PROGRESS || + ec_rst_override()) return; CPRINTS("%s: clear apro result", __func__); apro_result = AP_RO_NOT_RUN; @@ -1419,6 +1420,7 @@ static uint8_t do_ap_ro_check(void) enum ap_ro_check_vc_errors support_status; bool v1_record_found; + apro_result = AP_RO_IN_PROGRESS; support_status = ap_ro_check_unsupported(true); if ((support_status == ARCVE_BOARD_ID_BLOCKED) || (support_status == ARCVE_FLASH_READ_FAILED)) { @@ -1483,9 +1485,9 @@ static uint8_t do_ap_ro_check(void) return EC_ERROR_UNIMPLEMENTED; } - apro_result = AP_RO_PASS; + apro_result = AP_RO_PASS_UNVERIFIED_GBB; ap_ro_add_flash_event(APROF_CHECK_SUCCEEDED); - CPRINTS("AP RO verification SUCCEEDED!"); + CPRINTS("AP RO PASS!"); release_ec_reset_override(); return EC_SUCCESS; diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c index 64a7853d31..04432462eb 100644 --- a/extra/usb_updater/gsctool.c +++ b/extra/usb_updater/gsctool.c @@ -2358,6 +2358,9 @@ static int process_get_apro_boot_status(struct transfer_descriptor *td) case AP_RO_PASS: printf("pass\n"); break; + case AP_RO_PASS_UNVERIFIED_GBB: + printf("pass - unverified gbb!\n"); + break; case AP_RO_FAIL: printf("FAIL\n"); break; @@ -2370,6 +2373,9 @@ static int process_get_apro_boot_status(struct transfer_descriptor *td) case AP_RO_UNSUPPORTED_NOT_TRIGGERED: printf("not supported\ntriggered: no\n"); break; + case AP_RO_IN_PROGRESS: + printf("in progress."); + break; default: fprintf(stderr, "unknown status\n"); return update_error; diff --git a/include/ap_ro_integrity_check.h b/include/ap_ro_integrity_check.h index 38e4c57ff4..cb01017dcc 100644 --- a/include/ap_ro_integrity_check.h +++ b/include/ap_ro_integrity_check.h @@ -10,11 +10,13 @@ enum ap_ro_status { AP_RO_NOT_RUN = 0, - AP_RO_PASS, + AP_RO_PASS_UNVERIFIED_GBB, AP_RO_FAIL, AP_RO_UNSUPPORTED_UNKNOWN, /* Deprecated */ AP_RO_UNSUPPORTED_NOT_TRIGGERED, AP_RO_UNSUPPORTED_TRIGGERED, + AP_RO_PASS, + AP_RO_IN_PROGRESS, }; /* * validate_ap_ro: based on information saved in an H1 RO flash page verify |