summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-02-09 18:06:23 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-11 18:12:15 -0800
commita52688395740804b1859b93043b3f92a65927b61 (patch)
tree5e64b2706edf35d608708d1bbee9d85150a1b975 /util
parentc51e0b2f75a208c74fd62ec4b22e2fe64e45f967 (diff)
downloadchrome-ec-a52688395740804b1859b93043b3f92a65927b61.tar.gz
Do not silently ignore invalid attempts to use raiden programmer
When --raiden is passed as a command line parameter, do not proceed programming as if it were not present, alert the user and refuse to proceed instead. Need to jump though a couple of extra hoops to avoid printing the error message twice. BRANCH=none BUG=none TEST=tried running with boards supporting and not supporting programming over CCD. $ ./util/flash_ec --board=oak --raiden --image rowan.ec.bin INFO: Using ec image : rowan.ec.bin ERROR: raiden mode not supported on oak $ ./util/flash_ec --board=kevin --raiden --image rowan.ec.bin INFO: Using ec image : rowan.ec.bin INFO: Flashing chip npcx_spi. INFO: Using raiden debug cable. ... Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: Ia40f348e6dde57fc2f4c49719bc2a0947036dcc1 Reviewed-on: https://chromium-review.googlesource.com/440051 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/flash_ec14
1 files changed, 11 insertions, 3 deletions
diff --git a/util/flash_ec b/util/flash_ec
index 07b7a450de..9f3a531371 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -284,12 +284,20 @@ on_servov3() {
}
# Returns 0 on success (if raiden should be used instead of servo)
+error_reported= # Avoid double printing the error message.
on_raiden() {
- if ([ -z "${BOARD}" ] || \
- $(in_array "${BOARDS_RAIDEN[@]}" "${BOARD}")) && \
- [ "${FLAGS_raiden}" = ${FLAGS_TRUE} ] ; then
+ if [ -z "${BOARD}" ]; then
return 0
fi
+ if [ "${FLAGS_raiden}" = ${FLAGS_TRUE} ]; then
+ if in_array "${BOARDS_RAIDEN[@]}" "${BOARD}"; then
+ return 0
+ fi
+ if [ -z "${error_reported}" ]; then
+ error_reported="y"
+ die "raiden mode not supported on ${BOARD}" >&2
+ fi
+ fi
return 1
}