From 5550ae7f8d1c34ff9f15bab0d54cb87e4059c9be Mon Sep 17 00:00:00 2001 From: Jett Rink Date: Thu, 10 May 2018 15:35:07 -0600 Subject: bip: update flash script to use dut_i2c_mux Bip has an I2C mux that we need to set before we can program the ITE8320 chip. Set the dut's i2c mux to pass through to the EC. BRANCH=none BUG=b:79533605 TEST=flash bip and reef_it8320 CQ-DEPEND=CL:1054559 Change-Id: I690aa253c757c37dfb276d5be897b92a9aa1545e Signed-off-by: Jett Rink Reviewed-on: https://chromium-review.googlesource.com/1054560 Reviewed-by: Furquan Shaikh Reviewed-by: Nick Sanders --- util/flash_ec | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/util/flash_ec b/util/flash_ec index a011c4b251..593a4ede1e 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -410,6 +410,20 @@ cleanup() { dut_control --ftdii2c init dut_control --ftdii2c open dut_control --ftdii2c setclock + + # Reset the dut mux if it exists + if dut_control -i dut_i2c_mux 2>/dev/null; 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 + + # Turn off dut i2c mux + dut_control dut_i2c_mux:none + + # Turn off servo i2c mux + dut_control i2c_mux_en:off + fi + fi if [[ "${SERVO_TYPE}" =~ "ccd_cr50" ]] ; then dut_control ccd_ec_boot_mode_uut:off @@ -883,6 +897,13 @@ function flash_it83xx() { dut_control i2c_mux_en:on dut_control i2c_mux:remote_adc + # 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 + dut_control dut_i2c_mux:ec_prog + fi + info "Close connection to ftdi_i2c interface" dut_control --ftdii2c close -- cgit v1.2.1