aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Norling <jonas.norling@cyanconnode.com>2017-10-25 11:33:06 +0200
committerSpencer Oliver <spen@spen-soft.co.uk>2017-10-27 11:48:36 +0100
commit41092636d1a10d7fe55a986f0d5556a4c34b58d2 (patch)
tree1f306afcfaee38bc40feb589df69511adac63351 /src
parentc0881ba2d5752ce747a4f74daf7531662f9360a9 (diff)
downloadriscv-openocd-41092636d1a10d7fe55a986f0d5556a4c34b58d2.zip
riscv-openocd-41092636d1a10d7fe55a986f0d5556a4c34b58d2.tar.gz
riscv-openocd-41092636d1a10d7fe55a986f0d5556a4c34b58d2.tar.bz2
ftdi: Enable SWDIO output before sending data on it
The SWDIO buffer has to be enabled, by setting SWDIO_OE, for data on SWDIO to reach the target. Explicitly do this before sending the switch sequences for JTAG-to-SWD, etc. This makes the code insensitive to the state of SWDIO_OE specified in ftdi_layout_init. It used to work only on adapters with a non-inverted SWDIO_OE inited to 1, or inverted SWDIO_OE inited to 0. Change-Id: I4b9e520ac1c7ce2a437251a05fc036bc68de718e Signed-off-by: Jonas Norling <jonas.norling@cyanconnode.com> Reviewed-on: http://openocd.zylin.com/4270 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/jtag/drivers/ftdi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c
index 75a3ce4..32876ba 100644
--- a/src/jtag/drivers/ftdi.c
+++ b/src/jtag/drivers/ftdi.c
@@ -1218,14 +1218,17 @@ static int ftdi_swd_switch_seq(enum swd_special_seq seq)
switch (seq) {
case LINE_RESET:
LOG_DEBUG("SWD line reset");
+ ftdi_swd_swdio_en(true);
mpsse_clock_data_out(mpsse_ctx, swd_seq_line_reset, 0, swd_seq_line_reset_len, SWD_MODE);
break;
case JTAG_TO_SWD:
LOG_DEBUG("JTAG-to-SWD");
+ ftdi_swd_swdio_en(true);
mpsse_clock_data_out(mpsse_ctx, swd_seq_jtag_to_swd, 0, swd_seq_jtag_to_swd_len, SWD_MODE);
break;
case SWD_TO_JTAG:
LOG_DEBUG("SWD-to-JTAG");
+ ftdi_swd_swdio_en(true);
mpsse_clock_data_out(mpsse_ctx, swd_seq_swd_to_jtag, 0, swd_seq_swd_to_jtag_len, SWD_MODE);
break;
default: