summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Moragues <moragues@google.com>2018-10-25 18:00:17 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-30 20:59:49 -0700
commit9a74f9714e891ba7d5c2b0175aad6daefb9165da (patch)
tree8a188c5dfa415e2404669f604f75b7628a4a395f
parent5e6f10ed2f78b644371abb38e2e1f9a5124bc288 (diff)
downloadchrome-ec-9a74f9714e891ba7d5c2b0175aad6daefb9165da.tar.gz
gsctool: Add options to print out RLZ codes
This RLZ code is used by cr50-verify-ro.sh. The RLZ code selects the verify_ro db to use. BUG=b:90495590 BRANCH=none TEST=gsctool -i -M; gsctool -i -M -t Unit Test Rewults: localhost ~ # gsctool -i -M open_device 18d1:5014 found interface 3 endpoint 4, chunk_len 64 READY ------- BID_TYPE=4e425153 BID_TYPE_INV=b1bdaeac BID_FLAGS=00007f7f BID_RLZ=NBQS <-- CORRECT DUT RLZ localhost ~ # gsctool -i -M -t BID_TYPE=58574a45 BID_TYPE_INV=a7a8b5ba BID_FLAGS=00007f7f BID_RLZ=XWJE <-- CORRECT Test Device RLZ localhost ~ # Change-Id: I12fbca6885e3a1453544a1d379ad12ef3f6fd290 Signed-off-by: Bob Moragues <moragues@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1297034 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Nick Sanders <nsanders@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index 0f8c9a46c6..394851c9e9 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -1813,11 +1813,27 @@ void process_bid(struct transfer_descriptor *td,
print_machine_output(
"BID_FLAGS", "%08x", be32toh(bid->flags));
+ for (int i = 0; i < 4; i++) {
+ if (!isupper(((const char *)bid)[i])) {
+ print_machine_output(
+ "BID_RLZ", "%s", "????");
+ return;
+ }
+ }
+
+ print_machine_output(
+ "BID_RLZ", "%c%c%c%c",
+ ((const char *)bid)[0],
+ ((const char *)bid)[1],
+ ((const char *)bid)[2],
+ ((const char *)bid)[3]);
} else {
- printf("Board ID space: %08x:%08x:%08x\n",
- be32toh(bid->type),
- be32toh(bid->type_inv),
- be32toh(bid->flags));
+ if (bid_action == bid_get) {
+ printf("Board ID space: %08x:%08x:%08x\n",
+ be32toh(bid->type),
+ be32toh(bid->type_inv),
+ be32toh(bid->flags));
+ }
}
return;