diff options
author | Ting Shen <phoenixshen@google.com> | 2021-01-06 16:19:12 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-07 05:38:04 +0000 |
commit | adab8866aa7e895ea95d335120c9e6253836a179 (patch) | |
tree | e4d7903b597f6d86e35c667bc6a51bba187ba53e /util | |
parent | 6f626a65226c68ec8ffd3de0445af614adc82afb (diff) | |
download | chrome-ec-adab8866aa7e895ea95d335120c9e6253836a179.tar.gz |
flash_it83xx: implement --noverify
Support --noverify to speed up flashing. Note that --noverify is enabled
by default in flash_ec script, so people need to add --verify explicitly
to back to the old behavior.
This reduces ~20% time on my machine (7m45s -> 5m50s).
BUG=None
TEST=manually, Verify the line "Verify 1048576 bytes at 0x00000000"
disappeared.
BRANCH=main
Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: Ia9e15a2f7221bd0af6da55de0bf90938a7afedeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2612688
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-x | util/flash_ec | 4 | ||||
-rw-r--r-- | util/iteflash.c | 15 |
2 files changed, 16 insertions, 3 deletions
diff --git a/util/flash_ec b/util/flash_ec index 2b422e78ad..8497331256 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -1300,6 +1300,10 @@ function flash_it83xx() { ERROR_MSG="${MSG_PROGRAM_FAIL}" fi + if [[ "${FLAGS_verify}" == "${FLAGS_FALSE}" ]]; then + ITEFLASH_ARGS+=( "--noverify" ) + fi + if [[ "${FLAGS_verbose}" == ${FLAGS_TRUE} ]]; then ITEFLASH_ARGS+=( "--debug" ) echo "${ITEFLASH_ARGS[@]}" diff --git a/util/iteflash.c b/util/iteflash.c index 8b85482340..73dfc4e00b 100644 --- a/util/iteflash.c +++ b/util/iteflash.c @@ -118,6 +118,7 @@ struct iteflash_config { int usb_interface; int usb_vid; int usb_pid; + int verify; /* boolean */ char *usb_serial; char *i2c_dev_path; const struct i2c_interface *i2c_if; @@ -2057,6 +2058,7 @@ static const struct option longopts[] = { {"interface", 1, 0, 'i'}, {"nodisable-protect-path", 0, 0, 'Z'}, {"nodisable-watchdog", 0, 0, 'z'}, + {"noverify", 0, 0, 'n'}, {"product", 1, 0, 'p'}, {"range", 1, 0, 'R'}, {"read", 1, 0, 'r'}, @@ -2086,6 +2088,7 @@ static void display_usage(const char *program) fprintf(stderr, "-m, --i2c-mux : Enable i2c-mux (to EC).\n" "\tSpecify this flag only if the board has an I2C MUX and\n" "\tyou are not using servod.\n"); + fprintf(stderr, "-n, --noverify : Don't auto verify.\n"); fprintf(stderr, "-b, --block-write-size <size> : Perform writes in\n" "\tblocks of this many bytes.\n"); fprintf(stderr, "-p, --product <0x1234> : USB product ID\n"); @@ -2190,6 +2193,9 @@ static int parse_parameters(int argc, char **argv, struct iteflash_config *conf) case 'm': conf->i2c_mux = 1; break; + case 'n': + conf->verify = 0; + break; case 'p': conf->usb_pid = strtol(optarg, NULL, 16); break; @@ -2271,6 +2277,7 @@ int main(int argc, char **argv) .usb_interface = SERVO_INTERFACE, .usb_vid = SERVO_USB_VID, .usb_pid = SERVO_USB_PID, + .verify = 1, .i2c_if = &ftdi_i2c_interface, }, }; @@ -2380,9 +2387,11 @@ int main(int argc, char **argv) ret = write_flash(&chnd, chnd.conf.output_filename, 0); if (ret) goto return_after_init; - ret = verify_flash(&chnd, chnd.conf.output_filename, 0); - if (ret) - goto return_after_init; + if (chnd.conf.verify) { + ret = verify_flash(&chnd, chnd.conf.output_filename, 0); + if (ret) + goto return_after_init; + } } /* Normal exit */ |