summaryrefslogtreecommitdiff
path: root/tcl
diff options
context:
space:
mode:
authorEdgar Grimberg <edgar.grimberg@zylin.com>2010-02-02 13:17:26 +0100
committerDavid Brownell <dbrownell@users.sourceforge.net>2010-02-02 09:30:33 -0800
commitcc440ca1d44f0aaaf34daa365966b7b092126913 (patch)
treeea124b32e9b70016b2fd2ecacfcb6c63812f62eb /tcl
parent503f6139c7ed05339daea8c4984d32840d795222 (diff)
downloadopenocd_libswd-cc440ca1d44f0aaaf34daa365966b7b092126913.tar.gz
openocd_libswd-cc440ca1d44f0aaaf34daa365966b7b092126913.tar.bz2
openocd_libswd-cc440ca1d44f0aaaf34daa365966b7b092126913.tar.xz
openocd_libswd-cc440ca1d44f0aaaf34daa365966b7b092126913.zip
tcl/str7x: Reset init unlocks the flash
For STR7x flash, the device cannot be queried for the protect status. The solution is to remove the protection on reset init. The driver also initialises the sector protect field to unprotected. [dbrownell@users.sourceforge.net: line length shrinkage] Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'tcl')
-rw-r--r--tcl/target/str730.cfg9
-rw-r--r--tcl/target/str750.cfg10
2 files changed, 17 insertions, 2 deletions
diff --git a/tcl/target/str730.cfg b/tcl/target/str730.cfg
index 381fa5fc..cab2338f 100644
--- a/tcl/target/str730.cfg
+++ b/tcl/target/str730.cfg
@@ -34,7 +34,14 @@ set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm7tdmi -endian little -chain-position 0 -variant arm7tdmi
$_TARGETNAME configure -event reset-start { jtag_khz 10 }
-$_TARGETNAME configure -event reset-init { jtag_khz 3000 }
+$_TARGETNAME configure -event reset-init {
+ jtag_khz 3000
+
+# Because the hardware cannot be interrogated for the protection state
+# of sectors, initialize all the sectors to be unprotected. The initial
+# state is reflected by the driver, too.
+ flash protect 0 0 last off
+}
$_TARGETNAME configure -event gdb-flash-erase-start {
flash protect 0 0 7 off
}
diff --git a/tcl/target/str750.cfg b/tcl/target/str750.cfg
index 5df968bf..c467ae25 100644
--- a/tcl/target/str750.cfg
+++ b/tcl/target/str750.cfg
@@ -36,7 +36,15 @@ set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm7tdmi -endian little -chain-position 0 -variant arm7tdmi
$_TARGETNAME configure -event reset-start { jtag_khz 10 }
-$_TARGETNAME configure -event reset-init { jtag_khz 3000 }
+$_TARGETNAME configure -event reset-init {
+ jtag_khz 3000
+
+# Because the hardware cannot be interrogated for the protection state
+# of sectors, initialize all the sectors to be unprotected. The initial
+# state is reflected by the driver, too.
+ flash protect 0 0 last off
+ flash protect 1 0 last off
+}
$_TARGETNAME configure -event gdb-flash-erase-start {
flash protect 0 0 7 off
flash protect 1 0 1 off