diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2020-04-01 09:39:40 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2020-07-13 23:52:44 +0100 |
commit | 49232a80d2cb1a2e188a037cad94fd760ae64808 (patch) | |
tree | 55248f71d75e793fe1b99b69654ee9f44312b988 /src/jtag/drivers | |
parent | 1f5962203a06803b8ccf4c374b81e45918291f4f (diff) | |
download | riscv-openocd-49232a80d2cb1a2e188a037cad94fd760ae64808.zip riscv-openocd-49232a80d2cb1a2e188a037cad94fd760ae64808.tar.gz riscv-openocd-49232a80d2cb1a2e188a037cad94fd760ae64808.tar.bz2 |
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
Diffstat (limited to 'src/jtag/drivers')
-rw-r--r-- | src/jtag/drivers/bcm2835gpio.c | 1 | ||||
-rw-r--r-- | src/jtag/drivers/bitbang.c | 8 | ||||
-rw-r--r-- | src/jtag/drivers/bitbang.h | 2 | ||||
-rw-r--r-- | src/jtag/drivers/imx_gpio.c | 1 | ||||
-rw-r--r-- | src/jtag/drivers/sysfsgpio.c | 7 |
5 files changed, 1 insertions, 18 deletions
diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c index df557c5..f547d93 100644 --- a/src/jtag/drivers/bcm2835gpio.c +++ b/src/jtag/drivers/bcm2835gpio.c @@ -535,7 +535,6 @@ static int bcm2835gpio_init(void) if (swd_mode) { bcm2835gpio_bitbang.write = bcm2835gpio_swd_write; - bitbang_switch_to_swd(); } return ERROR_OK; diff --git a/src/jtag/drivers/bitbang.c b/src/jtag/drivers/bitbang.c index 72e9320..e5df3cf 100644 --- a/src/jtag/drivers/bitbang.c +++ b/src/jtag/drivers/bitbang.c @@ -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"); @@ -441,12 +441,6 @@ int bitbang_swd_switch_seq(enum swd_special_seq seq) 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) { bitbang_swd_write_reg(swd_cmd(false, false, DP_ABORT), diff --git a/src/jtag/drivers/bitbang.h b/src/jtag/drivers/bitbang.h index 7516c24..52dfbda 100644 --- a/src/jtag/drivers/bitbang.h +++ b/src/jtag/drivers/bitbang.h @@ -71,7 +71,5 @@ extern bool swd_mode; int bitbang_execute_queue(void); 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 */ diff --git a/src/jtag/drivers/imx_gpio.c b/src/jtag/drivers/imx_gpio.c index 7dcfb67..debdded 100644 --- a/src/jtag/drivers/imx_gpio.c +++ b/src/jtag/drivers/imx_gpio.c @@ -552,7 +552,6 @@ static int imx_gpio_init(void) if (swd_mode) { imx_gpio_bitbang.write = imx_gpio_swd_write; - bitbang_switch_to_swd(); } return ERROR_OK; diff --git a/src/jtag/drivers/sysfsgpio.c b/src/jtag/drivers/sysfsgpio.c index a4d7ad9..f9470a4 100644 --- a/src/jtag/drivers/sysfsgpio.c +++ b/src/jtag/drivers/sysfsgpio.c @@ -694,13 +694,6 @@ static int sysfsgpio_init(void) 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; out_error: |