summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2021-06-11 16:50:34 +0800
committerCommit Bot <commit-bot@chromium.org>2021-06-12 09:00:42 +0000
commit14f255052a56fe539529344f6e5ed8439a04d312 (patch)
tree9c8320a6285a27f7b59c4d6459b1882e348c04bf
parentd94ba215733077008bed6c6375958f8da4348a09 (diff)
downloadchrome-ec-14f255052a56fe539529344f6e5ed8439a04d312.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> (cherry picked from commit 421f0d11fa5a3de9a5360cb9d58cc063419f7d0f) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2957908 Reviewed-by: Eric Yilun Lin <yllin@google.com>
-rwxr-xr-xutil/flash_ec12
1 files 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")" =~ \