bitbang: jtag-only drivers: switch to new reset API 00/5300/3
authorAntonio Borneo <borneo.antonio@gmail.com>
Wed, 4 Sep 2019 14:47:24 +0000 (16:47 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Tue, 14 Jan 2020 11:16:24 +0000 (11:16 +0000)
Remove the JTAG_RESET command from the bitbang execute queue now
that all bitbang drivers have moved away from old reset method.
Remove also the internal reset API in struct bitbang_interface.

Tested parport only.

Change-Id: I12b157ef442f4c9912406b19b7a4d32ba6ec0b53
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5300
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/jtag/drivers/at91rm9200.c
src/jtag/drivers/bitbang.c
src/jtag/drivers/bitbang.h
src/jtag/drivers/dummy.c
src/jtag/drivers/ep93xx.c
src/jtag/drivers/parport.c
src/jtag/drivers/remote_bitbang.c

index ac65563..e2f64f5 100644 (file)
@@ -111,7 +111,6 @@ static uint32_t *pio_base;
  */
 static bb_value_t at91rm9200_read(void);
 static int at91rm9200_write(int tck, int tms, int tdi);
-static int at91rm9200_reset(int trst, int srst);
 
 static int at91rm9200_init(void);
 static int at91rm9200_quit(void);
@@ -119,7 +118,6 @@ static int at91rm9200_quit(void);
 static struct bitbang_interface at91rm9200_bitbang = {
        .read = at91rm9200_read,
        .write = at91rm9200_write,
-       .reset = at91rm9200_reset,
        .blink = 0
 };
 
@@ -196,6 +194,7 @@ struct jtag_interface at91rm9200_interface = {
        .commands = at91rm9200_command_handlers,
        .init = at91rm9200_init,
        .quit = at91rm9200_quit,
+       .reset = at91rm9200_reset,
 };
 
 static int at91rm9200_init(void)
index b5078c0..72e9320 100644 (file)
@@ -314,17 +314,6 @@ int bitbang_execute_queue(void)
 
        while (cmd) {
                switch (cmd->type) {
-                       case JTAG_RESET:
-                               LOG_DEBUG_IO("reset trst: %i srst %i",
-                                               cmd->cmd.reset->trst,
-                                               cmd->cmd.reset->srst);
-                               if ((cmd->cmd.reset->trst == 1) ||
-                                               (cmd->cmd.reset->srst && (jtag_get_reset_config() & RESET_SRST_PULLS_TRST)))
-                                       tap_set_state(TAP_RESET);
-                               if (bitbang_interface->reset(cmd->cmd.reset->trst,
-                                                       cmd->cmd.reset->srst) != ERROR_OK)
-                                       return ERROR_FAIL;
-                               break;
                        case JTAG_RUNTEST:
                                LOG_DEBUG_IO("runtest %i cycles, end in %s",
                                                cmd->cmd.runtest->num_cycles,
index 577717e..edb779c 100644 (file)
@@ -51,7 +51,6 @@ struct bitbang_interface {
 
        /** Set TCK, TMS, and TDI to the given values. */
        int (*write)(int tck, int tms, int tdi);
-       int (*reset)(int trst, int srst);
        int (*blink)(int on);
        int (*swdio_read)(void);
        void (*swdio_drive)(bool on);
index 4e5b615..739213e 100644 (file)
@@ -91,7 +91,6 @@ static int dummy_led(int on)
 static struct bitbang_interface dummy_bitbang = {
                .read = &dummy_read,
                .write = &dummy_write,
-               .reset = &dummy_reset,
                .blink = &dummy_led,
        };
 
@@ -160,4 +159,5 @@ struct jtag_interface dummy_interface = {
 
                .init = &dummy_init,
                .quit = &dummy_quit,
+               .reset = &dummy_reset,
        };
index 4cf3184..dbbfc7a 100644 (file)
@@ -59,12 +59,12 @@ struct jtag_interface ep93xx_interface = {
 
        .init = ep93xx_init,
        .quit = ep93xx_quit,
+       .reset = ep93xx_reset,
 };
 
 static struct bitbang_interface ep93xx_bitbang = {
        .read = ep93xx_read,
        .write = ep93xx_write,
-       .reset = ep93xx_reset,
        .blink = 0,
 };
 
index 8e44dcb..3a589a3 100644 (file)
@@ -260,7 +260,6 @@ static int parport_get_giveio_access(void)
 static struct bitbang_interface parport_bitbang = {
                .read = &parport_read,
                .write = &parport_write,
-               .reset = &parport_reset,
                .blink = &parport_led,
        };
 
@@ -522,6 +521,7 @@ struct jtag_interface parport_interface = {
 
        .init = parport_init,
        .quit = parport_quit,
+       .reset = parport_reset,
        .khz = parport_khz,
        .speed_div = parport_speed_div,
        .speed = parport_speed,
index a354894..70280d2 100644 (file)
@@ -199,7 +199,6 @@ static struct bitbang_interface remote_bitbang_bitbang = {
        .sample = &remote_bitbang_sample,
        .read_sample = &remote_bitbang_read_sample,
        .write = &remote_bitbang_write,
-       .reset = &remote_bitbang_reset,
        .blink = &remote_bitbang_blink,
 };
 
@@ -349,4 +348,5 @@ struct jtag_interface remote_bitbang_interface = {
        .commands = remote_bitbang_command_handlers,
        .init = &remote_bitbang_init,
        .quit = &remote_bitbang_quit,
+       .reset = &remote_bitbang_reset,
 };