mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user