diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-03-01 08:25:18 +0100 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-03-16 21:44:38 +0100 |
commit | 030ee192dd9647b10ff0841a671facec9d6b833f (patch) | |
tree | 3cc50692355eacbe459e1a7e67ccc538f1b81da8 | |
parent | 679f6602fd1a7e9763bac52f06bbf2db28098d9a (diff) | |
download | riscv-openocd-030ee192dd9647b10ff0841a671facec9d6b833f.zip riscv-openocd-030ee192dd9647b10ff0841a671facec9d6b833f.tar.gz riscv-openocd-030ee192dd9647b10ff0841a671facec9d6b833f.tar.bz2 |
bitbang: add jtag_add_tms_seq support
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-rw-r--r-- | src/jtag/drivers/at91rm9200.c | 1 | ||||
-rw-r--r-- | src/jtag/drivers/bitbang.c | 28 | ||||
-rw-r--r-- | src/jtag/drivers/dummy.c | 1 | ||||
-rw-r--r-- | src/jtag/drivers/ep93xx.c | 1 | ||||
-rw-r--r-- | src/jtag/drivers/parport.c | 1 | ||||
-rw-r--r-- | src/jtag/drivers/usb_blaster.c | 1 |
6 files changed, 33 insertions, 0 deletions
diff --git a/src/jtag/drivers/at91rm9200.c b/src/jtag/drivers/at91rm9200.c index abaf3ad..89d7000 100644 --- a/src/jtag/drivers/at91rm9200.c +++ b/src/jtag/drivers/at91rm9200.c @@ -126,6 +126,7 @@ struct jtag_interface at91rm9200_interface = { .name = "at91rm9200", + .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, .speed = at91rm9200_speed, diff --git a/src/jtag/drivers/bitbang.c b/src/jtag/drivers/bitbang.c index 83c2d29..6159ef7 100644 --- a/src/jtag/drivers/bitbang.c +++ b/src/jtag/drivers/bitbang.c @@ -91,6 +91,31 @@ static void bitbang_state_move(int skip) tap_set_state(tap_get_end_state()); } + +/** + * Clock a bunch of TMS (or SWDIO) transitions, to change the JTAG + * (or SWD) state machine. + */ +static int bitbang_execute_tms(struct jtag_command *cmd) +{ + unsigned num_bits = cmd->cmd.tms->num_bits; + const uint8_t *bits = cmd->cmd.tms->bits; + + DEBUG_JTAG_IO("TMS: %d bits", num_bits); + + int tms = 0; + for (unsigned i = 0; i < num_bits; i++) + { + tms = ((bits[i/8] >> (i % 8)) & 1); + bitbang_interface->write(0, tms, 0); + bitbang_interface->write(1, tms, 0); + } + bitbang_interface->write(CLOCK_IDLE(), tms, 0); + + return ERROR_OK; +} + + static void bitbang_path_move(struct pathmove_command *cmd) { int num_states = cmd->num_states; @@ -312,6 +337,9 @@ int bitbang_execute_queue(void) #endif jtag_sleep(cmd->cmd.sleep->us); break; + case JTAG_TMS: + retval = bitbang_execute_tms(cmd); + break; default: LOG_ERROR("BUG: unknown JTAG command type encountered"); exit(-1); diff --git a/src/jtag/drivers/dummy.c b/src/jtag/drivers/dummy.c index 1880712..7cb0e33 100644 --- a/src/jtag/drivers/dummy.c +++ b/src/jtag/drivers/dummy.c @@ -164,6 +164,7 @@ static const struct command_registration dummy_command_handlers[] = { struct jtag_interface dummy_interface = { .name = "dummy", + .supported = DEBUG_CAP_TMS_SEQ, .commands = dummy_command_handlers, .execute_queue = &bitbang_execute_queue, diff --git a/src/jtag/drivers/ep93xx.c b/src/jtag/drivers/ep93xx.c index 61dc76e..0959a56 100644 --- a/src/jtag/drivers/ep93xx.c +++ b/src/jtag/drivers/ep93xx.c @@ -57,6 +57,7 @@ struct jtag_interface ep93xx_interface = { .name = "ep93xx", + .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, .speed = ep93xx_speed, diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index fa3373b..2323ec5 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -524,6 +524,7 @@ static const struct command_registration parport_command_handlers[] = { struct jtag_interface parport_interface = { .name = "parport", + .supported = DEBUG_CAP_TMS_SEQ, .commands = parport_command_handlers, .init = parport_init, diff --git a/src/jtag/drivers/usb_blaster.c b/src/jtag/drivers/usb_blaster.c index 3703323..59c5715 100644 --- a/src/jtag/drivers/usb_blaster.c +++ b/src/jtag/drivers/usb_blaster.c @@ -580,6 +580,7 @@ static const struct command_registration usb_blaster_command_handlers[] = { struct jtag_interface usb_blaster_interface = { .name = "usb_blaster", .commands = usb_blaster_command_handlers, + .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, |