summaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/arm_adi_v5.c')
-rw-r--r--src/target/arm_adi_v5.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 81edba4e..69a3ce7a 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -913,8 +913,12 @@ int ahbap_debugport_init(struct adiv5_dap *dap)
LOG_DEBUG(" ");
- /* JTAG-DP or SWJ-DP, in JTAG mode */
- dap->ops = &jtag_dp_ops;
+ /* JTAG-DP or SWJ-DP, in JTAG mode
+ * ... for SWD mode this is patched as part
+ * of link switchover
+ */
+ if (!dap->ops)
+ dap->ops = &jtag_dp_ops;
/* Default MEM-AP setup.
*