move "reset_config" out of JTAG command group
[openocd.git] / src / jtag / tcl.c
index 1073abc024887bc4ffb9420058efa4cd8070adf0..90081cdcc6e82c8e38124367b887b6547cb175c0 100644 (file)
@@ -985,7 +985,7 @@ COMMAND_HANDLER(handle_interface_list_command)
        if (strcmp(CMD_NAME, "interface_list") == 0 && CMD_ARGC > 0)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       command_print(CMD_CTX, "The following JTAG interfaces are available:");
+       command_print(CMD_CTX, "The following debug interfaces are available:");
        for (unsigned i = 0; NULL != jtag_interfaces[i]; i++)
        {
                const char *name = jtag_interfaces[i]->name;
@@ -1038,7 +1038,7 @@ COMMAND_HANDLER(handle_interface_command)
        /* no valid interface was found (i.e. the configuration option,
         * didn't match one of the compiled-in interfaces
         */
-       LOG_ERROR("The specified JTAG interface was not found (%s)", CMD_ARGV[0]);
+       LOG_ERROR("The specified debug interface was not found (%s)", CMD_ARGV[0]);
        CALL_COMMAND_HANDLER(handle_interface_list_command);
        return ERROR_JTAG_INVALID_INTERFACE;
 }
@@ -1291,7 +1291,7 @@ next:
        return ERROR_OK;
 }
 
-COMMAND_HANDLER(handle_jtag_nsrst_delay_command)
+COMMAND_HANDLER(handle_adapter_nsrst_delay_command)
 {
        if (CMD_ARGC > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1302,7 +1302,7 @@ COMMAND_HANDLER(handle_jtag_nsrst_delay_command)
 
                jtag_set_nsrst_delay(delay);
        }
-       command_print(CMD_CTX, "jtag_nsrst_delay: %u", jtag_get_nsrst_delay());
+       command_print(CMD_CTX, "adapter_nsrst_delay: %u", jtag_get_nsrst_delay());
        return ERROR_OK;
 }
 
@@ -1321,7 +1321,7 @@ COMMAND_HANDLER(handle_jtag_ntrst_delay_command)
        return ERROR_OK;
 }
 
-COMMAND_HANDLER(handle_jtag_nsrst_assert_width_command)
+COMMAND_HANDLER(handle_adapter_nsrst_assert_width_command)
 {
        if (CMD_ARGC > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1332,7 +1332,7 @@ COMMAND_HANDLER(handle_jtag_nsrst_assert_width_command)
 
                jtag_set_nsrst_assert_width(delay);
        }
-       command_print(CMD_CTX, "jtag_nsrst_assert_width: %u", jtag_get_nsrst_assert_width());
+       command_print(CMD_CTX, "adapter_nsrst_assert_width: %u", jtag_get_nsrst_assert_width());
        return ERROR_OK;
 }
 
@@ -1351,7 +1351,7 @@ COMMAND_HANDLER(handle_jtag_ntrst_assert_width_command)
        return ERROR_OK;
 }
 
-COMMAND_HANDLER(handle_jtag_khz_command)
+COMMAND_HANDLER(handle_adapter_khz_command)
 {
        if (CMD_ARGC > 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -1430,7 +1430,7 @@ COMMAND_HANDLER(handle_jtag_reset_command)
        else
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       if (jtag_interface_init(CMD_CTX) != ERROR_OK)
+       if (adapter_init(CMD_CTX) != ERROR_OK)
                return ERROR_JTAG_INIT_FAILED;
 
        jtag_add_reset(trst, srst);
@@ -1607,55 +1607,78 @@ COMMAND_HANDLER(handle_tms_sequence_command)
        return ERROR_OK;
 }
 
-static const struct command_registration jtag_command_handlers[] = {
+static const struct command_registration interface_command_handlers[] = {
+       {
+               .name = "adapter_khz",
+               .handler = handle_adapter_khz_command,
+               .mode = COMMAND_ANY,
+               .help = "With an argument, change to the specified maximum "
+                       "jtag speed.  For JTAG, 0 KHz signifies adaptive "
+                       " clocking. "
+                       "With or without argument, display current setting.",
+               .usage = "[khz]",
+       },
+       {
+               .name = "adapter_nsrst_assert_width",
+               .handler = handle_adapter_nsrst_assert_width_command,
+               .mode = COMMAND_ANY,
+               .help = "delay after asserting SRST in ms",
+               .usage = "[milliseconds]",
+       },
+       {
+               .name = "adapter_nsrst_delay",
+               .handler = handle_adapter_nsrst_delay_command,
+               .mode = COMMAND_ANY,
+               .help = "delay after deasserting SRST in ms",
+               .usage = "[milliseconds]",
+       },
        {
                .name = "interface",
                .handler = handle_interface_command,
                .mode = COMMAND_CONFIG,
-               .help = "Select a JTAG interface",
+               .help = "Select a debug adapter interface (driver)",
                .usage = "driver_name",
        },
        {
                .name = "interface_list",
                .handler = handle_interface_list_command,
                .mode = COMMAND_ANY,
-               .help = "List all built-in interfaces",
-       },
-       {
-               .name = "jtag_khz",
-               .handler = handle_jtag_khz_command,
-               .mode = COMMAND_ANY,
-               .help = "With an argument, change to the specified maximum "
-                       "jtag speed.  Pass 0 to require adaptive clocking. "
-                       "With or without argument, display current setting.",
-               .usage = "[khz]",
-       },
-       {
-               .name = "jtag_rclk",
-               .handler = handle_jtag_rclk_command,
-               .mode = COMMAND_ANY,
-               .help = "With an argument, change to to use adaptive clocking "
-                       "if possible; else to use the fallback speed.  "
-                       "With or without argument, display current setting.",
-               .usage = "[fallback_speed_khz]",
+               .help = "List all built-in debug adapter interfaces (drivers)",
        },
        {
                .name = "reset_config",
                .handler = handle_reset_config_command,
                .mode = COMMAND_ANY,
-               .help = "configure JTAG reset behavior",
+               .help = "configure adapter reset behavior",
                .usage = "[none|trst_only|srst_only|trst_and_srst] "
                        "[srst_pulls_trst|trst_pulls_srst|combined|separate] "
                        "[srst_gates_jtag|srst_nogate] "
                        "[trst_push_pull|trst_open_drain] "
                        "[srst_push_pull|srst_open_drain]",
        },
+       COMMAND_REGISTRATION_DONE
+};
+
+/**
+ * Register the commands which deal with arbitrary debug adapter drivers.
+ *
+ * @todo Remove internal assumptions that all debug adapters use JTAG for
+ * transport.  Various types and data structures are not named generically.
+ */
+int interface_register_commands(struct command_context *ctx)
+{
+       return register_commands(ctx, NULL, interface_command_handlers);
+}
+
+static const struct command_registration jtag_command_handlers[] = {
        {
-               .name = "jtag_nsrst_delay",
-               .handler = handle_jtag_nsrst_delay_command,
+               .name = "jtag_rclk",
+               .handler = handle_jtag_rclk_command,
                .mode = COMMAND_ANY,
-               .help = "delay after deasserting srst in ms",
-               .usage = "[milliseconds]",
+               .help = "With an argument, change to to use adaptive clocking "
+                       "if possible; else to use the fallback speed.  "
+                       "With or without argument, display current setting.",
+               .usage = "[fallback_speed_khz]",
        },
        {
                .name = "jtag_ntrst_delay",
@@ -1664,13 +1687,6 @@ static const struct command_registration jtag_command_handlers[] = {
                .help = "delay after deasserting trst in ms",
                .usage = "[milliseconds]",
        },
-       {
-               .name = "jtag_nsrst_assert_width",
-               .handler = handle_jtag_nsrst_assert_width_command,
-               .mode = COMMAND_ANY,
-               .help = "delay after asserting srst in ms",
-               .usage = "[milliseconds]",
-       },
        {
                .name = "jtag_ntrst_assert_width",
                .handler = handle_jtag_ntrst_assert_width_command,
@@ -1746,6 +1762,7 @@ static const struct command_registration jtag_command_handlers[] = {
        },
        COMMAND_REGISTRATION_DONE
 };
+
 int jtag_register_commands(struct command_context *cmd_ctx)
 {
        return register_commands(cmd_ctx, NULL, jtag_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)