tcl/interface: support for Raspberry Pi 5
[openocd.git] / tcl / target / swj-dp.tcl
blobf2b233fb78133fd5e45395fd307674c16a65ed70
1 # SPDX-License-Identifier: GPL-2.0-or-later
3 # ARM Debug Interface V5 (ADI_V5) utility
4 # ... Mostly for SWJ-DP (not SW-DP or JTAG-DP, since
5 # SW-DP and JTAG-DP targets don't need to switch based
6 # on which transport is active.
8 # declare a JTAG or SWD Debug Access Point (DAP)
9 # based on the transport in use with this session.
10 # You can't access JTAG ops when SWD is active, etc.
12 # params are currently what "jtag newtap" uses
13 # because OpenOCD internals are still strongly biased
14 # to JTAG .... but for SWD, "irlen" etc are ignored,
15 # and the internals work differently
17 # for now, ignore non-JTAG and non-SWD transports
18 # (e.g. initial flash programming via SPI or UART)
20 # split out "chip" and "tag" so we can someday handle
21 # them more uniformly irlen too...)
23 if [catch {transport select}] {
24 echo "Error: unable to select a session transport. Can't continue."
25 shutdown
28 proc swj_newdap {chip tag args} {
29 if [using_jtag] {
30 eval jtag newtap $chip $tag $args
31 } elseif [using_swd] {
32 eval swd newdap $chip $tag $args
33 } else {
34 echo "Error: transport '[ transport select ]' not supported by swj_newdap"
35 shutdown