summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2018-10-03 14:08:35 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-08 22:23:18 -0700
commitec8b4d1de8e60d3482594ffdf19279051b880251 (patch)
tree728324f854336dff49a209905b21fdac64652dba
parentb7288876ac2500d50a49d925833382be6f1eb5fc (diff)
downloadchrome-ec-ec8b4d1de8e60d3482594ffdf19279051b880251.tar.gz
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 <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1266675 Reviewed-by: Jett Rink <jettrink@chromium.org>
-rwxr-xr-xutil/flash_ec2
-rw-r--r--util/iteflash.c2
2 files changed, 2 insertions, 2 deletions
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);