rename jtag_interface_{init,quit}()
authorDavid Brownell <dbrownell@users.sourceforge.net>
Sun, 14 Mar 2010 20:13:39 +0000 (13:13 -0700)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Sun, 14 Mar 2010 20:13:39 +0000 (13:13 -0700)
These routines apply to non-JTAG debug adapters too.  To
reduce confusion, give them better (non-misleading) names.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/jtag/core.c
src/jtag/jtag.h
src/jtag/tcl.c
src/openocd.c

index 706f2f259553609beaa70a5b18d53be0c6e8c287..e7cb48d76438e7077e290c5543b9613650340d8e 100644 (file)
@@ -1346,7 +1346,11 @@ void jtag_tap_free(struct jtag_tap *tap)
        free(tap);
 }
 
-int jtag_interface_init(struct command_context *cmd_ctx)
+/**
+ * Do low-level setup like initializing registers, output signals,
+ * and clocking.
+ */
+int adapter_init(struct command_context *cmd_ctx)
 {
        if (jtag)
                return ERROR_OK;
@@ -1354,7 +1358,8 @@ int jtag_interface_init(struct command_context *cmd_ctx)
        if (!jtag_interface)
        {
                /* nothing was previously specified by "interface" command */
-               LOG_ERROR("JTAG interface has to be specified, see \"interface\" command");
+               LOG_ERROR("Debug Adapter has to be specified, "
+                       "see \"interface\" command");
                return ERROR_JTAG_INVALID_INTERFACE;
        }
 
@@ -1369,9 +1374,10 @@ int jtag_interface_init(struct command_context *cmd_ctx)
        int actual_khz = requested_khz;
        int retval = jtag_get_speed_readable(&actual_khz);
        if (ERROR_OK != retval)
-               LOG_INFO("interface specific clock speed value %d", jtag_get_speed());
+               LOG_INFO("adapter-specific clock speed value %d", jtag_get_speed());
        else if (actual_khz)
        {
+               /* Adaptive clocking -- JTAG-specific */
                if ((CLOCK_MODE_RCLK == clock_mode)
                        || ((CLOCK_MODE_KHZ == clock_mode) && !requested_khz))
                {
@@ -1459,7 +1465,7 @@ int jtag_init_inner(struct command_context *cmd_ctx)
        return ERROR_OK;
 }
 
-int jtag_interface_quit(void)
+int adapter_quit(void)
 {
        if (!jtag || !jtag->quit)
                return ERROR_OK;
@@ -1477,7 +1483,7 @@ int jtag_init_reset(struct command_context *cmd_ctx)
 {
        int retval;
 
-       if ((retval = jtag_interface_init(cmd_ctx)) != ERROR_OK)
+       if ((retval = adapter_init(cmd_ctx)) != ERROR_OK)
                return retval;
 
        LOG_DEBUG("Initializing with hard TRST+SRST reset");
@@ -1531,7 +1537,7 @@ int jtag_init(struct command_context *cmd_ctx)
 {
        int retval;
 
-       if ((retval = jtag_interface_init(cmd_ctx)) != ERROR_OK)
+       if ((retval = adapter_init(cmd_ctx)) != ERROR_OK)
                return retval;
 
        /* guard against oddball hardware: force resets to be inactive */
index ae85961818557d18cd39674134255d6f96c23678..0bbea5f561cee6287cdfe5723de803580cddd830 100644 (file)
@@ -305,14 +305,11 @@ void jtag_set_verify_capture_ir(bool enable);
 /// @returns True if IR scan verification will be performed.
 bool jtag_will_verify_capture_ir(void);
 
-/**
- * Initialize interface upon startup.  Return a successful no-op upon
- * subsequent invocations.
- */
-int  jtag_interface_init(struct command_context* cmd_ctx);
+/** Initialize debug adapter upon startup.  */
+int  adapter_init(struct command_context* cmd_ctx);
 
-/// Shutdown the JTAG interface upon program exit.
-int  jtag_interface_quit(void);
+/// Shutdown the debug adapter upon program exit.
+int  adapter_quit(void);
 
 /**
  * Initialize JTAG chain using only a RESET reset. If init fails,
index 3ffa930d0bde08593adfdb14964a7e25b9052e6e..ce17e4b85ac36bd8b030ec46e65f267a7c53e5d4 100644 (file)
@@ -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);
index 4250434355c69c147d42ce5ae60ec866a18de11b..d376f5f8e1b1b5923419a9466349e931be483013 100644 (file)
@@ -115,12 +115,12 @@ COMMAND_HANDLER(handle_init_command)
        if (ERROR_OK != retval)
                return ERROR_FAIL;
 
-       if ((retval = jtag_interface_init(CMD_CTX)) != ERROR_OK)
+       if ((retval = adapter_init(CMD_CTX)) != ERROR_OK)
        {
-               /* we must be able to set up the jtag interface */
+               /* we must be able to set up the debug adapter */
                return retval;
        }
-       LOG_DEBUG("jtag interface init complete");
+       LOG_DEBUG("Debug Adapter init complete");
 
        /* Try to initialize & examine the JTAG chain at this point,
         * but continue startup regardless.  Note that platforms
@@ -297,7 +297,7 @@ int openocd_main(int argc, char *argv[])
        /* free commandline interface */
        command_done(cmd_ctx);
 
-       jtag_interface_quit();
+       adapter_quit();
 
        return ret;
 }

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)