tcl/target: add SPDX tag
[fw/openocd] / tcl / target / str730.cfg
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 #STR730 CPU
4
5 adapter speed 3000
6
7 if { [info exists CHIPNAME] } {
8    set _CHIPNAME $CHIPNAME
9 } else {
10    set _CHIPNAME str730
11 }
12
13 if { [info exists ENDIAN] } {
14    set _ENDIAN $ENDIAN
15 } else {
16    set _ENDIAN little
17 }
18
19 if { [info exists CPUTAPID] } {
20    set _CPUTAPID $CPUTAPID
21 } else {
22    set _CPUTAPID 0x3f0f0f0f
23 }
24
25 #use combined on interfaces or targets that can't set TRST/SRST separately
26 reset_config trst_and_srst srst_pulls_trst
27
28 #jtag scan chain
29 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID
30
31 #jtag nTRST and nSRST delay
32 adapter srst delay 500
33 jtag_ntrst_delay 500
34
35 set _TARGETNAME $_CHIPNAME.cpu
36 target create $_TARGETNAME arm7tdmi -endian little -chain-position 0
37
38 $_TARGETNAME configure -event reset-start { adapter speed 10 }
39 $_TARGETNAME configure -event reset-init {
40         adapter speed 3000
41
42 # Because the hardware cannot be interrogated for the protection state
43 # of sectors, initialize all the sectors to be unprotected. The initial
44 # state is reflected by the driver, too.
45         flash protect 0 0 last off
46 }
47 $_TARGETNAME configure -event gdb-flash-erase-start {
48         flash protect 0 0 7 off
49 }
50
51 $_TARGETNAME configure -work-area-phys 0xA0000000 -work-area-size 0x4000 -work-area-backup 0
52
53 #flash bank <driver> <base> <size> <chip_width> <bus_width>
54 set _FLASHNAME $_CHIPNAME.flash
55 flash bank $_FLASHNAME str7x 0x80000000 0x00040000 0 0 $_TARGETNAME STR73x