summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-05-15 17:43:34 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-23 16:47:47 -0700
commitc4387539f6d3a58fb1ef5f6fb1d8deb12f8f9d7e (patch)
tree646f7f2253c281a9fe36e5609f0269e44f7d82a8
parent36d59f752fb7526bcfac74c567593c05c97b6f10 (diff)
downloadchrome-ec-c4387539f6d3a58fb1ef5f6fb1d8deb12f8f9d7e.tar.gz
cleanup: make has_dut_i2c_mux check similar to other checks
BRANCH=none BUG=none TEST=flash on bip using new check Change-Id: I32266554e090c80bdd9078c06cfa78512d5965ea Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1060589 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rwxr-xr-xutil/flash_ec12
1 files changed, 8 insertions, 4 deletions
diff --git a/util/flash_ec b/util/flash_ec
index 2260b53674..c14911ed90 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -281,11 +281,15 @@ if [ "${CHIP}" = "stm32_dfu" -o "${CHIP}" = "it83xx" ]; then
fi
servo_has_warm_reset() {
- dut_control warm_reset >/dev/null 2>&1
+ dut_control -i warm_reset >/dev/null 2>&1
}
servo_has_cold_reset() {
- dut_control cold_reset >/dev/null 2>&1
+ dut_control -i cold_reset >/dev/null 2>&1
+}
+
+servo_has_dut_i2c_mux() {
+ dut_control -i dut_i2c_mux >/dev/null 2>&1
}
# reset the EC
@@ -412,7 +416,7 @@ cleanup() {
dut_control --ftdii2c setclock
# Reset the dut mux if it exists
- if dut_control -i dut_i2c_mux 2>/dev/null; then
+ if $(servo_has_dut_i2c_mux); then
# Ensure servo i2c mux is on so we can talk to dut
dut_control i2c_mux_en:on
dut_control i2c_mux:remote_adc
@@ -904,7 +908,7 @@ function flash_it83xx() {
# Now the we have enabled the I2C mux on the servo to talk to the dut,
# we need to switch the I2C mux on the dut to allow ec programing (if
# there is a mux on the dut)
- if dut_control -i dut_i2c_mux 2>/dev/null; then
+ if $(servo_has_dut_i2c_mux); then
dut_control dut_i2c_mux:ec_prog
fi