From ec8b4d1de8e60d3482594ffdf19279051b880251 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Wed, 3 Oct 2018 14:08:35 -0700 Subject: iteflash: do not erase by default It could be beneficial to be able to write flash without erasing it explicitly, for instance when programming a brand new chip, or when testing modifications of the iteflash utility. This patch makes sure that flash is erased only if '-e' command line parameter is present. The only place this utility is used by a script in Chrome OS codebase is flash_ec, it is being updated to maintain current behavior. BRANCH=none BUG=none TEST=verified that running $ make BOARD=dragonegg -j $ ./util/flash_ec --board=dragonegg still succeeds when servod is running and the DUT is connected through the servo-v2 board. Change-Id: Ic238b895ff3324cf8c646908610ea3103d2b78c7 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/1266675 Reviewed-by: Jett Rink --- util/flash_ec | 2 +- util/iteflash.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/flash_ec b/util/flash_ec index dc2f462947..4f63aefaa1 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -1033,7 +1033,7 @@ function flash_it83xx() { dut_control ftdii2c_cmd:close info "Run iteflash..." - sudo ${ITEFLASH} -w ${IMG} + sudo ${ITEFLASH} -e -w ${IMG} } function flash_lm4() { diff --git a/util/iteflash.c b/util/iteflash.c index bdbdf757f1..d0c79fa0cb 100644 --- a/util/iteflash.c +++ b/util/iteflash.c @@ -1583,7 +1583,7 @@ int main(int argc, char **argv) goto terminate; } - if (flags & FLAG_ERASE || output_filename) { + if (flags & FLAG_ERASE) { if (is8320dx) /* Do Normal Erase Function */ command_erase2(&chnd, flash_size, 0, 0); -- cgit v1.2.1