]> git.sur5r.net Git - openocd/blob - tcl/target/ti_tms570.cfg
tcl/target: ti_tms570.cfg restructure dap support
[openocd] / tcl / target / ti_tms570.cfg
1 adapter_khz 1500
2
3 if { [info exists CHIPNAME] } {
4         set _CHIPNAME $CHIPNAME
5 } else {
6         set _CHIPNAME tms570
7 }
8
9 if { [info exists ENDIAN] } {
10         set _ENDIAN $ENDIAN
11 } else {
12         set _ENDIAN big
13 }
14
15 # TMS570 has an ICEpick-C on which we need the router commands.
16 source [find target/icepick.cfg]
17
18 # Main DAP
19 # DAP_TAPID should be set before source-ing this file
20 if { [info exists DAP_TAPID] } {
21         set _DAP_TAPID $DAP_TAPID
22 }
23 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable
24 jtag configure $_CHIPNAME.cpu -event tap-enable "icepick_c_tapenable $_CHIPNAME.jrc 0"
25
26 # ICEpick-C (JTAG route controller)
27 # JRC_TAPID should be set before source-ing this file
28 if { [info exists JRC_TAPID] } {
29         set _JRC_TAPID $JRC_TAPID
30 }
31
32 set _JRC_TAPID2 0x0B7B302F
33 set _JRC_TAPID3 0x0B95502F
34 set _JRC_TAPID4 0x0B97102F
35 set _JRC_TAPID5 0x0D8A002F
36 set _JRC_TAPID6 0x2B8A002F
37 set _JRC_TAPID7 0x2D8A002F
38 set _JRC_TAPID8 0x3B8A002F
39 set _JRC_TAPID9 0x3D8A002F
40
41
42 jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \
43         -expected-id $_JRC_TAPID \
44         -expected-id $_JRC_TAPID2 \
45         -expected-id $_JRC_TAPID3 \
46         -expected-id $_JRC_TAPID4 \
47         -expected-id $_JRC_TAPID5 \
48         -expected-id $_JRC_TAPID6 \
49         -expected-id $_JRC_TAPID7 \
50         -expected-id $_JRC_TAPID8 \
51         -expected-id $_JRC_TAPID9 \
52         -ignore-version
53 jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.cpu"
54 jtag configure $_CHIPNAME.jrc -event post-reset "runtest 100"
55
56 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
57
58 # Cortex-R4 target
59 set _TARGETNAME $_CHIPNAME.cpu
60 target create $_TARGETNAME cortex_r4 -endian $_ENDIAN \
61         -dap $_CHIPNAME.dap -coreid 0 -dbgbase 0x00001003
62
63 # TMS570 uses quirky BE-32 mode
64 $_CHIPNAME.dap ti_be_32_quirks 1
65
66 $_TARGETNAME configure -event gdb-attach {
67         cortex_r4 dbginit
68         halt
69 }
70
71 $_TARGETNAME configure -event "reset-assert" {
72         global _CHIPNAME
73
74         # assert warm system reset through ICEPick
75         icepick_c_wreset $_CHIPNAME.jrc
76 }