rename jtag_khz as adapter_khz
[openocd.git] / src / jtag / tcl.c
index 1073abc024887bc4ffb9420058efa4cd8070adf0..8faefd1a93f5d5b90ba341258c9171c373045ef4 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;
 }
@@ -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,29 +1607,45 @@ 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 = "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]",
+               .help = "List all built-in debug adapter interfaces (drivers)",
        },
+       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_rclk",
                .handler = handle_jtag_rclk_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)