From: OpenOCD-Gerrit <ope...@us...> - 2021-11-20 14:35:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via b4aa144c326e2f86f52ac48d4cb560f88a1f2b97 (commit) from ed44acce26edf259f5b238b972a6a4fe2597ca48 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b4aa144c326e2f86f52ac48d4cb560f88a1f2b97 Author: Antonio Borneo <bor...@gm...> Date: Thu Nov 11 16:44:27 2021 +0100 drivers/bitbang: add support to switch to/from dormant state While there, replace the SWD_CMD_PARK macro to the magic number. Change-Id: Id9094dcb2b010b9e894a5ed9e4a99d2287e5969c Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6691 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/jtag/drivers/bitbang.c b/src/jtag/drivers/bitbang.c index 5c4febb20..d202a0596 100644 --- a/src/jtag/drivers/bitbang.c +++ b/src/jtag/drivers/bitbang.c @@ -434,10 +434,26 @@ static int bitbang_swd_switch_seq(enum swd_special_seq seq) LOG_DEBUG("JTAG-to-SWD"); bitbang_swd_exchange(false, (uint8_t *)swd_seq_jtag_to_swd, 0, swd_seq_jtag_to_swd_len); break; + case JTAG_TO_DORMANT: + LOG_DEBUG("JTAG-to-DORMANT"); + bitbang_swd_exchange(false, (uint8_t *)swd_seq_jtag_to_dormant, 0, swd_seq_jtag_to_dormant_len); + break; case SWD_TO_JTAG: LOG_DEBUG("SWD-to-JTAG"); bitbang_swd_exchange(false, (uint8_t *)swd_seq_swd_to_jtag, 0, swd_seq_swd_to_jtag_len); break; + case SWD_TO_DORMANT: + LOG_DEBUG("SWD-to-DORMANT"); + bitbang_swd_exchange(false, (uint8_t *)swd_seq_swd_to_dormant, 0, swd_seq_swd_to_dormant_len); + break; + case DORMANT_TO_SWD: + LOG_DEBUG("DORMANT-to-SWD"); + bitbang_swd_exchange(false, (uint8_t *)swd_seq_dormant_to_swd, 0, swd_seq_dormant_to_swd_len); + break; + case DORMANT_TO_JTAG: + LOG_DEBUG("DORMANT-to-JTAG"); + bitbang_swd_exchange(false, (uint8_t *)swd_seq_dormant_to_jtag, 0, swd_seq_dormant_to_jtag_len); + break; default: LOG_ERROR("Sequence %d not supported", seq); return ERROR_FAIL; @@ -465,7 +481,7 @@ static void bitbang_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_delay for (;;) { uint8_t trn_ack_data_parity_trn[DIV_ROUND_UP(4 + 3 + 32 + 1 + 4, 8)]; - cmd |= SWD_CMD_START | (1 << 7); + cmd |= SWD_CMD_START | SWD_CMD_PARK; bitbang_swd_exchange(false, &cmd, 0, 8); bitbang_interface->swdio_drive(false); @@ -526,7 +542,7 @@ static void bitbang_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay buf_set_u32(trn_ack_data_parity_trn, 1 + 3 + 1, 32, value); buf_set_u32(trn_ack_data_parity_trn, 1 + 3 + 1 + 32, 1, parity_u32(value)); - cmd |= SWD_CMD_START | (1 << 7); + cmd |= SWD_CMD_START | SWD_CMD_PARK; bitbang_swd_exchange(false, &cmd, 0, 8); bitbang_interface->swdio_drive(false); ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/bitbang.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |