From b40f6e5939826d88421620a5b34f8444ea202193 Mon Sep 17 00:00:00 2001 From: Wai-Hong Tam Date: Thu, 19 Apr 2018 07:33:28 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/1020159 Reviewed-by: Alexandru M Stan --- util/flash_ec | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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"