tcl/target: add SPDX tag
[fw/openocd] / tcl / target / renesas_s7g2.cfg
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 #
4 # Renesas Synergy S7 G2 w/ ARM Cortex-M4 @ 240 MHz
5 #
6
7 if { [info exists CHIPNAME] } {
8         set _CHIPNAME $CHIPNAME
9 } else {
10         set _CHIPNAME s7g2
11 }
12
13 if { [info exists CPU_JTAG_TAPID] } {
14         set _CPU_JTAG_TAPID $CPU_JTAG_TAPID
15 } else {
16         set _CPU_JTAG_TAPID 0x5ba00477
17 }
18
19 if { [info exists CPU_SWD_TAPID] } {
20         set _CPU_SWD_TAPID $CPU_SWD_TAPID
21 } else {
22         set _CPU_SWD_TAPID 0x5ba02477
23 }
24
25 source [find target/swj-dp.tcl]
26
27 if { [using_jtag] } {
28         set _CPU_TAPID $_CPU_JTAG_TAPID
29 } else {
30         set _CPU_TAPID $_CPU_SWD_TAPID
31 }
32
33 swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPU_TAPID
34 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
35
36 set _TARGETNAME $_CHIPNAME.cpu
37 target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
38
39 if { [info exists WORKAREASIZE] } {
40         set _WORKAREASIZE $WORKAREASIZE
41 } else {
42         # 640 KB On-Chip SRAM
43         set _WORKAREASIZE 0xa0000
44 }
45
46 $_TARGETNAME configure -work-area-phys 0x1ffe0000 \
47                        -work-area-size $_WORKAREASIZE -work-area-backup 0
48
49 if { ![using_hla] } {
50         cortex_m reset_config sysresetreq
51 }
52
53 adapter speed 1000