diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2021-06-11 16:50:34 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-12 06:07:45 +0000 |
commit | 421f0d11fa5a3de9a5360cb9d58cc063419f7d0f (patch) | |
tree | 61bcf6031379fee369f79a16ed1ea5c1d7651660 /util | |
parent | 9a40c7dbadf8c577660a09807287d9133373803b (diff) | |
download | chrome-ec-421f0d11fa5a3de9a5360cb9d58cc063419f7d0f.tar.gz |
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 <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2954985
Tested-by: Eric Yilun Lin <yllin@google.com>
Auto-Submit: Eric Yilun Lin <yllin@google.com>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'util')
-rwxr-xr-x | util/flash_ec | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/util/flash_ec b/util/flash_ec index b6fac2d585..6a91fd08e7 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")" =~ \ |