diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-04-20 10:04:48 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-04-20 10:04:48 -0700 |
commit | b2f34fcfd117f43f44920e20f3cdf686f6648200 (patch) | |
tree | 41d05d057e3059b45b6b041edb8af897041c53bf | |
parent | 13ad1c007bef3922e0aae8c7e2ef067a05eb0c06 (diff) | |
download | chrome-ec-b2f34fcfd117f43f44920e20f3cdf686f6648200.tar.gz |
Add openocd macros to write image A or B
These are faster than writing the entire EC, and safer if you're
mucking with things like the clock config. Of course, if you're
changing verified boot or something else that happens before
vboot_init(), these new commands won't help, and you should keep using
the existing flash_link command.
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=none
TEST=manual from openocd
- Compile a new image
- From openocd, flash_link_b
- From ec console, note build compile date in image A: shouldn't have changed
- From ec consle, sysjump b; compile date should be for your new image
Change-Id: Ifd6aabe963948d3c5da5bdeb78c5f962a0f9f857
-rw-r--r-- | chip/lm4/openocd/lm4x_cmds.tcl | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/chip/lm4/openocd/lm4x_cmds.tcl b/chip/lm4/openocd/lm4x_cmds.tcl index b0b1a78ca1..c3347c5b0b 100644 --- a/chip/lm4/openocd/lm4x_cmds.tcl +++ b/chip/lm4/openocd/lm4x_cmds.tcl @@ -6,24 +6,33 @@ # Program internal flash -proc flash_lm4 {path size} { - set lastsect [expr {$size / 1024 - 1}]; +proc flash_lm4 {path offset size} { + set firstsect [expr {$offset / 1024}]; + set lastsect [expr {($offset + $size) / 1024 - 1}]; reset halt; - flash erase_sector 0 0 $lastsect; + flash erase_sector 0 $firstsect $lastsect; # Note erase_sector silently fails sometimes; see crosbug.com/p/8632 # Dump a few words as a diagnostic for whether erase succeeded mdw 0 16 - flash write_image $path 0; + flash write_image $path $offset; reset } # Link proto0 has 128KB flash; proto1+ have 256KB proc flash_link { } { - flash_lm4 ../../../build/link/ec.bin 262144 + flash_lm4 ../../../build/link/ec.bin 0 262144 +} + +proc flash_link_a { } { + flash_lm4 ../../../build/link/ec.A.flat 81920 81920 +} + +proc flash_link_b { } { + flash_lm4 ../../../build/link/ec.B.flat 163840 81920 } proc flash_bds { } { - flash_lm4 ../../../build/bds/ec.bin 262144 + flash_lm4 ../../../build/bds/ec.bin 0 262144 } # Boot a software using internal RAM only |