summaryrefslogtreecommitdiff
path: root/chip/lm4/openocd/lm4x_cmds.tcl
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-07-13 14:08:35 -0700
committerRandall Spangler <rspangler@chromium.org>2012-07-16 10:16:00 -0700
commit1dc7241e3a32635b3e3563fd5ddae482478dd92c (patch)
treeb097840cc446e77e09ff53e95e12aa0583b861a4 /chip/lm4/openocd/lm4x_cmds.tcl
parentc1701c4f07fab09093f9326ebbebc6819be433b7 (diff)
downloadchrome-ec-1dc7241e3a32635b3e3563fd5ddae482478dd92c.tar.gz
Use openocd auto-erase when writing flash, and use sysresetreq to reset
According to its datasheet, LM4 doesn't support vectreset, but does support sysresetreq. Using sysresetreq properly resets all peripherals and cleanly resets the LM4. Auto-erase makes the flash command faster. BUG=none TEST=flash_link_ro, flash_link_a, flash_link, all with different images Change-Id: I80b72de2ee0f42cee1b0f2f2a53062384d2c29aa Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/27416
Diffstat (limited to 'chip/lm4/openocd/lm4x_cmds.tcl')
-rw-r--r--chip/lm4/openocd/lm4x_cmds.tcl12
1 files changed, 4 insertions, 8 deletions
diff --git a/chip/lm4/openocd/lm4x_cmds.tcl b/chip/lm4/openocd/lm4x_cmds.tcl
index 9a3630552d..3f1c93e29a 100644
--- a/chip/lm4/openocd/lm4x_cmds.tcl
+++ b/chip/lm4/openocd/lm4x_cmds.tcl
@@ -7,14 +7,10 @@
# Program internal flash
proc flash_lm4 {path offset size} {
- set firstsect [expr {$offset / 1024}];
- set lastsect [expr {($offset + $size) / 1024 - 1}];
- reset init;
- flash erase_sector internal $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 $offset;
+ #set firstsect [expr {$offset / 1024}];
+ #set lastsect [expr {($offset + $size) / 1024 - 1}];
+ reset halt;
+ flash write_image erase $path $offset;
reset
}