diff options
author | Wai-Hong Tam <waihong@google.com> | 2017-11-06 11:26:25 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-11-06 17:26:16 -0800 |
commit | fca1b7b710898ff347465d839c14164d610f140d (patch) | |
tree | 0da058d8d7158d05c65df0d312f34148f0b0720c | |
parent | f48cf0e8b27fb484271540e4cc272aea581a3b48 (diff) | |
download | chrome-ec-fca1b7b710898ff347465d839c14164d610f140d.tar.gz |
flash_ec: Set NEED_SERVO according to chip name instead of board name
One can pass either a board name (e.g. hammer) or a chip name (stm32)
to the flash_ec command. If given a board name, will map to a proper
chip name and then call its chip-flashing method.
The NEED_SERVO variable ("no" if servo not needed) was set according
to the board name. It was broken if only given a chip name. It should
be set according to the chip name.
BUG=b:68943874
BRANCH=None
TEST=Flashed the Staff firmware
SERVO $ dut-control ec_boot_mode:on
DUT $ ectool gpioset PP3300_DX_BASE 0
DUT $ ectool gpioset PP3300_DX_BASE 1
DUT $ flash_ec --chip stm32_dfu --image staff_ec.bin
SERVO $ dut-control ec_boot_mode:off
DUT $ ectool gpioset PP3300_DX_BASE 0
DUT $ ectool gpioset PP3300_DX_BASE 1
Change-Id: I1799f083115bfdf203a405733c5baefadbe3fe3e
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/755614
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rwxr-xr-x | util/flash_ec | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/flash_ec b/util/flash_ec index a78e983d40..bda340fe22 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -224,7 +224,6 @@ elif $(in_array "${BOARDS_STM32[@]}" "${BOARD}"); then CHIP="stm32" elif $(in_array "${BOARDS_STM32_DFU[@]}" "${BOARD}"); then CHIP="stm32_dfu" - NEED_SERVO="no" elif $(in_array "${BOARDS_NPCX_5M5G_JTAG[@]}" "${BOARD}"); then CHIP="npcx_5m5g_jtag" elif $(in_array "${BOARDS_NPCX_5M6G_JTAG[@]}" "${BOARD}"); then @@ -241,7 +240,6 @@ elif $(in_array "${BOARDS_MEC1322[@]}" "${BOARD}"); then CHIP="mec1322" elif $(in_array "${BOARDS_IT83XX[@]}" "${BOARD}"); then CHIP="it83xx" - NEED_SERVO="no" elif [ -n "${FLAGS_chip}" ]; then CHIP="${FLAGS_chip}" else @@ -252,6 +250,10 @@ if [ -n "${FLAGS_chip}" -a "${CHIP}" != "${FLAGS_chip}" ]; then die "board ${BOARD} doesn't use chip ${FLAGS_chip}" fi +if [ "${CHIP}" = "stm32_dfu" -o "${CHIP}" = "it83xx" ]; then + NEED_SERVO="no" +fi + servo_has_warm_reset() { dut_control warm_reset >/dev/null 2>&1 } |