summaryrefslogtreecommitdiff
path: root/util/flash_ec
diff options
context:
space:
mode:
Diffstat (limited to 'util/flash_ec')
-rwxr-xr-xutil/flash_ec18
1 files changed, 14 insertions, 4 deletions
diff --git a/util/flash_ec b/util/flash_ec
index 47d6318aff..3ad4bf514d 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -140,6 +140,10 @@ in_array() {
return 1
}
+servo_has_warm_reset() {
+ dut_control warm_reset >/dev/null 2>&1
+}
+
# reset the EC
toad_ec_hard_reset() {
if dut_control cold_reset 2>/dev/null ; then
@@ -248,6 +252,10 @@ function ec_image() {
DUT_CONTROL_CMD="dut-control --port=${FLAGS_port}"
+function dut_control() {
+ $DUT_CONTROL_CMD "$@" >/dev/null
+}
+
# Find the EC UART on the servo v2
function ec_uart() {
SERVOD_FAIL="Cannot communicate with servo. is servod running ?"
@@ -274,13 +282,12 @@ 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"
-function dut_control() {
- $DUT_CONTROL_CMD "$@" >/dev/null
-}
-
function servo_save() {
SERVO_VARS_NAME=${SERVO_TYPE}_VARS
$DUT_CONTROL_CMD ${!SERVO_VARS_NAME}
@@ -360,6 +367,9 @@ function flash_stm32() {
fi
dut_control ${MCU}_uart_parity:even
dut_control ${MCU}_uart_baudrate:115200
+ if $(servo_has_warm_reset); then
+ dut_control warm_reset:on
+ fi
# Force the EC to boot in serial monitor mode
ec_enable_boot0
# Reset the EC