summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShelley Chen <shchen@chromium.org>2015-11-13 15:26:17 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-16 09:18:39 -0800
commitfcdbe7da7a08201838138e8e08877f91225cdad2 (patch)
treee67b0597cb6205cf71c64dd8a28874d1c159507b
parent422cb0c5e227b4f944af5e31d8c34c18dd0c5b11 (diff)
downloadchrome-ec-fcdbe7da7a08201838138e8e08877f91225cdad2.tar.gz
flash_ec: Accomodate using flashrom on beaglebone
Currently, using flash_ec for mec1322 chips only supports flashing from servo v2. Updated to work from v3 as well. BUG=chromium:554230 BRANCH=None TEST=tested locally with beaglebone/cyan setup at my desk Ran flash_ec --board=cyan --chip=mec1322 --image=/tmp/image.bin Change-Id: Ibc1109a60e93d1034519b31ce58c5e4d45ab505c Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/312578
-rwxr-xr-xutil/flash_ec19
1 files changed, 15 insertions, 4 deletions
diff --git a/util/flash_ec b/util/flash_ec
index f97a693bef..59729e9f2c 100755
--- a/util/flash_ec
+++ b/util/flash_ec
@@ -231,6 +231,11 @@ ec_enable_boot0() {
eval ${SERVO_TYPE}_${MCU}_boot0
}
+on_servov3() {
+ grep '^CHROMEOS_RELEASE_BOARD=' /etc/lsb-release | \
+ sed 's/CHROMEOS_RELEASE_BOARD=//'
+}
+
# Put back the servo and the system in a clean state at exit
FROZEN_PIDS=""
cleanup() {
@@ -374,15 +379,21 @@ function flash_openocd() {
function flash_flashrom() {
TOOL_PATH="${EC_DIR}/build/${BOARD}/util:/usr/sbin/:$PATH"
FLASHROM=$(PATH="${TOOL_PATH}" which flashrom)
- FLASHROM_PARAM="-p ft2232_spi:type=servo-v2,port=B"
+ if [ on_servov3 ]; then
+ FLASHROM_PARAM="-p linux_spi"
+ else
+ FLASHROM_PARAM="-p ft2232_spi:type=servo-v2,port=B"
+ fi
if [ ! -x "$FLASHROM" ]; then
die "no flashrom util found."
fi
- SERIALNAME=$(${DUT_CONTROL_CMD} serialname | cut -d: -f2)
- if [[ "$SERIALNAME" != "" ]] ; then
- FLASHROM_PARAM="${FLASHROM_PARAM},serial=${SERIALNAME}"
+ if [ ! on_servov3 ]; then
+ SERIALNAME=$(${DUT_CONTROL_CMD} serialname | cut -d: -f2)
+ if [[ "$SERIALNAME" != "" ]] ; then
+ FLASHROM_PARAM="${FLASHROM_PARAM},serial=${SERIALNAME}"
+ fi
fi
dut_control cold_reset:on