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