aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. A. Bryce <bbcu2011@gmail.com>2011-08-02 11:33:03 +0100
committerSpencer Oliver <ntfreak@users.sourceforge.net>2011-08-02 13:10:03 +0100
commit29f0ac0efd112f058fc2058665bb66daa80fb9f7 (patch)
tree47d54676939b5f7423342640ecab7c2bc4350756
parentd02dfff48b0051ddf4142c9e2d657811ff30eec8 (diff)
cfg: allow stellaris device class override
Some devices, eg. The Tempest class return the wrong device class when queried. Add the ability to manually override the device class. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
-rw-r--r--tcl/target/stellaris.cfg21
1 files changed, 20 insertions, 1 deletions
diff --git a/tcl/target/stellaris.cfg b/tcl/target/stellaris.cfg
index d6314987..b985de05 100644
--- a/tcl/target/stellaris.cfg
+++ b/tcl/target/stellaris.cfg
@@ -1,5 +1,17 @@
# TI/Luminary Stellaris LM3S chip family
+# Some devices have errata in returning their device class.
+# DEVICECLASS is provided as a manual override
+# Manual setting of a device class of 0xff is not allowed
+
+global _DEVICECLASS
+
+if { [info exists DEVICECLASS ] } {
+ set _DEVICECLASS $DEVICECLASS
+} else {
+ set _DEVICECLASS 0xff
+}
+
# Luminary chips support both JTAG and SWD transports.
# Adapt based on what transport is active.
source [find target/swj-dp.tcl]
@@ -74,7 +86,14 @@ $_TARGETNAME configure -event reset-start {
# /openocd-development/2008-August/003065.html
#
- set device_class [expr (([mrw 0x400fe000] >> 16) & 0xff)]
+ global _DEVICECLASS
+
+ if {$_DEVICECLASS != 0xff} {
+ set device_class $_DEVICECLASS
+ } else {
+ set device_class [expr (([mrw 0x400fe000] >> 16) & 0xff)]
+ }
+
if {$device_class == 0 || $device_class == 1 || $device_class == 3} {
# Sandstorm, Fury and DustDevil are able to use NVIC SYSRESETREQ
cortex_m3 reset_config sysresetreq