bitbang: remove superfluous switch between jtag and swd

The SWD framework already takes care of switching between JTAG and
SWD by calling driver's switch_seq() in swd_connect() and in
swd_quit(); there is no need for the driver to force the switch
again.

Remove the extra switch between jtag and swd.

Change-Id: I84de4bffb593374b96fce31951c6cc83f92d2578
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5554
Tested-by: jenkins
This commit is contained in:
Antonio Borneo 2020-04-01 09:39:40 +02:00
parent 1f5962203a
commit 49232a80d2
5 changed files with 1 additions and 18 deletions

View File

@ -535,7 +535,6 @@ static int bcm2835gpio_init(void)
if (swd_mode) { if (swd_mode) {
bcm2835gpio_bitbang.write = bcm2835gpio_swd_write; bcm2835gpio_bitbang.write = bcm2835gpio_swd_write;
bitbang_switch_to_swd();
} }
return ERROR_OK; return ERROR_OK;

View File

@ -416,7 +416,7 @@ static void bitbang_exchange(bool rnw, uint8_t buf[], unsigned int offset, unsig
} }
} }
int bitbang_swd_switch_seq(enum swd_special_seq seq) static int bitbang_swd_switch_seq(enum swd_special_seq seq)
{ {
LOG_DEBUG("bitbang_swd_switch_seq"); LOG_DEBUG("bitbang_swd_switch_seq");
@ -441,12 +441,6 @@ int bitbang_swd_switch_seq(enum swd_special_seq seq)
return ERROR_OK; return ERROR_OK;
} }
void bitbang_switch_to_swd(void)
{
LOG_DEBUG("bitbang_switch_to_swd");
bitbang_exchange(false, (uint8_t *)swd_seq_jtag_to_swd, 0, swd_seq_jtag_to_swd_len);
}
static void swd_clear_sticky_errors(void) static void swd_clear_sticky_errors(void)
{ {
bitbang_swd_write_reg(swd_cmd(false, false, DP_ABORT), bitbang_swd_write_reg(swd_cmd(false, false, DP_ABORT),

View File

@ -71,7 +71,5 @@ extern bool swd_mode;
int bitbang_execute_queue(void); int bitbang_execute_queue(void);
extern struct bitbang_interface *bitbang_interface; extern struct bitbang_interface *bitbang_interface;
void bitbang_switch_to_swd(void);
int bitbang_swd_switch_seq(enum swd_special_seq seq);
#endif /* OPENOCD_JTAG_DRIVERS_BITBANG_H */ #endif /* OPENOCD_JTAG_DRIVERS_BITBANG_H */

View File

@ -552,7 +552,6 @@ static int imx_gpio_init(void)
if (swd_mode) { if (swd_mode) {
imx_gpio_bitbang.write = imx_gpio_swd_write; imx_gpio_bitbang.write = imx_gpio_swd_write;
bitbang_switch_to_swd();
} }
return ERROR_OK; return ERROR_OK;

View File

@ -694,13 +694,6 @@ static int sysfsgpio_init(void)
goto out_error; goto out_error;
} }
if (sysfsgpio_swd_mode_possible()) {
if (swd_mode)
bitbang_swd_switch_seq(JTAG_TO_SWD);
else
bitbang_swd_switch_seq(SWD_TO_JTAG);
}
return ERROR_OK; return ERROR_OK;
out_error: out_error: