summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Cheng <kevcheng@chromium.org>2016-08-01 15:15:46 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-08-22 14:52:24 -0700
commit0f5f4862e2548157c715c25550dee661fef12d7e (patch)
tree4d0af832209f5502d1a2afcb507216f669c476ed
parent746eb2c600248504ad030bfba1fad6ae431c254e (diff)
downloadchrome-ec-0f5f4862e2548157c715c25550dee661fef12d7e.tar.gz
flash_ec: Add check for servo_has_cold_reset.
When flashing a servo v4, the function will try to initiate a cold_reset but that interface does not exist for a servo v4. Add in a check for cold_reset before trying an ec_reset to prevent printing the useless error message 'No control named "cold_reset"'. BRANCH=None BUG=None TEST=flashed and did not see error message anymore. Change-Id: I6086883f002b4961807ae0663b0ee32aea4c63d8 Reviewed-on: https://chromium-review.googlesource.com/365151 Commit-Ready: Kevin Cheng <kevcheng@chromium.org> Tested-by: Kevin Cheng <kevcheng@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
-rwxr-xr-xutil/flash_ec8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/flash_ec b/util/flash_ec
index f662e236f6..284ab4c1fd 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -212,6 +212,10 @@ servo_has_warm_reset() {
dut_control warm_reset >/dev/null 2>&1
}
+servo_has_cold_reset() {
+ dut_control cold_reset >/dev/null 2>&1
+}
+
# reset the EC
toad_ec_hard_reset() {
if dut_control cold_reset 2>/dev/null ; then
@@ -544,7 +548,9 @@ function flash_stm32() {
# Force the EC to boot in serial monitor mode
ec_enable_boot0
# Reset the EC
- ec_reset
+ if $(servo_has_cold_reset); then
+ ec_reset
+ fi
# Unprotect flash, erase, and write
timeout -k 10 -s 9 "${FLAGS_timeout}" \
${STM32MON} -d ${EC_UART} -U -u -e -w "${IMG}"