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