From 14f255052a56fe539529344f6e5ed8439a04d312 Mon Sep 17 00:00:00 2001 From: Eric Yilun Lin Date: Fri, 11 Jun 2021 16:50:34 +0800 Subject: flash_ec: support servo_v4p1_with_servo_micro There were some glob issues in the code so it can't flash with the servo_v4p1_with_servo_micro config. BUG=none TEST=flash_ec to hayato with servo_v4p1_with_servo_micro and servo_v4_with_servo_micro BRANCH=none Change-Id: If8fcb3046e4eeb492eac3a981484b7fbc276bcf5 Signed-off-by: Eric Yilun Lin Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954985 Tested-by: Eric Yilun Lin Auto-Submit: Eric Yilun Lin Reviewed-by: Ting Shen Commit-Queue: Eric Yilun Lin (cherry picked from commit 421f0d11fa5a3de9a5360cb9d58cc063419f7d0f) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2957908 Reviewed-by: Eric Yilun Lin --- util/flash_ec | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/util/flash_ec b/util/flash_ec index 2cd9440cda..a2c2a7feaf 100755 --- a/util/flash_ec +++ b/util/flash_ec @@ -395,17 +395,19 @@ esac SERVO_TYPE="$(dut_control_get servo_type || :)" -if [[ "${SERVO_TYPE}" =~ ^servo_v4_with_.*$ ]]; then - ACTIVE_DEVICE="$(dut_control_get active_v4_device)" +if [[ "${SERVO_TYPE}" =~ ^servo_v4(p1)?_with_.*$ ]]; then + ACTIVE_DEVICE="$(dut_control_get active_dut_controller)" else ACTIVE_DEVICE="${SERVO_TYPE}" fi -if [[ "${SERVO_TYPE}" =~ ^servo_v4_with_.*_and_.*$ ]]; then +if [[ "${SERVO_TYPE}" =~ ^servo_v4(p1)?_with_.*_and_.*$ ]]; then # If there are two devices, servo v4 type will show both devices. The # default device is first. The other device is second. - # servo_type:servo_v4_with_servo_micro_and_ccd_cr50 + # servo_type:servo_v4{p1}_with_servo_micro_and_ccd_cr50 SECOND_DEVICE="${SERVO_TYPE#*_and_}" + # servo_v4p1 can shared the same type with servo_v4, since there's no + # difference handling the flash. SERVO_TYPE="servo_v4_with_${ACTIVE_DEVICE}" # Controls sent through the default device don't have a prefix. The # second device controls do. If the default device isn't active, we @@ -849,7 +851,7 @@ function claim_pty() { # Returns the serialnumber of the specified servo. function get_serial() { - if [[ "${SERVO_TYPE}" =~ "servo_v4_with_servo_micro" ]]; then + if [[ "${SERVO_TYPE}" =~ ^servo_v4(p1)?_with_servo_micro ]]; then if [[ -z "${BOARD}" ]]; then sn_ctl="servo_micro_" elif [[ "$(dut_control_get "servo_micro_for_${BOARD}_serialname")" =~ \ -- cgit v1.2.1