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;
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;
}
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))
{
return ERROR_OK;
}
-int jtag_interface_quit(void)
+int adapter_quit(void)
{
if (!jtag || !jtag->quit)
return ERROR_OK;
{
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");
{
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 */
/// @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,
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);
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
/* free commandline interface */
command_done(cmd_ctx);
- jtag_interface_quit();
+ adapter_quit();
return ret;
}