ftdi: add support to switch to/from dormant state

Partially extracted from https://review.openocd.org/4935

Change-Id: Ia3f197b257434a1a7979fdbc08936c7c541db1e2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: graham sanderson <graham.sanderson@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6693
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
This commit is contained in:
Antonio Borneo 2021-11-11 22:29:32 +01:00
parent 560f0d8339
commit fdaa16506d
1 changed files with 20 additions and 0 deletions

View File

@ -1238,11 +1238,31 @@ static int ftdi_swd_switch_seq(enum swd_special_seq seq)
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 JTAG_TO_DORMANT:
LOG_DEBUG("JTAG-to-DORMANT");
ftdi_swd_swdio_en(true);
mpsse_clock_data_out(mpsse_ctx, swd_seq_jtag_to_dormant, 0, swd_seq_jtag_to_dormant_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;
case SWD_TO_DORMANT:
LOG_DEBUG("SWD-to-DORMANT");
ftdi_swd_swdio_en(true);
mpsse_clock_data_out(mpsse_ctx, swd_seq_swd_to_dormant, 0, swd_seq_swd_to_dormant_len, SWD_MODE);
break;
case DORMANT_TO_SWD:
LOG_DEBUG("DORMANT-to-SWD");
ftdi_swd_swdio_en(true);
mpsse_clock_data_out(mpsse_ctx, swd_seq_dormant_to_swd, 0, swd_seq_dormant_to_swd_len, SWD_MODE);
break;
case DORMANT_TO_JTAG:
LOG_DEBUG("DORMANT-to-JTAG");
ftdi_swd_swdio_en(true);
mpsse_clock_data_out(mpsse_ctx, swd_seq_dormant_to_jtag, 0, swd_seq_dormant_to_jtag_len, SWD_MODE);
break;
default:
LOG_ERROR("Sequence %d not supported", seq);
return ERROR_FAIL;