summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2019-08-07 14:14:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-08-13 13:04:42 -0700
commit95d43c00aeead373dca72c814bd6109b39668386 (patch)
tree051ab2570ecec396a66416be1600e1799d7b4dd0
parent2d43cd05ccae236650f3d69566c9ec33098c0d02 (diff)
downloadchrome-ec-95d43c00aeead373dca72c814bd6109b39668386.tar.gz
gsctool: print devid in image version output
If the image is node locked to a devid, print that information in the '-b' output. BUG=none BRANCH=none TEST=get version output of node locked and prod signed image. Change-Id: I0db2828d7bd699013ec84467c7e2a4b918bd7b27 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1742913 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index c342a1eb25..4b2d207a85 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -1454,6 +1454,10 @@ static int show_headers_versions(const void *image, bool show_machine_output)
char ro_fw_ver[kNumSlots][MAX_FW_VER_LENGTH];
char rw_fw_ver[kNumSlots][MAX_FW_VER_LENGTH];
+ uint32_t dev_id0_[kNumSlots];
+ uint32_t dev_id1_[kNumSlots];
+ uint32_t print_devid = 0;
+
struct board_id {
uint32_t id;
uint32_t mask;
@@ -1494,6 +1498,11 @@ static int show_headers_versions(const void *image, bool show_machine_output)
h->board_id_type_mask ^ SIGNED_HEADER_PADDING;
bid[slot_idx].flags = h->board_id_flags ^ SIGNED_HEADER_PADDING;
+ dev_id0_[slot_idx] = h->dev_id0_;
+ dev_id1_[slot_idx] = h->dev_id1_;
+ /* Print the devid if any slot has a non-zero devid. */
+ print_devid |= h->dev_id0_ | h->dev_id1_;
+
/*
* If board ID is a 4-uppercase-letter string (as it ought to
* be), print it as 4 letters, otherwise print it as an 8-digit
@@ -1527,6 +1536,21 @@ static int show_headers_versions(const void *image, bool show_machine_output)
printf("RO_B:%s RW_B:%s[%s:%08x:%08x]\n",
ro_fw_ver[1], rw_fw_ver[1],
bid_string[1], bid[1].mask, bid[1].flags);
+
+ if (print_devid) {
+ printf("DEVID: 0x%08x 0x%08x", dev_id0_[0],
+ dev_id1_[0]);
+ /*
+ * Only print the second devid if it's different.
+ * Separate the devids with tabs, so it's easier to
+ * read.
+ */
+ if (dev_id0_[0] != dev_id0_[1] ||
+ dev_id1_[0] != dev_id1_[1])
+ printf("\t\t\t\tDEVID_B: 0x%08x 0x%08x",
+ dev_id0_[1], dev_id1_[1]);
+ printf("\n");
+ }
}
return 0;