1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2005 by Dominic Rath <Dominic.Rath@gmx.de>
4 * Copyright (C) 2007-2010 Øyvind Harboe <oyvind.harboe@zylin.com>
5 * Copyright (C) 2009 SoftPLC Corporation, http://softplc.com, Dick Hollenbeck <dick@softplc.com>
6 * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net>
7 * Copyright (C) 2018 Pengutronix, Oleksij Rempel <kernel@pengutronix.de>
16 #include "minidriver.h"
17 #include "interface.h"
18 #include "interfaces.h"
19 #include <transport/transport.h>
27 * Holds support for configuring debug adapters from TCl scripts.
30 struct adapter_driver
*adapter_driver
;
31 const char * const jtag_only
[] = { "jtag", NULL
};
33 enum adapter_clk_mode
{
34 CLOCK_MODE_UNSELECTED
= 0,
40 * Adapter configuration
43 bool adapter_initialized
;
45 enum adapter_clk_mode clock_mode
;
47 int rclk_fallback_speed_khz
;
50 bool is_adapter_initialized(void)
52 return adapter_config
.adapter_initialized
;
56 * Do low-level setup like initializing registers, output signals,
59 int adapter_init(struct command_context
*cmd_ctx
)
61 if (is_adapter_initialized())
64 if (!adapter_driver
) {
65 /* nothing was previously specified by "adapter driver" command */
66 LOG_ERROR("Debug Adapter has to be specified, "
67 "see \"adapter driver\" command");
68 return ERROR_JTAG_INVALID_INTERFACE
;
72 retval
= adapter_driver
->init();
73 if (retval
!= ERROR_OK
)
75 adapter_config
.adapter_initialized
= true;
77 if (!adapter_driver
->speed
) {
78 LOG_INFO("This adapter doesn't support configurable speed");
82 if (adapter_config
.clock_mode
== CLOCK_MODE_UNSELECTED
) {
83 LOG_ERROR("An adapter speed is not selected in the init script."
84 " Insert a call to \"adapter speed\" or \"jtag_rclk\" to proceed.");
85 return ERROR_JTAG_INIT_FAILED
;
88 int requested_khz
= adapter_get_speed_khz();
89 int actual_khz
= requested_khz
;
91 retval
= adapter_get_speed(&speed_var
);
92 if (retval
!= ERROR_OK
)
94 retval
= adapter_driver
->speed(speed_var
);
95 if (retval
!= ERROR_OK
)
97 retval
= adapter_get_speed_readable(&actual_khz
);
98 if (retval
!= ERROR_OK
)
99 LOG_INFO("adapter-specific clock speed value %d", speed_var
);
100 else if (actual_khz
) {
101 /* Adaptive clocking -- JTAG-specific */
102 if ((adapter_config
.clock_mode
== CLOCK_MODE_RCLK
)
103 || ((adapter_config
.clock_mode
== CLOCK_MODE_KHZ
) && !requested_khz
)) {
104 LOG_INFO("RCLK (adaptive clock speed) not supported - fallback to %d kHz"
107 LOG_INFO("clock speed %d kHz", actual_khz
);
109 LOG_INFO("RCLK (adaptive clock speed)");
114 int adapter_quit(void)
116 if (is_adapter_initialized() && adapter_driver
->quit
) {
117 /* close the JTAG interface */
118 int result
= adapter_driver
->quit();
119 if (result
!= ERROR_OK
)
120 LOG_ERROR("failed: %d", result
);
123 free(adapter_config
.usb_location
);
125 struct jtag_tap
*t
= jtag_all_taps();
127 struct jtag_tap
*n
= t
->next_tap
;
135 unsigned int adapter_get_speed_khz(void)
137 return adapter_config
.speed_khz
;
140 static int adapter_khz_to_speed(unsigned int khz
, int *speed
)
142 LOG_DEBUG("convert khz to adapter specific speed value");
143 adapter_config
.speed_khz
= khz
;
144 if (!is_adapter_initialized())
146 LOG_DEBUG("have adapter set up");
147 if (!adapter_driver
->khz
) {
148 LOG_ERROR("Translation from khz to adapter speed not implemented");
152 int retval
= adapter_driver
->khz(adapter_get_speed_khz(), &speed_div1
);
153 if (retval
!= ERROR_OK
)
159 static int adapter_rclk_to_speed(unsigned int fallback_speed_khz
, int *speed
)
161 int retval
= adapter_khz_to_speed(0, speed
);
162 if ((retval
!= ERROR_OK
) && fallback_speed_khz
) {
163 LOG_DEBUG("trying fallback speed...");
164 retval
= adapter_khz_to_speed(fallback_speed_khz
, speed
);
169 static int adapter_set_speed(int speed
)
171 /* this command can be called during CONFIG,
172 * in which case adapter isn't initialized */
173 return is_adapter_initialized() ? adapter_driver
->speed(speed
) : ERROR_OK
;
176 int adapter_config_khz(unsigned int khz
)
178 LOG_DEBUG("handle adapter khz");
179 adapter_config
.clock_mode
= CLOCK_MODE_KHZ
;
181 int retval
= adapter_khz_to_speed(khz
, &speed
);
182 return (retval
!= ERROR_OK
) ? retval
: adapter_set_speed(speed
);
185 int adapter_config_rclk(unsigned int fallback_speed_khz
)
187 LOG_DEBUG("handle adapter rclk");
188 adapter_config
.clock_mode
= CLOCK_MODE_RCLK
;
189 adapter_config
.rclk_fallback_speed_khz
= fallback_speed_khz
;
191 int retval
= adapter_rclk_to_speed(fallback_speed_khz
, &speed
);
192 return (retval
!= ERROR_OK
) ? retval
: adapter_set_speed(speed
);
195 int adapter_get_speed(int *speed
)
197 switch (adapter_config
.clock_mode
) {
199 adapter_khz_to_speed(adapter_get_speed_khz(), speed
);
201 case CLOCK_MODE_RCLK
:
202 adapter_rclk_to_speed(adapter_config
.rclk_fallback_speed_khz
, speed
);
205 LOG_ERROR("BUG: unknown adapter clock mode");
211 int adapter_get_speed_readable(int *khz
)
214 int retval
= adapter_get_speed(&speed_var
);
215 if (retval
!= ERROR_OK
)
217 if (!is_adapter_initialized())
219 if (!adapter_driver
->speed_div
) {
220 LOG_ERROR("Translation from adapter speed to khz not implemented");
223 return adapter_driver
->speed_div(speed_var
, khz
);
228 * 2 * 7 chars: max 7 ports
229 * 1 char: test for overflow
233 #define USB_MAX_LOCATION_LENGTH 16
235 #ifdef HAVE_LIBUSB_GET_PORT_NUMBERS
236 static void adapter_usb_set_location(const char *location
)
238 if (strnlen(location
, USB_MAX_LOCATION_LENGTH
) == USB_MAX_LOCATION_LENGTH
)
239 LOG_WARNING("usb location string is too long!!");
241 free(adapter_config
.usb_location
);
243 adapter_config
.usb_location
= strndup(location
, USB_MAX_LOCATION_LENGTH
);
245 #endif /* HAVE_LIBUSB_GET_PORT_NUMBERS */
247 const char *adapter_usb_get_location(void)
249 return adapter_config
.usb_location
;
252 bool adapter_usb_location_equal(uint8_t dev_bus
, uint8_t *port_path
, size_t path_len
)
254 size_t path_step
, string_length
;
258 if (!adapter_usb_get_location())
261 /* strtok need non const char */
262 loc
= strndup(adapter_usb_get_location(), USB_MAX_LOCATION_LENGTH
);
263 string_length
= strnlen(loc
, USB_MAX_LOCATION_LENGTH
);
265 ptr
= strtok(loc
, "-");
267 LOG_WARNING("no '-' in usb path\n");
271 string_length
-= strnlen(ptr
, string_length
);
272 /* check bus mismatch */
273 if (atoi(ptr
) != dev_bus
)
277 while (path_step
< path_len
) {
278 ptr
= strtok(NULL
, ".");
280 /* no more tokens in path */
284 /* path mismatch at some step */
285 if (path_step
< path_len
&& atoi(ptr
) != port_path
[path_step
])
289 string_length
-= strnlen(ptr
, string_length
) + 1;
292 /* walked the full path, all elements match */
293 if (path_step
== path_len
&& !string_length
)
301 static int jim_adapter_name(Jim_Interp
*interp
, int argc
, Jim_Obj
* const *argv
)
303 struct jim_getopt_info goi
;
304 jim_getopt_setup(&goi
, interp
, argc
-1, argv
+ 1);
306 /* return the name of the interface */
307 /* TCL code might need to know the exact type... */
308 /* FUTURE: we allow this as a means to "set" the interface. */
310 Jim_WrongNumArgs(goi
.interp
, 1, goi
.argv
-1, "(no params)");
313 const char *name
= adapter_driver
? adapter_driver
->name
: NULL
;
314 Jim_SetResultString(goi
.interp
, name
? name
: "undefined", -1);
318 COMMAND_HANDLER(adapter_transports_command
)
323 retval
= CALL_COMMAND_HANDLER(transport_list_parse
, &transports
);
324 if (retval
!= ERROR_OK
)
327 retval
= allow_transports(CMD_CTX
, (const char **)transports
);
329 if (retval
!= ERROR_OK
) {
330 for (unsigned i
= 0; transports
[i
]; i
++)
337 COMMAND_HANDLER(handle_adapter_list_command
)
339 if (strcmp(CMD_NAME
, "list") == 0 && CMD_ARGC
> 0)
340 return ERROR_COMMAND_SYNTAX_ERROR
;
342 command_print(CMD
, "The following debug adapters are available:");
343 for (unsigned i
= 0; adapter_drivers
[i
]; i
++) {
344 const char *name
= adapter_drivers
[i
]->name
;
345 command_print(CMD
, "%u: %s", i
+ 1, name
);
351 COMMAND_HANDLER(handle_adapter_driver_command
)
355 /* check whether the interface is already configured */
356 if (adapter_driver
) {
357 LOG_WARNING("Interface already configured, ignoring");
361 /* interface name is a mandatory argument */
362 if (CMD_ARGC
!= 1 || CMD_ARGV
[0][0] == '\0')
363 return ERROR_COMMAND_SYNTAX_ERROR
;
365 for (unsigned i
= 0; adapter_drivers
[i
]; i
++) {
366 if (strcmp(CMD_ARGV
[0], adapter_drivers
[i
]->name
) != 0)
369 if (adapter_drivers
[i
]->commands
) {
370 retval
= register_commands(CMD_CTX
, NULL
, adapter_drivers
[i
]->commands
);
371 if (retval
!= ERROR_OK
)
375 adapter_driver
= adapter_drivers
[i
];
377 return allow_transports(CMD_CTX
, adapter_driver
->transports
);
380 /* no valid interface was found (i.e. the configuration option,
381 * didn't match one of the compiled-in interfaces
383 LOG_ERROR("The specified debug interface was not found (%s)",
385 CALL_COMMAND_HANDLER(handle_adapter_list_command
);
386 return ERROR_JTAG_INVALID_INTERFACE
;
389 COMMAND_HANDLER(handle_reset_config_command
)
394 /* Original versions cared about the order of these tokens:
395 * reset_config signals [combination [trst_type [srst_type]]]
396 * They also clobbered the previous configuration even on error.
398 * Here we don't care about the order, and only change values
399 * which have been explicitly specified.
401 for (; CMD_ARGC
; CMD_ARGC
--, CMD_ARGV
++) {
406 m
= RESET_SRST_NO_GATING
;
407 if (strcmp(*CMD_ARGV
, "srst_gates_jtag") == 0)
408 /* default: don't use JTAG while SRST asserted */;
409 else if (strcmp(*CMD_ARGV
, "srst_nogate") == 0)
410 tmp
= RESET_SRST_NO_GATING
;
414 LOG_ERROR("extra reset_config %s spec (%s)",
415 "gating", *CMD_ARGV
);
416 return ERROR_COMMAND_SYNTAX_ERROR
;
422 m
= RESET_HAS_TRST
| RESET_HAS_SRST
;
423 if (strcmp(*CMD_ARGV
, "none") == 0)
425 else if (strcmp(*CMD_ARGV
, "trst_only") == 0)
426 tmp
= RESET_HAS_TRST
;
427 else if (strcmp(*CMD_ARGV
, "srst_only") == 0)
428 tmp
= RESET_HAS_SRST
;
429 else if (strcmp(*CMD_ARGV
, "trst_and_srst") == 0)
430 tmp
= RESET_HAS_TRST
| RESET_HAS_SRST
;
434 LOG_ERROR("extra reset_config %s spec (%s)",
435 "signal", *CMD_ARGV
);
436 return ERROR_COMMAND_SYNTAX_ERROR
;
441 /* combination (options for broken wiring) */
442 m
= RESET_SRST_PULLS_TRST
| RESET_TRST_PULLS_SRST
;
443 if (strcmp(*CMD_ARGV
, "separate") == 0)
444 /* separate reset lines - default */;
445 else if (strcmp(*CMD_ARGV
, "srst_pulls_trst") == 0)
446 tmp
|= RESET_SRST_PULLS_TRST
;
447 else if (strcmp(*CMD_ARGV
, "trst_pulls_srst") == 0)
448 tmp
|= RESET_TRST_PULLS_SRST
;
449 else if (strcmp(*CMD_ARGV
, "combined") == 0)
450 tmp
|= RESET_SRST_PULLS_TRST
| RESET_TRST_PULLS_SRST
;
454 LOG_ERROR("extra reset_config %s spec (%s)",
455 "combination", *CMD_ARGV
);
456 return ERROR_COMMAND_SYNTAX_ERROR
;
461 /* trst_type (NOP without HAS_TRST) */
462 m
= RESET_TRST_OPEN_DRAIN
;
463 if (strcmp(*CMD_ARGV
, "trst_open_drain") == 0)
464 tmp
|= RESET_TRST_OPEN_DRAIN
;
465 else if (strcmp(*CMD_ARGV
, "trst_push_pull") == 0)
466 /* push/pull from adapter - default */;
470 LOG_ERROR("extra reset_config %s spec (%s)",
471 "trst_type", *CMD_ARGV
);
472 return ERROR_COMMAND_SYNTAX_ERROR
;
477 /* srst_type (NOP without HAS_SRST) */
478 m
= RESET_SRST_PUSH_PULL
;
479 if (strcmp(*CMD_ARGV
, "srst_push_pull") == 0)
480 tmp
|= RESET_SRST_PUSH_PULL
;
481 else if (strcmp(*CMD_ARGV
, "srst_open_drain") == 0)
482 /* open drain from adapter - default */;
486 LOG_ERROR("extra reset_config %s spec (%s)",
487 "srst_type", *CMD_ARGV
);
488 return ERROR_COMMAND_SYNTAX_ERROR
;
493 /* connect_type - only valid when srst_nogate */
494 m
= RESET_CNCT_UNDER_SRST
;
495 if (strcmp(*CMD_ARGV
, "connect_assert_srst") == 0)
496 tmp
|= RESET_CNCT_UNDER_SRST
;
497 else if (strcmp(*CMD_ARGV
, "connect_deassert_srst") == 0)
498 /* connect normally - default */;
502 LOG_ERROR("extra reset_config %s spec (%s)",
503 "connect_type", *CMD_ARGV
);
504 return ERROR_COMMAND_SYNTAX_ERROR
;
509 /* caller provided nonsense; fail */
510 LOG_ERROR("unknown reset_config flag (%s)", *CMD_ARGV
);
511 return ERROR_COMMAND_SYNTAX_ERROR
;
514 /* Remember the bits which were specified (mask)
515 * and their new values (new_cfg).
521 /* clear previous values of those bits, save new values */
523 int old_cfg
= jtag_get_reset_config();
527 jtag_set_reset_config(new_cfg
);
529 new_cfg
= jtag_get_reset_config();
532 * Display the (now-)current reset mode
536 /* minimal JTAG has neither SRST nor TRST (so that's the default) */
537 switch (new_cfg
& (RESET_HAS_TRST
| RESET_HAS_SRST
)) {
539 modes
[0] = "srst_only";
542 modes
[0] = "trst_only";
544 case RESET_TRST_AND_SRST
:
545 modes
[0] = "trst_and_srst";
552 /* normally SRST and TRST are decoupled; but bugs happen ... */
553 switch (new_cfg
& (RESET_SRST_PULLS_TRST
| RESET_TRST_PULLS_SRST
)) {
554 case RESET_SRST_PULLS_TRST
:
555 modes
[1] = "srst_pulls_trst";
557 case RESET_TRST_PULLS_SRST
:
558 modes
[1] = "trst_pulls_srst";
560 case RESET_SRST_PULLS_TRST
| RESET_TRST_PULLS_SRST
:
561 modes
[1] = "combined";
564 modes
[1] = "separate";
568 /* TRST-less connectors include Altera, Xilinx, and minimal JTAG */
569 if (new_cfg
& RESET_HAS_TRST
) {
570 if (new_cfg
& RESET_TRST_OPEN_DRAIN
)
571 modes
[3] = " trst_open_drain";
573 modes
[3] = " trst_push_pull";
577 /* SRST-less connectors include TI-14, Xilinx, and minimal JTAG */
578 if (new_cfg
& RESET_HAS_SRST
) {
579 if (new_cfg
& RESET_SRST_NO_GATING
)
580 modes
[2] = " srst_nogate";
582 modes
[2] = " srst_gates_jtag";
584 if (new_cfg
& RESET_SRST_PUSH_PULL
)
585 modes
[4] = " srst_push_pull";
587 modes
[4] = " srst_open_drain";
589 if (new_cfg
& RESET_CNCT_UNDER_SRST
)
590 modes
[5] = " connect_assert_srst";
592 modes
[5] = " connect_deassert_srst";
599 command_print(CMD
, "%s %s%s%s%s%s",
601 modes
[2], modes
[3], modes
[4], modes
[5]);
606 COMMAND_HANDLER(handle_adapter_srst_delay_command
)
609 return ERROR_COMMAND_SYNTAX_ERROR
;
612 COMMAND_PARSE_NUMBER(uint
, CMD_ARGV
[0], delay
);
614 jtag_set_nsrst_delay(delay
);
616 command_print(CMD
, "adapter srst delay: %u", jtag_get_nsrst_delay());
620 COMMAND_HANDLER(handle_adapter_srst_pulse_width_command
)
623 return ERROR_COMMAND_SYNTAX_ERROR
;
626 COMMAND_PARSE_NUMBER(uint
, CMD_ARGV
[0], width
);
628 jtag_set_nsrst_assert_width(width
);
630 command_print(CMD
, "adapter srst pulse_width: %u", jtag_get_nsrst_assert_width());
634 COMMAND_HANDLER(handle_adapter_speed_command
)
637 return ERROR_COMMAND_SYNTAX_ERROR
;
639 int retval
= ERROR_OK
;
642 COMMAND_PARSE_NUMBER(uint
, CMD_ARGV
[0], khz
);
644 retval
= adapter_config_khz(khz
);
645 if (retval
!= ERROR_OK
)
649 int cur_speed
= adapter_get_speed_khz();
650 retval
= adapter_get_speed_readable(&cur_speed
);
651 if (retval
!= ERROR_OK
)
655 command_print(CMD
, "adapter speed: %d kHz", cur_speed
);
657 command_print(CMD
, "adapter speed: RCLK - adaptive");
662 COMMAND_HANDLER(handle_adapter_reset_de_assert
)
665 VALUE_UNDEFINED
= -1,
670 enum values srst
= VALUE_UNDEFINED
;
671 enum values trst
= VALUE_UNDEFINED
;
672 enum reset_types jtag_reset_config
= jtag_get_reset_config();
676 if (transport_is_jtag()) {
677 if (jtag_reset_config
& RESET_HAS_TRST
)
678 signal
= jtag_get_trst() ? "asserted" : "deasserted";
680 signal
= "not present";
681 command_print(CMD
, "trst %s", signal
);
684 if (jtag_reset_config
& RESET_HAS_SRST
)
685 signal
= jtag_get_srst() ? "asserted" : "deasserted";
687 signal
= "not present";
688 command_print(CMD
, "srst %s", signal
);
693 if (CMD_ARGC
!= 1 && CMD_ARGC
!= 3)
694 return ERROR_COMMAND_SYNTAX_ERROR
;
696 value
= (strcmp(CMD_NAME
, "assert") == 0) ? VALUE_ASSERT
: VALUE_DEASSERT
;
697 if (strcmp(CMD_ARGV
[0], "srst") == 0)
699 else if (strcmp(CMD_ARGV
[0], "trst") == 0)
702 return ERROR_COMMAND_SYNTAX_ERROR
;
705 if (strcmp(CMD_ARGV
[1], "assert") == 0)
706 value
= VALUE_ASSERT
;
707 else if (strcmp(CMD_ARGV
[1], "deassert") == 0)
708 value
= VALUE_DEASSERT
;
710 return ERROR_COMMAND_SYNTAX_ERROR
;
712 if (strcmp(CMD_ARGV
[2], "srst") == 0 && srst
== VALUE_UNDEFINED
)
714 else if (strcmp(CMD_ARGV
[2], "trst") == 0 && trst
== VALUE_UNDEFINED
)
717 return ERROR_COMMAND_SYNTAX_ERROR
;
720 if (trst
== VALUE_UNDEFINED
) {
721 if (transport_is_jtag())
722 trst
= jtag_get_trst() ? VALUE_ASSERT
: VALUE_DEASSERT
;
724 trst
= VALUE_DEASSERT
; /* unused, safe value */
727 if (srst
== VALUE_UNDEFINED
) {
728 if (jtag_reset_config
& RESET_HAS_SRST
)
729 srst
= jtag_get_srst() ? VALUE_ASSERT
: VALUE_DEASSERT
;
731 srst
= VALUE_DEASSERT
; /* unused, safe value */
734 if (trst
== VALUE_ASSERT
&& !transport_is_jtag()) {
735 LOG_ERROR("transport has no trst signal");
739 if (srst
== VALUE_ASSERT
&& !(jtag_reset_config
& RESET_HAS_SRST
)) {
740 LOG_ERROR("adapter has no srst signal");
744 return adapter_resets((trst
== VALUE_DEASSERT
) ? TRST_DEASSERT
: TRST_ASSERT
,
745 (srst
== VALUE_DEASSERT
) ? SRST_DEASSERT
: SRST_ASSERT
);
748 #ifdef HAVE_LIBUSB_GET_PORT_NUMBERS
749 COMMAND_HANDLER(handle_usb_location_command
)
752 adapter_usb_set_location(CMD_ARGV
[0]);
754 command_print(CMD
, "adapter usb location: %s", adapter_usb_get_location());
758 #endif /* HAVE_LIBUSB_GET_PORT_NUMBERS */
760 static const struct command_registration adapter_usb_command_handlers
[] = {
761 #ifdef HAVE_LIBUSB_GET_PORT_NUMBERS
764 .handler
= &handle_usb_location_command
,
765 .mode
= COMMAND_CONFIG
,
766 .help
= "display or set the USB bus location of the USB device",
767 .usage
= "[<bus>-port[.port]...]",
769 #endif /* HAVE_LIBUSB_GET_PORT_NUMBERS */
770 COMMAND_REGISTRATION_DONE
773 static const struct command_registration adapter_srst_command_handlers
[] = {
776 .handler
= handle_adapter_srst_delay_command
,
778 .help
= "delay after deasserting SRST in ms",
779 .usage
= "[milliseconds]",
782 .name
= "pulse_width",
783 .handler
= handle_adapter_srst_pulse_width_command
,
785 .help
= "SRST assertion pulse width in ms",
786 .usage
= "[milliseconds]",
788 COMMAND_REGISTRATION_DONE
791 static const struct command_registration adapter_command_handlers
[] = {
794 .handler
= handle_adapter_driver_command
,
795 .mode
= COMMAND_CONFIG
,
796 .help
= "Select a debug adapter driver",
797 .usage
= "driver_name",
801 .handler
= handle_adapter_speed_command
,
803 .help
= "With an argument, change to the specified maximum "
804 "jtag speed. For JTAG, 0 KHz signifies adaptive "
806 "With or without argument, display current setting.",
811 .handler
= handle_adapter_list_command
,
813 .help
= "List all built-in debug adapter drivers",
819 .jim_handler
= jim_adapter_name
,
820 .help
= "Returns the name of the currently "
821 "selected adapter (driver)",
826 .help
= "srst adapter command group",
828 .chain
= adapter_srst_command_handlers
,
831 .name
= "transports",
832 .handler
= adapter_transports_command
,
833 .mode
= COMMAND_CONFIG
,
834 .help
= "Declare transports the adapter supports.",
835 .usage
= "transport ...",
840 .help
= "usb adapter command group",
842 .chain
= adapter_usb_command_handlers
,
846 .handler
= handle_adapter_reset_de_assert
,
847 .mode
= COMMAND_EXEC
,
848 .help
= "Controls SRST and TRST lines.",
849 .usage
= "|deassert [srst|trst [assert|deassert srst|trst]]",
853 .handler
= handle_adapter_reset_de_assert
,
854 .mode
= COMMAND_EXEC
,
855 .help
= "Controls SRST and TRST lines.",
856 .usage
= "|assert [srst|trst [deassert|assert srst|trst]]",
858 COMMAND_REGISTRATION_DONE
861 static const struct command_registration interface_command_handlers
[] = {
865 .help
= "adapter command group",
867 .chain
= adapter_command_handlers
,
870 .name
= "reset_config",
871 .handler
= handle_reset_config_command
,
873 .help
= "configure adapter reset behavior",
874 .usage
= "[none|trst_only|srst_only|trst_and_srst] "
875 "[srst_pulls_trst|trst_pulls_srst|combined|separate] "
876 "[srst_gates_jtag|srst_nogate] "
877 "[trst_push_pull|trst_open_drain] "
878 "[srst_push_pull|srst_open_drain] "
879 "[connect_deassert_srst|connect_assert_srst]",
881 COMMAND_REGISTRATION_DONE
885 * Register the commands which deal with arbitrary debug adapter drivers.
887 * @todo Remove internal assumptions that all debug adapters use JTAG for
888 * transport. Various types and data structures are not named generically.
890 int adapter_register_commands(struct command_context
*ctx
)
892 return register_commands(ctx
, NULL
, interface_command_handlers
);
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)