Add Valuline HD to config file
[fw/openocd] / tcl / target / stellaris.cfg
index bfe9087c15017abaeb871c7be688c45340c34650..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]
@@ -38,9 +50,6 @@ if { [info exists WORKAREASIZE ] } {
    set _WORKAREASIZE 0x2000
 }
 
-jtag newtap $_CHIPNAME cpu -irlen 4 -irmask 0xf \
-       -expected-id $_CPUTAPID -ignore-version
-
 set _TARGETNAME $_CHIPNAME.cpu
 target create $_TARGETNAME cortex_m3 -chain-position $_CHIPNAME.cpu
 
@@ -77,10 +86,17 @@ $_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 systesetreq
+               cortex_m3 reset_config sysresetreq
        } else {
                # Tempest and newer default to using NVIC VECTRESET
                # this does mean a reset-init event handler is required to reset