jtag/drivers/jlink: Use correct command errors
[openocd.git] / tcl / target / ti_tms570.cfg
blob18e0d829413f32e75502abc2b95a15f14c554b81
1 # SPDX-License-Identifier: GPL-2.0-or-later
3 adapter speed 1500
5 if { [info exists CHIPNAME] } {
6         set _CHIPNAME $CHIPNAME
7 } else {
8         set _CHIPNAME tms570
11 if { [info exists ENDIAN] } {
12         set _ENDIAN $ENDIAN
13 } else {
14         set _ENDIAN big
17 # TMS570 has an ICEpick-C on which we need the router commands.
18 source [find target/icepick.cfg]
20 # Main DAP
21 # DAP_TAPID should be set before source-ing this file
22 if { [info exists DAP_TAPID] } {
23         set _DAP_TAPID $DAP_TAPID
25 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable -ignore-version
26 jtag configure $_CHIPNAME.cpu -event tap-enable "icepick_c_tapenable $_CHIPNAME.jrc 0"
28 # ICEpick-C (JTAG route controller)
29 # JRC_TAPID should be set before source-ing this file
30 if { [info exists JRC_TAPID] } {
31         set _JRC_TAPID $JRC_TAPID
34 set _JRC_TAPID2 0x0B7B302F
35 set _JRC_TAPID3 0x0B95502F
36 set _JRC_TAPID4 0x0B97102F
37 set _JRC_TAPID5 0x0D8A002F
38 set _JRC_TAPID6 0x0B8A002F
41 jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \
42         -expected-id $_JRC_TAPID \
43         -expected-id $_JRC_TAPID2 \
44         -expected-id $_JRC_TAPID3 \
45         -expected-id $_JRC_TAPID4 \
46         -expected-id $_JRC_TAPID5 \
47         -expected-id $_JRC_TAPID6 \
48         -ignore-version
49 jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.cpu"
50 jtag configure $_CHIPNAME.jrc -event post-reset "runtest 100"
52 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
54 # Cortex-R4 target
55 set _TARGETNAME $_CHIPNAME.cpu
56 target create $_TARGETNAME cortex_r4 -endian $_ENDIAN \
57         -dap $_CHIPNAME.dap -coreid 0 -dbgbase 0x80001000
59 # TMS570 uses quirky BE-32 mode
60 $_CHIPNAME.dap ti_be_32_quirks 1
62 $_TARGETNAME configure -event "reset-assert" {
63         global _CHIPNAME
65         # assert warm system reset through ICEPick
66         icepick_c_wreset $_CHIPNAME.jrc