target/adi_v5_swd: move setting of do_reconnect one level up
[openocd.git] / tcl / target / hilscher_netx500.cfg
blobd838a6be9962e2467679092cc5eb18a1ed7047b3
1 # SPDX-License-Identifier: GPL-2.0-or-later
3 #Hilscher netX 500 CPU
5 if { [info exists CHIPNAME] } {
6    set _CHIPNAME $CHIPNAME
7 } else {
8    set _CHIPNAME netx500
11 if { [info exists ENDIAN] } {
12    set _ENDIAN $ENDIAN
13 } else {
14    set _ENDIAN little
17 if { [info exists CPUTAPID] } {
18    set _CPUTAPID $CPUTAPID
19 } else {
20    set _CPUTAPID 0x07926021
23 # jtag scan chain
24 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
26 # that TAP is associated with a target
27 set _TARGETNAME $_CHIPNAME.cpu
28 target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME
30 proc mread32 {addr} {
31   return [read_memory $addr 32 1]
34 # This function must be called on netX100/500 right after halt
35 # If it is called later the needed register cannot be written anymore
36 proc sdram_fix { } {
38   set accesskey [mread32 0x00100070]
39   mww 0x00100070 $accesskey
40   mww 0x0010002c 0x00000001
42   if {[expr {[mread32 0x0010002c] & 0x07}] == 0x07} {
43          puts "SDRAM Fix was not executed. Probably your CPU halted too late and the register is already locked!"
44   } else {
45          puts "SDRAM Fix succeeded!"
46   }