cfg: allow stellaris device class override
authorB. A. Bryce <bbcu2011@gmail.com>
Tue, 2 Aug 2011 10:33:03 +0000 (11:33 +0100)
committerSpencer Oliver <ntfreak@users.sourceforge.net>
Tue, 2 Aug 2011 12:10:03 +0000 (13:10 +0100)
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>
tcl/target/stellaris.cfg

index d6314987574409f5c7e8b327e1a02cfd6411c88a..b985de0561cb5c0614bf2e94f2ec64d3d9de1143 100644 (file)
@@ -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

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)