diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2018-08-29 11:57:42 +0200 |
---|---|---|
committer | Matthias Welwarsky <matthias@welwarsky.de> | 2019-01-30 14:29:10 +0000 |
commit | 7a80a74e8117332d6fd780f5c4697fe4bd3c41f7 (patch) | |
tree | 0bc8c4ced261c1370951469d640d3efaf888d35e /src/target/arm_adi_v5.h | |
parent | bda2d7371874569cd5232580a3602dd56083a304 (diff) | |
download | riscv-openocd-7a80a74e8117332d6fd780f5c4697fe4bd3c41f7.zip riscv-openocd-7a80a74e8117332d6fd780f5c4697fe4bd3c41f7.tar.gz riscv-openocd-7a80a74e8117332d6fd780f5c4697fe4bd3c41f7.tar.bz2 |
arm_adi_v5: rewrite dap_to_jtag and dap_to_swd
The functions dap_to_jtag() and dap_to_swd() have been introduced by
3ef9beb52cd0 ("ADIv5 DAP ops switching to JTAG or SWD modes") in
arm_adi_v5.c by using the JTAG queue only.
Later, in 6f8b8593d63b ("ADIv5 transport support moves to separate
files") the functions has been moved in adi_v5_swd.c and adi_v5_jtag.c
but keeping the dependency from JTAG queue.
The functions does not work if the current transport is not JTAG.
Move back the functions in arm_adi_v5.c, replace the input parameter
"target" with "dap", use the transport to detect if the JTAG queue is
present, in case of SWD transport use the proper method, for other
transports report error.
Reuse the ADI v5 sequences already present in jtag/swd.h.
Also, OpenOCD does not support switching to another transport after
the initial selection, so do not change DAP's ops vector.
Change-Id: Ib681fbaa60cb342f732bc831eb92de25afa4e4db
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4852
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Diffstat (limited to 'src/target/arm_adi_v5.h')
-rw-r--r-- | src/target/arm_adi_v5.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index a340b76..96291a7 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -516,10 +516,10 @@ int dap_lookup_cs_component(struct adiv5_ap *ap, struct target; /* Put debug link into SWD mode */ -int dap_to_swd(struct target *target); +int dap_to_swd(struct adiv5_dap *dap); /* Put debug link into JTAG mode */ -int dap_to_jtag(struct target *target); +int dap_to_jtag(struct adiv5_dap *dap); extern const struct command_registration dap_instance_commands[]; |