bitbang: remove superfluous switch between jtag and swd
authorAntonio Borneo <borneo.antonio@gmail.com>
Wed, 1 Apr 2020 07:39:40 +0000 (09:39 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Mon, 13 Jul 2020 22:52:44 +0000 (23:52 +0100)
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
src/jtag/drivers/bcm2835gpio.c
src/jtag/drivers/bitbang.c
src/jtag/drivers/bitbang.h
src/jtag/drivers/imx_gpio.c
src/jtag/drivers/sysfsgpio.c

index df557c5c63826a33543e8f424522cf79d9638440..f547d93a4c49036f302af0753ffd609e52fea076 100644 (file)
@@ -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;
index 72e9320b4c2bfc463846014a18e3340eae3712ce..e5df3cf4074d04e1f4c4c55c2cd0562ea385a04d 100644 (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");
 
@@ -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),
index 7516c24a612a471d08a2501c2ae9aeadba740833..52dfbda3048930ea58d0646872856f366fdeebf0 100644 (file)
@@ -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 */
index 7dcfb6790aea862ce69df92956fccf362a4d2b69..debddedfe3a3b4ddde5fd408800b16b27575dba4 100644 (file)
@@ -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;
index a4d7ad9ec2e82e6352250dd2485450d6121f2f81..f9470a47b3c7b63d3ad3e6e8f4b129dea3d0b0d2 100644 (file)
@@ -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: