1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
5 * Copyright (C) 2007,2008 Øyvind Harboe *
6 * oyvind.harboe@zylin.com *
8 * Copyright (C) 2009 SoftPLC Corporation *
12 * Copyright (C) 2009 Zachary T Welch *
13 * zw@superlucidity.net *
15 * This program is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; either version 2 of the License, or *
18 * (at your option) any later version. *
20 * This program is distributed in the hope that it will be useful, *
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
23 * GNU General Public License for more details. *
25 * You should have received a copy of the GNU General Public License *
26 * along with this program; if not, write to the *
27 * Free Software Foundation, Inc., *
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
29 ***************************************************************************/
35 #include "minidriver.h"
36 #include "interface.h"
37 #include "interfaces.h"
43 static const Jim_Nvp nvp_jtag_tap_event
[] = {
44 { .value
= JTAG_TRST_ASSERTED
, .name
= "post-reset" },
45 { .value
= JTAG_TAP_EVENT_SETUP
, .name
= "setup" },
46 { .value
= JTAG_TAP_EVENT_ENABLE
, .name
= "tap-enable" },
47 { .value
= JTAG_TAP_EVENT_DISABLE
, .name
= "tap-disable" },
49 { .name
= NULL
, .value
= -1 }
52 extern jtag_interface_t
*jtag_interface
;
55 static int handle_interface_list_command(struct command_context_s
*cmd_ctx
,
56 char *cmd
, char **args
, int argc
);
57 static int handle_interface_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
58 static int handle_jtag_speed_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
59 static int handle_jtag_khz_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
60 static int handle_jtag_rclk_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
61 static int handle_jtag_device_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
62 static int handle_reset_config_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
63 static int handle_jtag_nsrst_delay_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
64 static int handle_jtag_ntrst_delay_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
65 static int handle_jtag_nsrst_assert_width_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
66 static int handle_jtag_ntrst_assert_width_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
68 static int handle_scan_chain_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
70 static int handle_jtag_reset_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
71 static int handle_runtest_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
72 static int handle_irscan_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
73 static int Jim_Command_drscan(Jim_Interp
*interp
, int argc
, Jim_Obj
*const *argv
);
74 static int Jim_Command_pathmove(Jim_Interp
*interp
, int argc
, Jim_Obj
*const *argv
);
75 static int Jim_Command_flush_count(Jim_Interp
*interp
, int argc
, Jim_Obj
*const *args
);
77 static int handle_verify_ircapture_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
78 static int handle_verify_jtag_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
79 static int handle_tms_sequence_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
);
82 enum jtag_tap_cfg_param
{
86 static Jim_Nvp nvp_config_opts
[] = {
87 { .name
= "-event", .value
= JCFG_EVENT
},
89 { .name
= NULL
, .value
= -1 }
92 static int jtag_tap_configure_cmd(Jim_GetOptInfo
*goi
, jtag_tap_t
* tap
)
98 /* parse config or cget options */
99 while (goi
->argc
> 0) {
100 Jim_SetEmptyResult (goi
->interp
);
102 e
= Jim_GetOpt_Nvp(goi
, nvp_config_opts
, &n
);
104 Jim_GetOpt_NvpUnknown(goi
, nvp_config_opts
, 0);
110 if (goi
->argc
== 0) {
111 Jim_WrongNumArgs(goi
->interp
, goi
->argc
, goi
->argv
, "-event ?event-name? ...");
115 e
= Jim_GetOpt_Nvp(goi
, nvp_jtag_tap_event
, &n
);
117 Jim_GetOpt_NvpUnknown(goi
, nvp_jtag_tap_event
, 1);
121 if (goi
->isconfigure
) {
122 if (goi
->argc
!= 1) {
123 Jim_WrongNumArgs(goi
->interp
, goi
->argc
, goi
->argv
, "-event ?event-name? ?EVENT-BODY?");
127 if (goi
->argc
!= 0) {
128 Jim_WrongNumArgs(goi
->interp
, goi
->argc
, goi
->argv
, "-event ?event-name?");
134 jtag_tap_event_action_t
*jteap
;
136 jteap
= tap
->event_action
;
137 /* replace existing? */
139 if (jteap
->event
== (enum jtag_event
)n
->value
) {
145 if (goi
->isconfigure
) {
149 jteap
= calloc(1, sizeof (*jteap
));
152 jteap
->event
= n
->value
;
153 Jim_GetOpt_Obj(goi
, &o
);
155 Jim_DecrRefCount(interp
, jteap
->body
);
157 jteap
->body
= Jim_DuplicateObj(goi
->interp
, o
);
158 Jim_IncrRefCount(jteap
->body
);
162 /* add to head of event list */
163 jteap
->next
= tap
->event_action
;
164 tap
->event_action
= jteap
;
166 Jim_SetEmptyResult(goi
->interp
);
170 Jim_SetEmptyResult(goi
->interp
);
172 Jim_SetResult(goi
->interp
, Jim_DuplicateObj(goi
->interp
, jteap
->body
));
179 } /* while (goi->argc) */
184 static int is_bad_irval(int ir_length
, jim_wide w
)
194 static int jim_newtap_cmd(Jim_GetOptInfo
*goi
)
202 const Jim_Nvp opts
[] = {
203 #define NTAP_OPT_IRLEN 0
204 { .name
= "-irlen" , .value
= NTAP_OPT_IRLEN
},
205 #define NTAP_OPT_IRMASK 1
206 { .name
= "-irmask" , .value
= NTAP_OPT_IRMASK
},
207 #define NTAP_OPT_IRCAPTURE 2
208 { .name
= "-ircapture" , .value
= NTAP_OPT_IRCAPTURE
},
209 #define NTAP_OPT_ENABLED 3
210 { .name
= "-enable" , .value
= NTAP_OPT_ENABLED
},
211 #define NTAP_OPT_DISABLED 4
212 { .name
= "-disable" , .value
= NTAP_OPT_DISABLED
},
213 #define NTAP_OPT_EXPECTED_ID 5
214 { .name
= "-expected-id" , .value
= NTAP_OPT_EXPECTED_ID
},
215 { .name
= NULL
, .value
= -1 },
218 pTap
= calloc(1, sizeof(jtag_tap_t
));
220 Jim_SetResult_sprintf(goi
->interp
, "no memory");
225 * we expect CHIP + TAP + OPTIONS
228 Jim_SetResult_sprintf(goi
->interp
, "Missing CHIP TAP OPTIONS ....");
232 Jim_GetOpt_String(goi
, &cp
, NULL
);
233 pTap
->chip
= strdup(cp
);
235 Jim_GetOpt_String(goi
, &cp
, NULL
);
236 pTap
->tapname
= strdup(cp
);
238 /* name + dot + name + null */
239 x
= strlen(pTap
->chip
) + 1 + strlen(pTap
->tapname
) + 1;
241 sprintf(cp
, "%s.%s", pTap
->chip
, pTap
->tapname
);
242 pTap
->dotted_name
= cp
;
244 LOG_DEBUG("Creating New Tap, Chip: %s, Tap: %s, Dotted: %s, %d params",
245 pTap
->chip
, pTap
->tapname
, pTap
->dotted_name
, goi
->argc
);
247 /* IEEE specifies that the two LSBs of an IR scan are 01, so make
248 * that the default. The "-irlen" and "-irmask" options are only
249 * needed to cope with nonstandard TAPs, or to specify more bits.
251 pTap
->ir_capture_mask
= 0x03;
252 pTap
->ir_capture_value
= 0x01;
255 e
= Jim_GetOpt_Nvp(goi
, opts
, &n
);
257 Jim_GetOpt_NvpUnknown(goi
, opts
, 0);
258 free((void *)pTap
->dotted_name
);
262 LOG_DEBUG("Processing option: %s", n
->name
);
264 case NTAP_OPT_ENABLED
:
265 pTap
->disabled_after_reset
= false;
267 case NTAP_OPT_DISABLED
:
268 pTap
->disabled_after_reset
= true;
270 case NTAP_OPT_EXPECTED_ID
:
272 uint32_t *new_expected_ids
;
274 e
= Jim_GetOpt_Wide(goi
, &w
);
276 Jim_SetResult_sprintf(goi
->interp
, "option: %s bad parameter", n
->name
);
277 free((void *)pTap
->dotted_name
);
282 new_expected_ids
= malloc(sizeof(uint32_t) * (pTap
->expected_ids_cnt
+ 1));
283 if (new_expected_ids
== NULL
) {
284 Jim_SetResult_sprintf(goi
->interp
, "no memory");
285 free((void *)pTap
->dotted_name
);
290 memcpy(new_expected_ids
, pTap
->expected_ids
, sizeof(uint32_t) * pTap
->expected_ids_cnt
);
292 new_expected_ids
[pTap
->expected_ids_cnt
] = w
;
294 free(pTap
->expected_ids
);
295 pTap
->expected_ids
= new_expected_ids
;
296 pTap
->expected_ids_cnt
++;
300 case NTAP_OPT_IRMASK
:
301 case NTAP_OPT_IRCAPTURE
:
302 e
= Jim_GetOpt_Wide(goi
, &w
);
304 Jim_SetResult_sprintf(goi
->interp
, "option: %s bad parameter", n
->name
);
305 free((void *)pTap
->dotted_name
);
311 if (w
> (jim_wide
) (8 * sizeof(pTap
->ir_capture_value
)))
312 LOG_WARNING("%s: huge IR length %d",
317 case NTAP_OPT_IRMASK
:
318 if (is_bad_irval(pTap
->ir_length
, w
)) {
319 LOG_ERROR("%s: IR mask %x too big",
322 free((void *)pTap
->dotted_name
);
327 LOG_WARNING("%s: nonstandard IR mask",
329 pTap
->ir_capture_mask
= w
;
331 case NTAP_OPT_IRCAPTURE
:
332 if (is_bad_irval(pTap
->ir_length
, w
)) {
333 LOG_ERROR("%s: IR capture %x too big",
336 free((void *)pTap
->dotted_name
);
341 LOG_WARNING("%s: nonstandard IR value",
343 pTap
->ir_capture_value
= w
;
346 } /* switch (n->value) */
347 } /* while (goi->argc) */
349 /* default is enabled-after-reset */
350 pTap
->enabled
= !pTap
->disabled_after_reset
;
352 /* Did all the required option bits get cleared? */
353 if (pTap
->ir_length
!= 0)
359 Jim_SetResult_sprintf(goi
->interp
,
360 "newtap: %s missing IR length",
366 static void jtag_tap_handle_event(jtag_tap_t
*tap
, enum jtag_event e
)
368 jtag_tap_event_action_t
* jteap
;
370 for (jteap
= tap
->event_action
; jteap
!= NULL
; jteap
= jteap
->next
) {
371 if (jteap
->event
== e
) {
372 LOG_DEBUG("JTAG tap: %s event: %d (%s)\n\taction: %s",
375 Jim_Nvp_value2name_simple(nvp_jtag_tap_event
, e
)->name
,
376 Jim_GetString(jteap
->body
, NULL
));
377 if (Jim_EvalObj(interp
, jteap
->body
) != JIM_OK
) {
378 Jim_PrintErrorMessage(interp
);
380 case JTAG_TAP_EVENT_ENABLE
:
381 case JTAG_TAP_EVENT_DISABLE
:
382 /* NOTE: we currently assume the handlers
383 * can't fail. Right here is where we should
384 * really be verifying the scan chains ...
386 tap
->enabled
= (e
== JTAG_TAP_EVENT_ENABLE
);
387 LOG_INFO("JTAG tap: %s %s", tap
->dotted_name
,
388 tap
->enabled
? "enabled" : "disabled");
398 static int jim_jtag_command(Jim_Interp
*interp
, int argc
, Jim_Obj
*const *argv
)
404 struct command_context_s
*context
;
413 JTAG_CMD_TAPISENABLED
,
419 const Jim_Nvp jtag_cmds
[] = {
420 { .name
= "interface" , .value
= JTAG_CMD_INTERFACE
},
421 { .name
= "arp_init" , .value
= JTAG_CMD_INIT
},
422 { .name
= "arp_init-reset", .value
= JTAG_CMD_INIT_RESET
},
423 { .name
= "newtap" , .value
= JTAG_CMD_NEWTAP
},
424 { .name
= "tapisenabled" , .value
= JTAG_CMD_TAPISENABLED
},
425 { .name
= "tapenable" , .value
= JTAG_CMD_TAPENABLE
},
426 { .name
= "tapdisable" , .value
= JTAG_CMD_TAPDISABLE
},
427 { .name
= "configure" , .value
= JTAG_CMD_CONFIGURE
},
428 { .name
= "cget" , .value
= JTAG_CMD_CGET
},
429 { .name
= "names" , .value
= JTAG_CMD_NAMES
},
431 { .name
= NULL
, .value
= -1 },
434 context
= Jim_GetAssocData(interp
, "context");
435 /* go past the command */
436 Jim_GetOpt_Setup(&goi
, interp
, argc
-1, argv
+ 1);
438 e
= Jim_GetOpt_Nvp(&goi
, jtag_cmds
, &n
);
440 Jim_GetOpt_NvpUnknown(&goi
, jtag_cmds
, 0);
443 Jim_SetEmptyResult(goi
.interp
);
445 case JTAG_CMD_INTERFACE
:
446 /* return the name of the interface */
447 /* TCL code might need to know the exact type... */
448 /* FUTURE: we allow this as a means to "set" the interface. */
450 Jim_WrongNumArgs(goi
.interp
, 1, goi
.argv
-1, "(no params)");
453 Jim_SetResultString(goi
.interp
, jtag_interface
->name
, -1);
457 Jim_WrongNumArgs(goi
.interp
, 1, goi
.argv
-1, "(no params)");
460 e
= jtag_init_inner(context
);
462 Jim_SetResult_sprintf(goi
.interp
, "error: %d", e
);
466 case JTAG_CMD_INIT_RESET
:
468 Jim_WrongNumArgs(goi
.interp
, 1, goi
.argv
-1, "(no params)");
471 e
= jtag_init_reset(context
);
473 Jim_SetResult_sprintf(goi
.interp
, "error: %d", e
);
477 case JTAG_CMD_NEWTAP
:
478 return jim_newtap_cmd(&goi
);
480 case JTAG_CMD_TAPISENABLED
:
481 case JTAG_CMD_TAPENABLE
:
482 case JTAG_CMD_TAPDISABLE
:
484 Jim_SetResultString(goi
.interp
, "Too many parameters",-1);
491 t
= jtag_tap_by_jim_obj(goi
.interp
, goi
.argv
[0]);
496 case JTAG_CMD_TAPISENABLED
:
498 case JTAG_CMD_TAPENABLE
:
501 jtag_tap_handle_event(t
, JTAG_TAP_EVENT_ENABLE
);
505 /* FIXME add JTAG sanity checks, w/o TLR
506 * - scan chain length grew by one (this)
507 * - IDs and IR lengths are as expected
510 jtag_call_event_callbacks(JTAG_TAP_EVENT_ENABLE
);
512 case JTAG_CMD_TAPDISABLE
:
515 jtag_tap_handle_event(t
, JTAG_TAP_EVENT_DISABLE
);
519 /* FIXME add JTAG sanity checks, w/o TLR
520 * - scan chain length shrank by one (this)
521 * - IDs and IR lengths are as expected
524 jtag_call_event_callbacks(JTAG_TAP_EVENT_DISABLE
);
528 Jim_SetResult(goi
.interp
, Jim_NewIntObj(goi
.interp
, e
));
535 Jim_WrongNumArgs(goi
.interp
, 0, NULL
,
536 "cget tap_name queryparm");
543 Jim_GetOpt_Obj(&goi
, &o
);
544 t
= jtag_tap_by_jim_obj(goi
.interp
, o
);
550 return jtag_tap_configure_cmd(&goi
, t
);
554 case JTAG_CMD_CONFIGURE
:
556 Jim_WrongNumArgs(goi
.interp
, 0, NULL
,
557 "configure tap_name attribute value ...");
564 Jim_GetOpt_Obj(&goi
, &o
);
565 t
= jtag_tap_by_jim_obj(goi
.interp
, o
);
571 return jtag_tap_configure_cmd(&goi
, t
);
577 Jim_WrongNumArgs(goi
.interp
, 1, goi
.argv
, "Too many parameters");
580 Jim_SetResult(goi
.interp
, Jim_NewListObj(goi
.interp
, NULL
, 0));
584 for (tap
= jtag_all_taps(); tap
; tap
= tap
->next_tap
) {
585 Jim_ListAppendElement(goi
.interp
,
586 Jim_GetResult(goi
.interp
),
587 Jim_NewStringObj(goi
.interp
,
588 tap
->dotted_name
, -1));
600 void jtag_notify_event(enum jtag_event event
)
604 for (tap
= jtag_all_taps(); tap
; tap
= tap
->next_tap
)
605 jtag_tap_handle_event(tap
, event
);
609 int jtag_register_commands(struct command_context_s
*cmd_ctx
)
611 register_jim(cmd_ctx
, "jtag", jim_jtag_command
, "perform jtag tap actions");
613 register_command(cmd_ctx
, NULL
, "interface", handle_interface_command
,
614 COMMAND_CONFIG
, "try to configure interface");
615 register_command(cmd_ctx
, NULL
,
616 "interface_list", &handle_interface_list_command
,
617 COMMAND_ANY
, "list all built-in interfaces");
618 register_command(cmd_ctx
, NULL
, "jtag_speed", handle_jtag_speed_command
,
619 COMMAND_ANY
, "(DEPRECATED) set jtag speed (if supported)");
620 register_command(cmd_ctx
, NULL
, "jtag_khz", handle_jtag_khz_command
,
621 COMMAND_ANY
, "set maximum jtag speed (if supported); "
622 "parameter is maximum khz, or 0 for adaptive clocking (RTCK).");
623 register_command(cmd_ctx
, NULL
, "jtag_rclk", handle_jtag_rclk_command
,
624 COMMAND_ANY
, "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed");
625 register_command(cmd_ctx
, NULL
, "jtag_device", handle_jtag_device_command
,
626 COMMAND_CONFIG
, "(DEPRECATED) jtag_device <ir_length> <ir_expected> <ir_mask>");
627 register_command(cmd_ctx
, NULL
, "reset_config", handle_reset_config_command
,
630 "[none|trst_only|srst_only|trst_and_srst] "
631 "[srst_pulls_trst|trst_pulls_srst|combined|separate] "
632 "[srst_gates_jtag|srst_nogate] "
633 "[trst_push_pull|trst_open_drain] "
634 "[srst_push_pull|srst_open_drain]");
635 register_command(cmd_ctx
, NULL
, "jtag_nsrst_delay", handle_jtag_nsrst_delay_command
,
636 COMMAND_ANY
, "jtag_nsrst_delay <ms> - delay after deasserting srst in ms");
637 register_command(cmd_ctx
, NULL
, "jtag_ntrst_delay", handle_jtag_ntrst_delay_command
,
638 COMMAND_ANY
, "jtag_ntrst_delay <ms> - delay after deasserting trst in ms");
639 register_command(cmd_ctx
, NULL
, "jtag_nsrst_assert_width", handle_jtag_nsrst_assert_width_command
,
640 COMMAND_ANY
, "jtag_nsrst_assert_width <ms> - delay after asserting srst in ms");
641 register_command(cmd_ctx
, NULL
, "jtag_ntrst_assert_width", handle_jtag_ntrst_assert_width_command
,
642 COMMAND_ANY
, "jtag_ntrst_assert_width <ms> - delay after asserting trst in ms");
644 register_command(cmd_ctx
, NULL
, "scan_chain", handle_scan_chain_command
,
645 COMMAND_EXEC
, "print current scan chain configuration");
647 register_command(cmd_ctx
, NULL
, "jtag_reset", handle_jtag_reset_command
,
648 COMMAND_EXEC
, "toggle reset lines <trst> <srst>");
649 register_command(cmd_ctx
, NULL
, "runtest", handle_runtest_command
,
650 COMMAND_EXEC
, "move to Run-Test/Idle, and execute <num_cycles>");
651 register_command(cmd_ctx
, NULL
, "irscan", handle_irscan_command
,
652 COMMAND_EXEC
, "execute IR scan <device> <instr> [dev2] [instr2] ...");
653 register_jim(cmd_ctx
, "drscan", Jim_Command_drscan
, "execute DR scan <device> <num_bits> <value> <num_bits1> <value2> ...");
654 register_jim(cmd_ctx
, "flush_count", Jim_Command_flush_count
, "returns number of times the JTAG queue has been flushed");
655 register_jim(cmd_ctx
, "pathmove", Jim_Command_pathmove
, "move JTAG to state1 then to state2, state3, etc. <state1>,<state2>,<stat3>...");
657 register_command(cmd_ctx
, NULL
, "verify_ircapture", handle_verify_ircapture_command
,
658 COMMAND_ANY
, "verify value captured during Capture-IR <enable | disable>");
659 register_command(cmd_ctx
, NULL
, "verify_jtag", handle_verify_jtag_command
,
660 COMMAND_ANY
, "verify value capture <enable | disable>");
661 register_command(cmd_ctx
, NULL
, "tms_sequence", handle_tms_sequence_command
,
662 COMMAND_ANY
, "choose short(default) or long tms_sequence <short | long>");
666 static int default_khz(int khz
, int *jtag_speed
)
668 LOG_ERROR("Translation from khz to jtag_speed not implemented");
672 static int default_speed_div(int speed
, int *khz
)
674 LOG_ERROR("Translation from jtag_speed to khz not implemented");
678 static int default_power_dropout(int *dropout
)
680 *dropout
= 0; /* by default we can't detect power dropout */
684 static int default_srst_asserted(int *srst_asserted
)
686 *srst_asserted
= 0; /* by default we can't detect srst asserted */
690 static int handle_interface_command(struct command_context_s
*cmd_ctx
,
691 char *cmd
, char **args
, int argc
)
693 /* check whether the interface is already configured */
696 LOG_WARNING("Interface already configured, ignoring");
700 /* interface name is a mandatory argument */
701 if (argc
!= 1 || args
[0][0] == '\0')
702 return ERROR_COMMAND_SYNTAX_ERROR
;
704 for (unsigned i
= 0; NULL
!= jtag_interfaces
[i
]; i
++)
706 if (strcmp(args
[0], jtag_interfaces
[i
]->name
) != 0)
709 int retval
= jtag_interfaces
[i
]->register_commands(cmd_ctx
);
710 if (ERROR_OK
!= retval
)
713 jtag_interface
= jtag_interfaces
[i
];
715 if (jtag_interface
->khz
== NULL
)
716 jtag_interface
->khz
= default_khz
;
717 if (jtag_interface
->speed_div
== NULL
)
718 jtag_interface
->speed_div
= default_speed_div
;
719 if (jtag_interface
->power_dropout
== NULL
)
720 jtag_interface
->power_dropout
= default_power_dropout
;
721 if (jtag_interface
->srst_asserted
== NULL
)
722 jtag_interface
->srst_asserted
= default_srst_asserted
;
727 /* no valid interface was found (i.e. the configuration option,
728 * didn't match one of the compiled-in interfaces
730 LOG_ERROR("The specified JTAG interface was not found (%s)", args
[0]);
731 handle_interface_list_command(cmd_ctx
, cmd
, args
, argc
);
732 return ERROR_JTAG_INVALID_INTERFACE
;
735 static int handle_interface_list_command(struct command_context_s
*cmd_ctx
,
736 char *cmd
, char **args
, int argc
)
738 if (strcmp(cmd
, "interface_list") == 0 && argc
> 0)
739 return ERROR_COMMAND_SYNTAX_ERROR
;
741 command_print(cmd_ctx
, "The following JTAG interfaces are available:");
742 for (unsigned i
= 0; NULL
!= jtag_interfaces
[i
]; i
++)
744 const char *name
= jtag_interfaces
[i
]->name
;
745 command_print(cmd_ctx
, "%u: %s", i
+ 1, name
);
751 static int handle_jtag_device_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
755 Jim_Obj
*newargs
[ 10 ];
759 * argv[ 0] = ir length
760 * argv[ 1] = ir capture
762 * argv[ 3] = not actually used by anything but in the docs
766 command_print(cmd_ctx
, "OLD DEPRECATED SYNTAX: Please use the NEW syntax");
769 command_print(cmd_ctx
, "OLD SYNTAX: DEPRECATED - translating to new syntax");
770 command_print(cmd_ctx
, "jtag newtap CHIP TAP -irlen %s -ircapture %s -irvalue %s",
774 command_print(cmd_ctx
, "Example: STM32 has 2 taps, the cortexM3(len4) + boundaryscan(len5)");
775 command_print(cmd_ctx
, "jtag newtap stm32 cortexm3 ....., thus creating the tap: \"stm32.cortexm3\"");
776 command_print(cmd_ctx
, "jtag newtap stm32 boundary ....., and the tap: \"stm32.boundary\"");
777 command_print(cmd_ctx
, "And then refer to the taps by the dotted name.");
779 newargs
[0] = Jim_NewStringObj(interp
, "jtag", -1);
780 newargs
[1] = Jim_NewStringObj(interp
, "newtap", -1);
781 sprintf(buf
, "chip%d", jtag_tap_count());
782 newargs
[2] = Jim_NewStringObj(interp
, buf
, -1);
783 sprintf(buf
, "tap%d", jtag_tap_count());
784 newargs
[3] = Jim_NewStringObj(interp
, buf
, -1);
785 newargs
[4] = Jim_NewStringObj(interp
, "-irlen", -1);
786 newargs
[5] = Jim_NewStringObj(interp
, args
[0], -1);
787 newargs
[6] = Jim_NewStringObj(interp
, "-ircapture", -1);
788 newargs
[7] = Jim_NewStringObj(interp
, args
[1], -1);
789 newargs
[8] = Jim_NewStringObj(interp
, "-irmask", -1);
790 newargs
[9] = Jim_NewStringObj(interp
, args
[2], -1);
792 command_print(cmd_ctx
, "NEW COMMAND:");
793 sprintf(buf
, "%s %s %s %s %s %s %s %s %s %s",
794 Jim_GetString(newargs
[0], NULL
),
795 Jim_GetString(newargs
[1], NULL
),
796 Jim_GetString(newargs
[2], NULL
),
797 Jim_GetString(newargs
[3], NULL
),
798 Jim_GetString(newargs
[4], NULL
),
799 Jim_GetString(newargs
[5], NULL
),
800 Jim_GetString(newargs
[6], NULL
),
801 Jim_GetString(newargs
[7], NULL
),
802 Jim_GetString(newargs
[8], NULL
),
803 Jim_GetString(newargs
[9], NULL
));
805 e
= jim_jtag_command(interp
, 10, newargs
);
807 command_print(cmd_ctx
, "%s", Jim_GetString(Jim_GetResult(interp
), NULL
));
812 static int handle_scan_chain_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
816 tap
= jtag_all_taps();
817 command_print(cmd_ctx
, " TapName | Enabled | IdCode Expected IrLen IrCap IrMask Instr ");
818 command_print(cmd_ctx
, "---|--------------------|---------|------------|------------|------|------|------|---------");
821 uint32_t expected
, expected_mask
, cur_instr
, ii
;
822 expected
= buf_get_u32(tap
->expected
, 0, tap
->ir_length
);
823 expected_mask
= buf_get_u32(tap
->expected_mask
, 0, tap
->ir_length
);
824 cur_instr
= buf_get_u32(tap
->cur_instr
, 0, tap
->ir_length
);
826 command_print(cmd_ctx
,
827 "%2d | %-18s | %c | 0x%08x | 0x%08x | 0x%02x | 0x%02x | 0x%02x | 0x%02x",
828 tap
->abs_chain_position
,
830 tap
->enabled
? 'Y' : 'n',
831 (unsigned int)(tap
->idcode
),
832 (unsigned int)(tap
->expected_ids_cnt
> 0 ? tap
->expected_ids
[0] : 0),
833 (unsigned int)(tap
->ir_length
),
834 (unsigned int)(expected
),
835 (unsigned int)(expected_mask
),
836 (unsigned int)(cur_instr
));
838 for (ii
= 1; ii
< tap
->expected_ids_cnt
; ii
++) {
839 command_print(cmd_ctx
, " | | | | 0x%08x | | | | ",
840 (unsigned int)(tap
->expected_ids
[ii
]));
849 static int handle_reset_config_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
854 /* Original versions cared about the order of these tokens:
855 * reset_config signals [combination [trst_type [srst_type]]]
856 * They also clobbered the previous configuration even on error.
858 * Here we don't care about the order, and only change values
859 * which have been explicitly specified.
861 for (; argc
; argc
--, args
++) {
866 m
= RESET_SRST_NO_GATING
;
867 if (strcmp(*args
, "srst_gates_jtag") == 0)
868 /* default: don't use JTAG while SRST asserted */;
869 else if (strcmp(*args
, "srst_nogate") == 0)
870 tmp
= RESET_SRST_NO_GATING
;
874 LOG_ERROR("extra reset_config %s spec (%s)",
876 return ERROR_INVALID_ARGUMENTS
;
882 m
= RESET_HAS_TRST
| RESET_HAS_SRST
;
883 if (strcmp(*args
, "none") == 0)
885 else if (strcmp(*args
, "trst_only") == 0)
886 tmp
= RESET_HAS_TRST
;
887 else if (strcmp(*args
, "srst_only") == 0)
888 tmp
= RESET_HAS_SRST
;
889 else if (strcmp(*args
, "trst_and_srst") == 0)
890 tmp
= RESET_HAS_TRST
| RESET_HAS_SRST
;
894 LOG_ERROR("extra reset_config %s spec (%s)",
896 return ERROR_INVALID_ARGUMENTS
;
901 /* combination (options for broken wiring) */
902 m
= RESET_SRST_PULLS_TRST
| RESET_TRST_PULLS_SRST
;
903 if (strcmp(*args
, "separate") == 0)
904 /* separate reset lines - default */;
905 else if (strcmp(*args
, "srst_pulls_trst") == 0)
906 tmp
|= RESET_SRST_PULLS_TRST
;
907 else if (strcmp(*args
, "trst_pulls_srst") == 0)
908 tmp
|= RESET_TRST_PULLS_SRST
;
909 else if (strcmp(*args
, "combined") == 0)
910 tmp
|= RESET_SRST_PULLS_TRST
| RESET_TRST_PULLS_SRST
;
914 LOG_ERROR("extra reset_config %s spec (%s)",
915 "combination", *args
);
916 return ERROR_INVALID_ARGUMENTS
;
921 /* trst_type (NOP without HAS_TRST) */
922 m
= RESET_TRST_OPEN_DRAIN
;
923 if (strcmp(*args
, "trst_open_drain") == 0)
924 tmp
|= RESET_TRST_OPEN_DRAIN
;
925 else if (strcmp(*args
, "trst_push_pull") == 0)
926 /* push/pull from adapter - default */;
930 LOG_ERROR("extra reset_config %s spec (%s)",
932 return ERROR_INVALID_ARGUMENTS
;
937 /* srst_type (NOP without HAS_SRST) */
938 m
|= RESET_SRST_PUSH_PULL
;
939 if (strcmp(*args
, "srst_push_pull") == 0)
940 tmp
|= RESET_SRST_PUSH_PULL
;
941 else if (strcmp(*args
, "srst_open_drain") == 0)
942 /* open drain from adapter - default */;
946 LOG_ERROR("extra reset_config %s spec (%s)",
948 return ERROR_INVALID_ARGUMENTS
;
953 /* caller provided nonsense; fail */
954 LOG_ERROR("unknown reset_config flag (%s)", *args
);
955 return ERROR_INVALID_ARGUMENTS
;
958 /* Remember the bits which were specified (mask)
959 * and their new values (new_cfg).
965 /* clear previous values of those bits, save new values */
967 int old_cfg
= jtag_get_reset_config();
971 jtag_set_reset_config(new_cfg
);
973 new_cfg
= jtag_get_reset_config();
977 * Display the (now-)current reset mode
981 /* minimal JTAG has neither SRST nor TRST (so that's the default) */
982 switch (new_cfg
& (RESET_HAS_TRST
| RESET_HAS_SRST
)) {
984 modes
[0] = "srst_only";
987 modes
[0] = "trst_only";
989 case RESET_TRST_AND_SRST
:
990 modes
[0] = "trst_and_srst";
997 /* normally SRST and TRST are decoupled; but bugs happen ... */
998 switch (new_cfg
& (RESET_SRST_PULLS_TRST
| RESET_TRST_PULLS_SRST
)) {
999 case RESET_SRST_PULLS_TRST
:
1000 modes
[1] = "srst_pulls_trst";
1002 case RESET_TRST_PULLS_SRST
:
1003 modes
[1] = "trst_pulls_srst";
1005 case RESET_SRST_PULLS_TRST
| RESET_TRST_PULLS_SRST
:
1006 modes
[1] = "combined";
1009 modes
[1] = "separate";
1013 /* TRST-less connectors include Altera, Xilinx, and minimal JTAG */
1014 if (new_cfg
& RESET_HAS_TRST
) {
1015 if (new_cfg
& RESET_TRST_OPEN_DRAIN
)
1016 modes
[3] = " trst_open_drain";
1018 modes
[3] = " trst_push_pull";
1022 /* SRST-less connectors include TI-14, Xilinx, and minimal JTAG */
1023 if (new_cfg
& RESET_HAS_SRST
) {
1024 if (new_cfg
& RESET_SRST_NO_GATING
)
1025 modes
[2] = " srst_nogate";
1027 modes
[2] = " srst_gates_jtag";
1029 if (new_cfg
& RESET_SRST_PUSH_PULL
)
1030 modes
[4] = " srst_push_pull";
1032 modes
[4] = " srst_open_drain";
1038 command_print(cmd_ctx
, "%s %s%s%s%s",
1040 modes
[2], modes
[3], modes
[4]);
1045 static int handle_jtag_nsrst_delay_command(struct command_context_s
*cmd_ctx
,
1046 char *cmd
, char **args
, int argc
)
1049 return ERROR_COMMAND_SYNTAX_ERROR
;
1053 COMMAND_PARSE_NUMBER(uint
, args
[0], delay
);
1055 jtag_set_nsrst_delay(delay
);
1057 command_print(cmd_ctx
, "jtag_nsrst_delay: %u", jtag_get_nsrst_delay());
1061 static int handle_jtag_ntrst_delay_command(struct command_context_s
*cmd_ctx
,
1062 char *cmd
, char **args
, int argc
)
1065 return ERROR_COMMAND_SYNTAX_ERROR
;
1069 COMMAND_PARSE_NUMBER(uint
, args
[0], delay
);
1071 jtag_set_ntrst_delay(delay
);
1073 command_print(cmd_ctx
, "jtag_ntrst_delay: %u", jtag_get_ntrst_delay());
1077 static int handle_jtag_nsrst_assert_width_command(struct command_context_s
*cmd_ctx
,
1078 char *cmd
, char **args
, int argc
)
1081 return ERROR_COMMAND_SYNTAX_ERROR
;
1085 COMMAND_PARSE_NUMBER(uint
, args
[0], delay
);
1087 jtag_set_nsrst_assert_width(delay
);
1089 command_print(cmd_ctx
, "jtag_nsrst_assert_width: %u", jtag_get_nsrst_assert_width());
1093 static int handle_jtag_ntrst_assert_width_command(struct command_context_s
*cmd_ctx
,
1094 char *cmd
, char **args
, int argc
)
1097 return ERROR_COMMAND_SYNTAX_ERROR
;
1101 COMMAND_PARSE_NUMBER(uint
, args
[0], delay
);
1103 jtag_set_ntrst_assert_width(delay
);
1105 command_print(cmd_ctx
, "jtag_ntrst_assert_width: %u", jtag_get_ntrst_assert_width());
1109 static int handle_jtag_speed_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
1111 int retval
= ERROR_OK
;
1113 command_print(cmd_ctx
, "OLD SYNTAX: DEPRECATED - "
1114 "use jtag_khz, not jtag_speed");
1117 return ERROR_COMMAND_SYNTAX_ERROR
;
1120 LOG_DEBUG("handle jtag speed");
1122 unsigned cur_speed
= 0;
1123 COMMAND_PARSE_NUMBER(uint
, args
[0], cur_speed
);
1125 retval
= jtag_config_speed(cur_speed
);
1127 command_print(cmd_ctx
, "jtag_speed: %d", jtag_get_speed());
1132 static int handle_jtag_khz_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
1135 return ERROR_COMMAND_SYNTAX_ERROR
;
1137 int retval
= ERROR_OK
;
1141 COMMAND_PARSE_NUMBER(uint
, args
[0], khz
);
1143 retval
= jtag_config_khz(khz
);
1144 if (ERROR_OK
!= retval
)
1148 int cur_speed
= jtag_get_speed_khz();
1149 retval
= jtag_get_speed_readable(&cur_speed
);
1150 if (ERROR_OK
!= retval
)
1154 command_print(cmd_ctx
, "%d kHz", cur_speed
);
1156 command_print(cmd_ctx
, "RCLK - adaptive");
1161 static int handle_jtag_rclk_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
1164 return ERROR_COMMAND_SYNTAX_ERROR
;
1166 int retval
= ERROR_OK
;
1170 COMMAND_PARSE_NUMBER(uint
, args
[0], khz
);
1172 retval
= jtag_config_rclk(khz
);
1173 if (ERROR_OK
!= retval
)
1177 int cur_khz
= jtag_get_speed_khz();
1178 retval
= jtag_get_speed_readable(&cur_khz
);
1179 if (ERROR_OK
!= retval
)
1183 command_print(cmd_ctx
, "RCLK not supported - fallback to %d kHz", cur_khz
);
1185 command_print(cmd_ctx
, "RCLK - adaptive");
1190 static int handle_jtag_reset_command(struct command_context_s
*cmd_ctx
,
1191 char *cmd
, char **args
, int argc
)
1194 return ERROR_COMMAND_SYNTAX_ERROR
;
1197 if (args
[0][0] == '1')
1199 else if (args
[0][0] == '0')
1202 return ERROR_COMMAND_SYNTAX_ERROR
;
1205 if (args
[1][0] == '1')
1207 else if (args
[1][0] == '0')
1210 return ERROR_COMMAND_SYNTAX_ERROR
;
1212 if (jtag_interface_init(cmd_ctx
) != ERROR_OK
)
1213 return ERROR_JTAG_INIT_FAILED
;
1215 jtag_add_reset(trst
, srst
);
1216 return jtag_execute_queue();
1219 static int handle_runtest_command(struct command_context_s
*cmd_ctx
,
1220 char *cmd
, char **args
, int argc
)
1223 return ERROR_COMMAND_SYNTAX_ERROR
;
1225 unsigned num_clocks
;
1226 COMMAND_PARSE_NUMBER(uint
, args
[0], num_clocks
);
1228 jtag_add_runtest(num_clocks
, TAP_IDLE
);
1229 return jtag_execute_queue();
1233 * For "irscan" or "drscan" commands, the "end" (really, "next") state
1234 * should be stable ... and *NOT* a shift state, otherwise free-running
1235 * jtag clocks could change the values latched by the update state.
1236 * Not surprisingly, this is the same constraint as SVF; the "irscan"
1237 * and "drscan" commands are a write-only subset of what SVF provides.
1239 static bool scan_is_safe(tap_state_t state
)
1254 static int handle_irscan_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
1257 scan_field_t
*fields
;
1259 tap_state_t endstate
;
1261 if ((argc
< 2) || (argc
% 2))
1263 return ERROR_COMMAND_SYNTAX_ERROR
;
1266 /* optional "-endstate" "statename" at the end of the arguments,
1267 * so that e.g. IRPAUSE can let us load the data register before
1268 * entering RUN/IDLE to execute the instruction we load here.
1270 endstate
= TAP_IDLE
;
1273 /* have at least one pair of numbers. */
1274 /* is last pair the magic text? */
1275 if (strcmp("-endstate", args
[argc
- 2]) == 0) {
1276 endstate
= tap_state_by_name(args
[argc
- 1]);
1277 if (endstate
== TAP_INVALID
)
1278 return ERROR_COMMAND_SYNTAX_ERROR
;
1279 if (!scan_is_safe(endstate
))
1280 LOG_WARNING("unstable irscan endstate \"%s\"",
1286 int num_fields
= argc
/ 2;
1287 size_t fields_len
= sizeof(scan_field_t
) * num_fields
;
1288 fields
= malloc(fields_len
);
1289 memset(fields
, 0, fields_len
);
1292 for (i
= 0; i
< num_fields
; i
++)
1294 tap
= jtag_tap_by_string(args
[i
*2]);
1298 for (j
= 0; j
< i
; j
++)
1299 free(fields
[j
].out_value
);
1301 command_print(cmd_ctx
, "Tap: %s unknown", args
[i
*2]);
1305 int field_size
= tap
->ir_length
;
1306 fields
[i
].tap
= tap
;
1307 fields
[i
].num_bits
= field_size
;
1308 fields
[i
].out_value
= malloc(CEIL(field_size
, 8));
1311 retval
= parse_u32(args
[i
* 2 + 1], &value
);
1312 if (ERROR_OK
!= retval
)
1314 buf_set_u32(fields
[i
].out_value
, 0, field_size
, value
);
1315 fields
[i
].in_value
= NULL
;
1318 /* did we have an endstate? */
1319 jtag_add_ir_scan(num_fields
, fields
, endstate
);
1321 retval
= jtag_execute_queue();
1324 for (i
= 0; i
< num_fields
; i
++)
1326 if (NULL
!= fields
[i
].out_value
)
1327 free(fields
[i
].out_value
);
1335 static int Jim_Command_drscan(Jim_Interp
*interp
, int argc
, Jim_Obj
*const *args
)
1338 scan_field_t
*fields
;
1340 int field_count
= 0;
1343 tap_state_t endstate
;
1346 * args[2] = num_bits
1347 * args[3] = hex string
1348 * ... repeat num bits and hex string ...
1351 * args[N-2] = "-endstate"
1352 * args[N-1] = statename
1354 if ((argc
< 4) || ((argc
% 2) != 0))
1356 Jim_WrongNumArgs(interp
, 1, args
, "wrong arguments");
1360 endstate
= TAP_IDLE
;
1362 script_debug(interp
, "drscan", argc
, args
);
1364 /* validate arguments as numbers */
1366 for (i
= 2; i
< argc
; i
+= 2)
1371 e
= Jim_GetLong(interp
, args
[i
], &bits
);
1372 /* If valid - try next arg */
1377 /* Not valid.. are we at the end? */
1378 if (((i
+ 2) != argc
)) {
1379 /* nope, then error */
1383 /* it could be: "-endstate FOO"
1384 * e.g. DRPAUSE so we can issue more instructions
1385 * before entering RUN/IDLE and executing them.
1388 /* get arg as a string. */
1389 cp
= Jim_GetString(args
[i
], NULL
);
1390 /* is it the magic? */
1391 if (0 == strcmp("-endstate", cp
)) {
1392 /* is the statename valid? */
1393 cp
= Jim_GetString(args
[i
+ 1], NULL
);
1395 /* see if it is a valid state name */
1396 endstate
= tap_state_by_name(cp
);
1398 /* update the error message */
1399 Jim_SetResult_sprintf(interp
,"endstate: %s invalid", cp
);
1401 if (!scan_is_safe(endstate
))
1402 LOG_WARNING("drscan with unsafe "
1403 "endstate \"%s\"", cp
);
1405 /* valid - so clear the error */
1407 /* and remove the last 2 args */
1412 /* Still an error? */
1414 return e
; /* too bad */
1416 } /* validate args */
1418 tap
= jtag_tap_by_jim_obj(interp
, args
[1]);
1423 num_fields
= (argc
-2)/2;
1424 fields
= malloc(sizeof(scan_field_t
) * num_fields
);
1425 for (i
= 2; i
< argc
; i
+= 2)
1431 Jim_GetLong(interp
, args
[i
], &bits
);
1432 str
= Jim_GetString(args
[i
+ 1], &len
);
1434 fields
[field_count
].tap
= tap
;
1435 fields
[field_count
].num_bits
= bits
;
1436 fields
[field_count
].out_value
= malloc(CEIL(bits
, 8));
1437 str_to_buf(str
, len
, fields
[field_count
].out_value
, bits
, 0);
1438 fields
[field_count
].in_value
= fields
[field_count
].out_value
;
1442 jtag_add_dr_scan(num_fields
, fields
, endstate
);
1444 retval
= jtag_execute_queue();
1445 if (retval
!= ERROR_OK
)
1447 Jim_SetResultString(interp
, "drscan: jtag execute failed",-1);
1452 Jim_Obj
*list
= Jim_NewListObj(interp
, NULL
, 0);
1453 for (i
= 2; i
< argc
; i
+= 2)
1458 Jim_GetLong(interp
, args
[i
], &bits
);
1459 str
= buf_to_str(fields
[field_count
].in_value
, bits
, 16);
1460 free(fields
[field_count
].out_value
);
1462 Jim_ListAppendElement(interp
, list
, Jim_NewStringObj(interp
, str
, strlen(str
)));
1467 Jim_SetResult(interp
, list
);
1475 static int Jim_Command_pathmove(Jim_Interp
*interp
, int argc
, Jim_Obj
*const *args
)
1477 tap_state_t states
[8];
1479 if ((argc
< 2) || ((size_t)argc
> (sizeof(states
)/sizeof(*states
) + 1)))
1481 Jim_WrongNumArgs(interp
, 1, args
, "wrong arguments");
1485 script_debug(interp
, "pathmove", argc
, args
);
1488 for (i
= 0; i
< argc
-1; i
++)
1491 cp
= Jim_GetString(args
[i
+ 1], NULL
);
1492 states
[i
] = tap_state_by_name(cp
);
1495 /* update the error message */
1496 Jim_SetResult_sprintf(interp
,"endstate: %s invalid", cp
);
1501 if ((jtag_add_statemove(states
[0]) != ERROR_OK
) || (jtag_execute_queue()!= ERROR_OK
))
1503 Jim_SetResultString(interp
, "pathmove: jtag execute failed",-1);
1507 jtag_add_pathmove(argc
-2, states
+ 1);
1509 if (jtag_execute_queue()!= ERROR_OK
)
1511 Jim_SetResultString(interp
, "pathmove: failed",-1);
1519 static int Jim_Command_flush_count(Jim_Interp
*interp
, int argc
, Jim_Obj
*const *args
)
1521 script_debug(interp
, "flush_count", argc
, args
);
1523 Jim_SetResult(interp
, Jim_NewIntObj(interp
, jtag_get_flush_queue_count()));
1529 static int handle_verify_ircapture_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
1532 return ERROR_COMMAND_SYNTAX_ERROR
;
1536 if (strcmp(args
[0], "enable") == 0)
1537 jtag_set_verify_capture_ir(true);
1538 else if (strcmp(args
[0], "disable") == 0)
1539 jtag_set_verify_capture_ir(false);
1541 return ERROR_COMMAND_SYNTAX_ERROR
;
1544 const char *status
= jtag_will_verify_capture_ir() ? "enabled": "disabled";
1545 command_print(cmd_ctx
, "verify Capture-IR is %s", status
);
1550 static int handle_verify_jtag_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
1553 return ERROR_COMMAND_SYNTAX_ERROR
;
1557 if (strcmp(args
[0], "enable") == 0)
1558 jtag_set_verify(true);
1559 else if (strcmp(args
[0], "disable") == 0)
1560 jtag_set_verify(false);
1562 return ERROR_COMMAND_SYNTAX_ERROR
;
1565 const char *status
= jtag_will_verify() ? "enabled": "disabled";
1566 command_print(cmd_ctx
, "verify jtag capture is %s", status
);
1571 static int handle_tms_sequence_command(struct command_context_s
*cmd_ctx
, char *cmd
, char **args
, int argc
)
1574 return ERROR_COMMAND_SYNTAX_ERROR
;
1579 if (strcmp(args
[0], "short") == 0)
1580 use_new_table
= true;
1581 else if (strcmp(args
[0], "long") == 0)
1582 use_new_table
= false;
1584 return ERROR_COMMAND_SYNTAX_ERROR
;
1586 tap_use_new_tms_table(use_new_table
);
1589 command_print(cmd_ctx
, "tms sequence is %s",
1590 tap_uses_new_tms_table() ? "short": "long");
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)