diff options
author | mrv96 <mrv96@users.noreply.github.com> | 2022-09-19 14:27:10 +0200 |
---|---|---|
committer | mrv96 <mrv96@users.noreply.github.com> | 2022-09-19 20:32:06 +0200 |
commit | 671d99b89bebe74a4d8f8ef198e7b52c15388c3e (patch) | |
tree | 95d7c00501cb1e8d32e7afca4fb0bf7af432b325 | |
parent | b3d64741c2923090bf8fba487450baf175632f24 (diff) | |
download | riscv-openocd-671d99b89bebe74a4d8f8ef198e7b52c15388c3e.zip riscv-openocd-671d99b89bebe74a4d8f8ef198e7b52c15388c3e.tar.gz riscv-openocd-671d99b89bebe74a4d8f8ef198e7b52c15388c3e.tar.bz2 |
Support for custom TMSC buffer
Signed-off-by: mrv96 <mrv96@users.noreply.github.com>
-rw-r--r-- | src/jtag/drivers/ftdi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index 2ecff7f..9eb1994 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -808,6 +808,8 @@ static void oscan1_mpsse_clock_data(struct mpsse_ctx *ctx, const uint8_t *out, u static const uint8_t zero; static const uint8_t one = 1; + struct signal *tmsc_en = find_signal_by_name("TMSC_EN"); + LOG_DEBUG_IO("oscan1_mpsse_clock_data: %sout %d bits", in ? "in" : "", length); for (unsigned i = 0; i < length; i++) { @@ -833,8 +835,14 @@ static void oscan1_mpsse_clock_data(struct mpsse_ctx *ctx, const uint8_t *out, u mpsse_clock_tms_cs_out(mpsse_ctx, &one, 0, 1, false, mode); } + if (tmsc_en) + ftdi_set_signal(tmsc_en, '0'); /* put TMSC in high impedance */ + /* drive another TCK without driving TMSC (TDO cycle) */ mpsse_clock_tms_cs(mpsse_ctx, &zero, 0, in, in_offset+i, 1, false, mode); + + if (tmsc_en) + ftdi_set_signal(tmsc_en, '1'); /* drive again TMSC */ } } @@ -845,6 +853,8 @@ static void oscan1_mpsse_clock_tms_cs(struct mpsse_ctx *ctx, const uint8_t *out, static const uint8_t zero; static const uint8_t one = 1; + struct signal *tmsc_en = find_signal_by_name("TMSC_EN"); + LOG_DEBUG_IO("oscan1_mpsse_clock_tms_cs: %sout %d bits, tdi=%d", in ? "in" : "", length, tdi); for (unsigned i = 0; i < length; i++) { @@ -871,8 +881,14 @@ static void oscan1_mpsse_clock_tms_cs(struct mpsse_ctx *ctx, const uint8_t *out, mpsse_clock_tms_cs_out(mpsse_ctx, &one, 0, 1, (tmsbit != 0), mode); } + if (tmsc_en) + ftdi_set_signal(tmsc_en, '0'); /* put TMSC in high impedance */ + /* drive another TCK without driving TMSC (TDO cycle) */ mpsse_clock_tms_cs(mpsse_ctx, &zero, 0, in, in_offset+i, 1, false, mode); + + if (tmsc_en) + ftdi_set_signal(tmsc_en, '1'); /* drive again TMSC */ } } |