From c4387539f6d3a58fb1ef5f6fb1d8deb12f8f9d7e Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Tue, 15 May 2018 17:43:34 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/1060589 Reviewed-by: Aaron Durbin --- util/flash_ec | 12 ++++++++---- 1 file 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 -- cgit v1.2.1