From 72ca4cc9f9460c0637ea786af9f35e64c5b3da12 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Fri, 10 Apr 2015 11:30:43 -0700 Subject: [PATCH] util: workaround warm_reset issue in flash_ec The warm_reset_l signal is an open drain output on the servo side and its input value can be read back as on (level 0) when the AP power rails are off on the DUT side and not pulling it up. So the current mechanism of reading the warm_reset input value with dut-control at the beginning, then restoring it at the end is sometimes broken because when the AP is OFF, we are reading input == on (while we had actually set output to "off" but we have no pull-up) and then restoring a "hard" on (drive low on the servo side). In this workaround, just assume we don't want to pull warm_reset after flashing the EC and restore it to off. A better solution might be to have a mechanism in dut-control to read the output register rather than the input value for GPIO, so we can save and restore them safely. Signed-off-by: Vincent Palatin BRANCH=none BUG=chrome-os-partner:30738 TEST=On Ryu P5 with the AP off, run ./util/flash_ec --board=ryu then boot the AP properly with the power button. Change-Id: I96e65c2fec5e6d604445af3fe26fce73678b1d3b Reviewed-on: https://chromium-review.googlesource.com/265223 Reviewed-by: Todd Broch Reviewed-by: Randall Spangler Tested-by: Vincent Palatin Commit-Queue: Vincent Palatin Trybot-Ready: Vincent Palatin --- util/flash_ec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/flash_ec b/util/flash_ec index 283056511d..aca12e8fc7 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -291,9 +291,6 @@ fi if $(in_array "${BOARDS_PRIVATE_SPI_PP3300[@]}" "${BOARD}"); then servo_VARS+=" spi1_buf_en spi1_buf_on_flex_en spi_hold" fi -if $(servo_has_warm_reset); then - servo_VARS+=" warm_reset" -fi toad_VARS="${MCU}_uart_parity \ ${MCU}_uart_baudrate boot_mode" @@ -376,6 +373,11 @@ function flash_stm32() { ec_reset # Unprotect flash, erase, and write ${STM32MON} -d ${EC_UART} -U -u -e -w "${IMG}" + # Remove the Application processor reset + # TODO(crosbug.com/p/30738): we cannot rely on servo_VARS to restore it + if $(servo_has_warm_reset); then + dut_control warm_reset:off + fi } function flash_stm32_dfu() {