summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2018-04-19 07:33:28 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-23 18:09:16 -0700
commitb40f6e5939826d88421620a5b34f8444ea202193 (patch)
tree63fc9dc4456f22f53459f35c402835983e1cdb30 /util
parentfb712058eec77db78e5355bd1cfab9297570fab5 (diff)
downloadchrome-ec-b40f6e5939826d88421620a5b34f8444ea202193.tar.gz
flash_ec: For npcx_uut, use servo to boot EC into the flashing mode
Use servo to boot EC into the flashing mode. Use the unified control ec_boot_mode to do so. CQ-DEPEND=CL:1018206 BRANCH=none BUG=b:68707064 TEST=Ran the flash_ec script on Cheza using servo-micro TEST=Ran the flash_ec script on Meowth using CCD, with some servo overlays to drive the ccd_ec_boot_mode control Change-Id: I32dfe5baa82dd842b5237f38ea971c09e91c47d3 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/1020159 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/flash_ec16
1 files changed, 16 insertions, 0 deletions
diff --git a/util/flash_ec b/util/flash_ec
index d5e922b1da..cf4356f27e 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -513,6 +513,11 @@ fi
if $(in_array "${BOARDS_STM32_PROG_EN[@]}" "${BOARD}"); then
servo_v2_VARS+=" prog_en"
fi
+if [ "${CHIP}" = "npcx_uut" ] ; then
+ servo_v2_VARS+=" ${MCU}_boot_mode"
+ servo_micro_VARS+=" ${MCU}_boot_mode"
+ servo_v4_with_ccd_cr50_VARS+=" ccd_${MCU}_boot_mode ccd_keepalive_en"
+fi
toad_VARS="${MCU}_uart_parity ${MCU}_uart_baudrate boot_mode"
if $(in_array "${BOARDS_NPCX_INT_SPI[@]}" "${BOARD}"); then
@@ -944,6 +949,17 @@ function flash_npcx_uut() {
info "${MCU} UART pty : ${EC_UART}"
claim_pty ${EC_UART}
+ if [[ "${SERVO_TYPE}" =~ "ccd_cr50" ]] ; then
+ dut_control ccd_keepalive_en:on
+ fi
+
+ # Force the EC to boot in UART update mode
+ ec_enable_boot0
+ ec_reset
+
+ # Have to wait a bit for EC boot-up
+ sleep 0.1
+
# Remove the prefix "/dev/" because uartupdatetool will add it.
EC_UART=${EC_UART#/dev/}
MON_PARAMS="--port ${EC_UART} --baudrate 115200"