tcl/target: add SPDX tag
[fw/openocd] / tcl / target / ti_cc32xx.cfg
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 #
4 # Texas Instruments CC32xx - ARM Cortex-M4
5 #
6 # http://www.ti.com/product/CC3200
7 # http://www.ti.com/product/CC3220
8 #
9
10 source [find target/swj-dp.tcl]
11 source [find target/icepick.cfg]
12
13 if { [info exists CHIPNAME] } {
14         set _CHIPNAME $CHIPNAME
15 } else {
16         set _CHIPNAME cc32xx
17 }
18
19 #
20 # Main DAP
21 #
22 if { [info exists DAP_TAPID] } {
23         set _DAP_TAPID $DAP_TAPID
24 } else {
25         if {[using_jtag]} {
26                 set _DAP_TAPID 0x4BA00477
27         } else {
28                 set _DAP_TAPID 0x2BA01477
29         }
30 }
31
32 if {[using_jtag]} {
33         jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable
34         jtag configure $_CHIPNAME.cpu -event tap-enable "icepick_c_tapenable $_CHIPNAME.jrc 0"
35 } else {
36         swj_newdap $_CHIPNAME cpu -expected-id $_DAP_TAPID
37 }
38
39 #
40 # ICEpick-C (JTAG route controller)
41 #
42 if { [info exists JRC_TAPID] } {
43         set _JRC_TAPID $JRC_TAPID
44 } else {
45         set _JRC_TAPID 0x0B97C02F
46 }
47
48 if {[using_jtag]} {
49         jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f -expected-id $_JRC_TAPID -ignore-version
50         jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.cpu"
51 }
52
53 set _TARGETNAME $_CHIPNAME.cpu
54 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
55 target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
56
57 if { [info exists WORKAREASIZE] } {
58         set _WORKAREASIZE $WORKAREASIZE
59 } else {
60         set _WORKAREASIZE 0x2000
61 }
62
63 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0