]> git.sur5r.net Git - openocd/commitdiff
drivers: cmsis_dap_usb: implement cmd JTAG_TMS
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 16 Apr 2018 20:54:22 +0000 (22:54 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Mon, 23 Jul 2018 13:12:10 +0000 (14:12 +0100)
Simply add a wrapper around cmsis_dap_cmd_DAP_SWJ_Sequence()

Change-Id: Icf86f84b24e9fec56e2f9e155396aac34b0e06d2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4517
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/jtag/drivers/cmsis_dap_usb.c

index 231e7c81b71e92c6ecdf0ea805765590023192cc..928389faf6b706c0c9a79d45c38152c118799608 100644 (file)
@@ -1444,6 +1444,12 @@ static void cmsis_dap_execute_stableclocks(struct jtag_command *cmd)
        cmsis_dap_stableclocks(cmd->cmd.runtest->num_cycles);
 }
 
+static void cmsis_dap_execute_tms(struct jtag_command *cmd)
+{
+       DEBUG_JTAG_IO("TMS: %d bits", cmd->cmd.tms->num_bits);
+       cmsis_dap_cmd_DAP_SWJ_Sequence(cmd->cmd.tms->num_bits, cmd->cmd.tms->bits);
+}
+
 /* TODO: Is there need to call cmsis_dap_flush() for the JTAG_PATHMOVE,
  * JTAG_RUNTEST, JTAG_STABLECLOCKS? */
 static void cmsis_dap_execute_command(struct jtag_command *cmd)
@@ -1474,6 +1480,8 @@ static void cmsis_dap_execute_command(struct jtag_command *cmd)
                        cmsis_dap_execute_stableclocks(cmd);
                        break;
                case JTAG_TMS:
+                       cmsis_dap_execute_tms(cmd);
+                       break;
                default:
                        LOG_ERROR("BUG: unknown JTAG command type 0x%X encountered", cmd->type);
                        exit(-1);
@@ -1636,6 +1644,7 @@ static const char * const cmsis_dap_transport[] = { "swd", "jtag", NULL };
 
 struct jtag_interface cmsis_dap_interface = {
        .name = "cmsis-dap",
+       .supported = DEBUG_CAP_TMS_SEQ,
        .commands = cmsis_dap_command_handlers,
        .swd = &cmsis_dap_swd_driver,
        .transports = cmsis_dap_transport,