If EC-RO protects itself via the WRPx option bytes, flash_ec will fail
to reprogram it. And if EC-RO is broken/unbootable, it won't be able
to clear the WRPx option bytes itself when it sees the write protect
GPIO is not asserted.
Add the -u flag to stm32mon so that it will automatically attempt to
unprotect the flash via the option bytes.
BUG=chrome-os-partner:19723
BRANCH=none
TEST=enable write protect GPIO. Then from console, 'flashwp enable'.
Then from the chroot:
./util/flash_ec --board=pit --ro --image=build/pit/ec.RO.flat
That should successfully reflash the board.
Change-Id: Ic356d29104294d04d5e2a36dc75fd0206b89bd34
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56659
The firmware defines had two almost-identical sets. Coalesce into one
consistent set.
Link had 256 KB flash, but only allowed 2 80KB images. Future
LM4-based platforms (slippy/peppy/falco/etc) will now use the entire
flash, with RO=124KB, pstate=4KB, RW=128KB. This matches what the
STM32 platforms do, where pstate is contiguous with the RO firmware.
No functional change to STM32-based platforms.
BUG=chrome-os-partner:19176
BRANCH=none
TEST=build all platforms and dump_fmap ec.bin.
- stm32-based platforms should report RO=61440@0, RW=65536@0x10000
- link should report RO=81920@0, RW=81920@0x14000
- slippy should report RO=129024@0, RW=131072@0x20000
Change-Id: I20b1d95c16250d9a5d228ead06eef03d96548823
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56655
This change copies the slippy board configuration as a starting
point for peppy. This change is essentially the same as
https://gerrit.chromium.org/gerrit/55820
BUG=chrome-os-partner:19640
BRANCH=none
TEST=manual
Tested on slippy as there are no peppy-specific changes yet.
cros_workon --board peppy start chromeos-ec
emerge-peppy chromeos-ec
~/trunk/src/platform/ec/util/flash_ec --board peppy
Signed-off-by: Dave Parker <dparker@chromium.org>
Change-Id: I4c5f7a77fa55a6364effe838f7a656d56bfad9fb
Reviewed-on: https://gerrit.chromium.org/gerrit/56332
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Queue: Dave Parker <dparker@chromium.org>
Tested-by: Dave Parker <dparker@chromium.org>
This change just copies slippy and tweaks a few things that were
slippy-specific instead of not-link-specific (there are still bugs
open for those things).
BUG=chrome-os-partner:18788
BRANCH=none
TEST=manual
Since there are no Falco-specific changes yet (just slippy with another
name), I can try it on Slippy:
cros_workon --board falco start chromeos-ec
emerge-falco chromeos-ec
~/trunk/src/platform/ec/util/flash_ec --board falco
I also built and tested Link EC, to make sure nothing broke there either.
Change-Id: I9b3682032bd51adab4450520dfe52e3036750ef9
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/55820
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commits the hacks made during board bringup. Bugs can be filed and
fixed based on this starting point.
BUG=chrome-os-partner:18825
BRANCH=slippy
TEST=manual
Try it and see.
Change-Id: Ia663eaf9a357633873b1b5d5cc6dbdda63513082
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50875
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Add support for flashing Spring board through the Toad cable (given the
Write Protect screw is not on).
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:17570
TEST=with both a Toad cable and a servo v2, flash EC on Spring EVT
with the following command:
./util/flash_ec --board=spring
and check the state of the servo/toad before and after.
Change-Id: Ia4e0d32b062d58b4e906d3f006003fa6097add83
Reviewed-on: https://gerrit.chromium.org/gerrit/48031
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
For chromeos devices with the stm32 EC we write the firmware via
uart. Often developers are connected to this UART for console I/O
which causes flash_ec to fail.
This change looks for any pids currently attached to the UART and
forcibly kills them prior to attempting to write the firmware.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=spring
BUG=none
TEST=manual,
./util/flash_ec --board spring ...
Forcibly grabs UART from both:
cu -l /dev/pts/<num>
minicom -p /dev/pts/<num>
Change-Id: Ie2a2b7aaf437c2cedd1d16e399c63068f2b02da3
Reviewed-on: https://gerrit.chromium.org/gerrit/45217
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Previous CL included --port but I neglected one invocation. Better to
just unify how dut-control is called with a global.
BRANCH=none
BUG=none
TEST=manual,
./util/flash_ec --board spring
- device connected to servod @ port 9999 is successfully flashed
./util/flash_ec --board spring --port 9902
- device connected to servod @ port 9902 is successfully flashed
Change-Id: I9cf57d0ddd94cf825d3015f9768effffca94eaf2
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43222
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Adds argument --port to provide ability to flash from host that has
multiple servos running.
BRANCH=none
BUG=none
TEST=manual,
./util/flash_ec --board spring
- device connected to servod @ port 9999 is successfully flashed
./util/flash_ec --board spring --port 9902
- device connected to servod @ port 9902 is successfully flashed
Signed-off-by: Todd Broch <tbroch@chromium.org>
Change-Id: Iecc4b8df51236a1f21be5feca8bb87f5a1d03e97
Reviewed-on: https://gerrit.chromium.org/gerrit/43182
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=link
BUG=chromium-os:37967
TEST=Remove write protect, reflash without 'unprotect', flag
and verify the write protect flag is stil enabled with
flashrom -p internal:bus=lpc --wp-status. Power down,
then reflash with the --unprotect flag. Now verify the
write protect status flag is disabled.
Change-Id: Ie05b5dc85dd31d29ab43a392fe948a52d547fff3
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/41477
Reviewed-by: Randall Spangler <rspangler@chromium.org>
When a nonexisting file is specified as the EC image, the ec flash
programming script reports the error, but continues running and
returns zero status (success) after completion.
With this change the exit status on some errors gets communicated to
the caller.
The openocd script is edited to drop the unused parameter of the
flash_lm4() function and the flash_ec script is edited not to require
EC images to be executable.
BRANCH=none
BUG=chrome-os-partner:15610
TEST=manual
. run flash_ec with nonexisting or nonreadable file as a parameter,
observe it to report proper return status. Run it with a proper
image file name and observe it succeed.
. run the command again, while the device is being programmed enter
'ctl-c', observe programming stepped but the 'Restoring servo
settings..." message still showing up.
Change-Id: Iac0b233fe579b0d5a84cf5a9acf85ed8bf10422e
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37363
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
The common code will set up DEFAULT_BOARD for us automatically now.
BUG=None
TEST=`flash_ec --help` showed the right default board
Change-Id: I02a009bba757c78fa5606debe567be6f6bc4f742
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/30261
Reviewed-by: Randall Spangler <rspangler@chromium.org>
The script ensures that the servo parameters are correct,
and restores original servo parameters afterwards.
Daisy EC flashing works from the build tree :
./util/flash_ec --board=daisy --ro
The Link flashing is using the new openOCD 0.5.0 in the chroot.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=None
TEST=./util/flash_ec --board=snow --ro
./util/flash_ec --board=link
Change-Id: Ifc87a8d21a5dac6ad8c4a0fb38694aa5f5bbf992
Reviewed-on: https://gerrit.chromium.org/gerrit/21664
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>