summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2012-06-18 21:56:52 +0000
committerGerrit <chrome-bot@google.com>2012-06-18 16:23:28 -0700
commitc5b923d38defc535828e3b5399f03f1350e0dc54 (patch)
tree0ba3e047ee36e8949c3a2dda4d5d5b3ced2f2f9e
parentfe38bab96168effcce38090259f265d82e784aa1 (diff)
downloadchrome-ec-c5b923d38defc535828e3b5399f03f1350e0dc54.tar.gz
lm4f: update JTAG scripts for openOCD 0.5.0
The flash commands syntax has slightly evolved and the watchdog needs to be switched off even though we are doing a reset halt. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:7420 TEST=flash Link EC using OpenOCD inside the chroot: sudo USE="ftdi" emerge openocd sudo openocd -f chip/lm4/servo_v2.cfg flash_link Change-Id: Ieef5df682a945646525267a7b702e953796f3f00 Reviewed-on: https://gerrit.chromium.org/gerrit/25561 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--chip/lm4/openocd/lm4x.cfg10
-rw-r--r--chip/lm4/openocd/lm4x_cmds.tcl4
2 files changed, 11 insertions, 3 deletions
diff --git a/chip/lm4/openocd/lm4x.cfg b/chip/lm4/openocd/lm4x.cfg
index 3619320c57..e9df0ad8d6 100644
--- a/chip/lm4/openocd/lm4x.cfg
+++ b/chip/lm4/openocd/lm4x.cfg
@@ -27,8 +27,16 @@ target create $_TARGETNAME cortex_m3 -chain-position $_CHIPNAME.cpu -variant lm3
# 12k working area at base of ram, not backed up
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 0x3000
+# Ensure that the watchdog is properly disabled when doing flashing
+$_TARGETNAME configure -event reset-init {
+ # Unlock watchdog0
+ mww 0x40000c00 0x1ACCE551
+ # Disable Watchdog0
+ mww 0x40000008 0
+}
+
#flash configuration
-flash bank stellaris 0 0 0 0 $_TARGETNAME
+flash bank internal stellaris 0 0 0 0 $_TARGETNAME
# useful command definitions for software loading
source [find lm4x_cmds.tcl]
diff --git a/chip/lm4/openocd/lm4x_cmds.tcl b/chip/lm4/openocd/lm4x_cmds.tcl
index ea81c4c81c..59b6cb765d 100644
--- a/chip/lm4/openocd/lm4x_cmds.tcl
+++ b/chip/lm4/openocd/lm4x_cmds.tcl
@@ -9,8 +9,8 @@
proc flash_lm4 {path offset size} {
set firstsect [expr {$offset / 1024}];
set lastsect [expr {($offset + $size) / 1024 - 1}];
- reset halt;
- flash erase_sector 0 $firstsect $lastsect;
+ 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