diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2017-11-21 17:50:38 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-12-07 01:00:42 +0000 |
commit | b1dcbe77404d7943f99251f659a5526b4ff50e1b (patch) | |
tree | dd9985611053ab8d0d4b655e1ab4c26ac8ff1ca0 | |
parent | c41791abf3d3ea614e57f67e5b481bd3f4574e7b (diff) | |
download | chrome-ec-b1dcbe77404d7943f99251f659a5526b4ff50e1b.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>
(cherry picked from commit 84b20f922533b5b1d282fcfc323400b0eec0db27)
Reviewed-on: https://chromium-review.googlesource.com/813081
-rw-r--r-- | extra/usb_updater/gsctool.c | 18 |
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); |