summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2021-06-10 11:51:46 -0600
committerCommit Bot <commit-bot@chromium.org>2021-06-10 19:54:51 +0000
commit9f9753d665987cc42a4ca2fe496f6e9d58c91be8 (patch)
treea80d5d15f946d62a2340a82d793710666e072de8
parente9399b9b4e00f3ab1ab09eeee62e3044725e5980 (diff)
downloadchrome-ec-stabilize-14029.B-cr50_stab.tar.gz
gsctool: add --dauntless flag and default to havenstabilize-14029.B-cr50_stab
For commands that do not take in an image, we cannot tell if we are communicating with a haven or dauntless chip automatically. Add a way to specify if we are communicating with a dauntless chip. Default to haven if the optional --dauntless flag is not present BUG=b:190659004 TEST=execute `gsctool -I` on haven chip and see success TEST=execute `gsctool -I --dauntless` on haven chip and see failure that it cannot find device with dauntless VID:PID Change-Id: Ia92422846d283eba5b27cfaa130c782f13af90ca Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2952837 Commit-Queue: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index 3ab7e5f51c..62c1cff112 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -269,8 +269,11 @@ static const struct option_container cmd_line_options[] = {
"RW and RO headers, do not update"},
{{"corrupt", no_argument, NULL, 'c'},
"Corrupt the inactive rw"},
+ {{"dauntless", no_argument, NULL, 'D'},
+ "Communicate with Dauntless chip. This may be implied or overridden by"
+ " --image flag values"},
{{"device", required_argument, NULL, 'd'},
- " VID:PID%USB device (default 18d1:5014 or 18d1:504a based on image)"},
+ "VID:PID%USB device (default 18d1:5014 or 18d1:504a based on image)"},
{{"endorsement_seed", optional_argument, NULL, 'e'},
"[state]%get/set the endorsement key seed"},
{{"fwver", no_argument, NULL, 'f'},
@@ -2993,6 +2996,7 @@ int main(int argc, char *argv[])
int sn_inc_rma = 0;
uint8_t sn_inc_rma_arg;
int erase_ap_ro_hash = 0;
+ int is_dauntless = 0;
/*
* All options which result in setting a Boolean flag to True, along
@@ -3001,6 +3005,7 @@ int main(int argc, char *argv[])
const struct options_map omap[] = {
{ 'b', &binary_vers },
{ 'c', &corrupt_inactive_rw },
+ { 'D', &is_dauntless },
{ 'f', &show_fw_ver },
{ 'g', &get_boot_mode},
{ 'H', &erase_ap_ro_hash},
@@ -3187,6 +3192,13 @@ int main(int argc, char *argv[])
if (errorcnt)
usage(errorcnt);
+ /*
+ * If dauntless was explicitly asked for, then use it; otherwise default
+ * to haven. Note this may get overridden if the --image flag specifies
+ * a dauntless or haven image.
+ */
+ image_magic = is_dauntless ? MAGIC_DAUNTLESS : MAGIC_HAVEN;
+
if ((bid_action == bid_none) &&
!ccd_info &&
!ccd_lock &&