summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2018-10-03 12:21:24 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-04 17:09:10 -0700
commit27fcbd8d998e21b5bcb4250b4a1ea72c27f15944 (patch)
tree00b2bed6d39b0a8ccfddb0ce06c298aa8e09b01e
parentf188caf7a5b4f08d1e7e1a4a5fd847d7f9897e36 (diff)
downloadchrome-ec-27fcbd8d998e21b5bcb4250b4a1ea72c27f15944.tar.gz
flash_ec: Disable the flashing-mode trigger for normal UART operation
On some recent hardware, the flashing-mode trigger for CCD UUT mode, i.e. UART_EC_TX_H1_RX, affects UART operation when it is grounded. Should disable it, back to high-Z, for UART flashing. BRANCH=none BUG=b:117226655 TEST=Run flash_ec script over CCD and servo. Change-Id: I48e7d6c4142ede13da0911bf99b2f3081ff864b2 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1259386 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
-rwxr-xr-xutil/flash_ec36
1 files changed, 28 insertions, 8 deletions
diff --git a/util/flash_ec b/util/flash_ec
index 069eeb95a5..dc2f462947 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -413,27 +413,28 @@ ec_reset() {
# force the EC to boot in serial monitor mode
toad_ec_boot0() {
- dut_control boot_mode:yes
+ dut_control boot_mode:$1
}
ccd_ec_boot0() {
- info "Using CCD $1."
- dut_control ccd_ec_boot_mode_$1:on
+ info "Using CCD $2."
+ dut_control ccd_ec_boot_mode_$2:$1
}
servo_ec_boot0() {
- dut_control ec_boot_mode:on
+ dut_control ec_boot_mode:$1
}
servo_usbpd_boot0() {
- dut_control usbpd_boot_mode:on
+ dut_control usbpd_boot_mode:$1
}
servo_sh_boot0() {
- dut_control sh_boot_mode:on
+ dut_control sh_boot_mode:$1
}
-ec_enable_boot0() {
+ec_switch_boot0() {
+ on_value=$1
# Enable programming GPIOs
if $(in_array "${BOARDS_STM32_PROG_EN[@]}" "${BOARD}"); then
dut_control prog_en:yes
@@ -444,8 +445,23 @@ ec_enable_boot0() {
stype=servo
else
stype=${SERVO_TYPE}
+ if [[ "${SERVO_TYPE}" =~ "toad" ]] ; then
+ if [[ "${on_value}" == "on" ]] ; then
+ on_value="yes"
+ else
+ on_value="no"
+ fi
+ fi
fi
- eval ${stype}_${MCU}_boot0 $1
+ eval ${stype}_${MCU}_boot0 "${on_value}" $2
+}
+
+ec_enable_boot0() {
+ ec_switch_boot0 "on" $1
+}
+
+ec_disable_boot0() {
+ ec_switch_boot0 "off" $1
}
# Returns 0 on success (if on beaglebone)
@@ -1095,6 +1111,10 @@ function flash_npcx_uut() {
# Have to wait a bit for EC boot-up
sleep 0.1
+ # For CCD, disable the trigger pin for normal UART operation
+ ec_disable_boot0 "uut"
+ sleep 0.1
+
# Remove the prefix "/dev/" because uartupdatetool will add it.
EC_UART=${EC_UART#/dev/}
UUT_PARAMS="--port ${EC_UART} --baudrate 115200"