tcl/target: add SPDX tag
[fw/openocd] / tcl / target / xmc1xxx.cfg
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 #
4 # Infineon XMC1100/XMC1200/XMC1300 family (ARM Cortex-M0 @ 32 MHz)
5 #
6
7 if { [info exists CHIPNAME] } {
8         set _CHIPNAME $CHIPNAME
9 } else {
10         set _CHIPNAME xmc1000
11 }
12
13 #
14 # Only SWD and SPD supported
15 #
16 source [find target/swj-dp.tcl]
17
18 if { [info exists CPUTAPID] } {
19         set _CPU_SWD_TAPID $CPUTAPID
20 } else {
21         set _CPU_SWD_TAPID 0x0BB11477
22 }
23
24 swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPU_SWD_TAPID
25 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
26
27 set _TARGETNAME $_CHIPNAME.cpu
28 target create $_TARGETNAME cortex_m -endian little -dap $_CHIPNAME.dap
29
30 if { [info exists WORKAREASIZE] } {
31    set _WORKAREASIZE $WORKAREASIZE
32 } else {
33    set _WORKAREASIZE 0x4000
34 }
35
36 $_TARGETNAME configure -work-area-phys 0x20000000 \
37                        -work-area-size $_WORKAREASIZE \
38                        -work-area-backup 0
39
40 set _FLASHNAME $_CHIPNAME.flash
41 flash bank $_FLASHNAME xmc1xxx 0x10000000 0 0 0 $_TARGETNAME
42
43 adapter speed 1000