summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-11-21 17:50:38 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-28 15:44:16 -0800
commit84b20f922533b5b1d282fcfc323400b0eec0db27 (patch)
treedc4a711e63ed77d0bee4f0750844ac0fef513e79
parentbaff7ae621d88929c0ab808eee54c081e44b2710 (diff)
downloadchrome-ec-84b20f922533b5b1d282fcfc323400b0eec0db27.tar.gz
gsctool: add option to disable RMA mode
The --rma_auth command line option is being extended to treat the auth_code of value of 'disable' as a user request to cancel CCD RMA mode on the device. BRANCH=none BUG=b:68213540 TEST=verified that passing '-f disable' to gsctool causes CCD state on the Cr50 changed to 'Locked' Change-Id: I8764e0207977a6290d3d10dc4678f98631be0360 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/784354 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index 4fb2e5c110..ab76199531 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -549,9 +549,9 @@ static void usage(int errs)
" Set or clear CCD password. Use\n"
" 'clear' to clear it.\n"
" -p,--post_reset Request post reset after transfer\n"
- " -r,--rma_auth [auth_code]\n"
- " Request RMA challenge or process "
- "RMA authentication code\n"
+ " -r,--rma_auth [[auth_code|\"disable\"]\n"
+ " Request RMA challenge, process "
+ "RMA authentication code or disable RMA state\n"
" -s,--systemdev Use /dev/tpm0 (-d is ignored)\n"
" -t,--trunks_send Use `trunks_send --raw' "
"(-d is ignored)\n"
@@ -1698,6 +1698,18 @@ static void process_rma(struct transfer_descriptor *td, const char *authcode)
return;
}
+ if (!strcmp(authcode, "disable")) {
+ printf("Disabling RMA mode\n");
+ send_vendor_command(td, VENDOR_CC_DISABLE_RMA, NULL, 0,
+ rma_response, &response_size);
+ if (response_size) {
+ fprintf(stderr, "Failed disabling RMA, error %d\n",
+ rma_response[0]);
+ exit(update_error);
+ }
+ return;
+ }
+
printf("Processing response...");
auth_size = strlen(authcode);
response_size = sizeof(rma_response);