static enum {CLOCK_MODE_UNSELECTED, CLOCK_MODE_KHZ, CLOCK_MODE_RCLK} clock_mode;
static int jtag_speed;
-static struct jtag_interface *jtag;
+/* FIXME: change name to this variable, it is not anymore JTAG only */
+static struct adapter_driver *jtag;
-/* configuration */
-struct jtag_interface *jtag_interface;
+extern struct adapter_driver *adapter_driver;
void jtag_set_flush_queue_sleep(int ms)
{
{
int retval;
- if (!(jtag->supported & DEBUG_CAP_TMS_SEQ))
+ if (!(jtag->jtag_ops->supported & DEBUG_CAP_TMS_SEQ))
return ERROR_JTAG_NOT_IMPLEMENTED;
jtag_checks();
if (trst_with_tlr) {
LOG_DEBUG("JTAG reset with TLR instead of TRST");
jtag_add_tlr();
+ jtag_execute_queue();
} else if (jtag_trst != new_trst) {
jtag_trst = new_trst;
* The fix can be applied immediately after next release (v0.11.0 ?)
*/
LOG_ERROR("JTAG API jtag_execute_queue() called on non JTAG interface");
- if (!jtag->execute_queue)
+ if (!jtag->jtag_ops || !jtag->jtag_ops->execute_queue)
return ERROR_OK;
}
- int result = jtag->execute_queue();
+ int result = jtag->jtag_ops->execute_queue();
#if !BUILD_ZY1000
/* Only build this if we use a regular driver with a command queue.
if (jtag)
return ERROR_OK;
- if (!jtag_interface) {
- /* nothing was previously specified by "interface" command */
+ if (!adapter_driver) {
+ /* nothing was previously specified by "adapter driver" command */
LOG_ERROR("Debug Adapter has to be specified, "
- "see \"interface\" command");
+ "see \"adapter driver\" command");
return ERROR_JTAG_INVALID_INTERFACE;
}
int retval;
- retval = jtag_interface->init();
+ retval = adapter_driver->init();
if (retval != ERROR_OK)
return retval;
- jtag = jtag_interface;
+ jtag = adapter_driver;
if (jtag->speed == NULL) {
LOG_INFO("This adapter doesn't support configurable speed");
if (CLOCK_MODE_UNSELECTED == clock_mode) {
LOG_ERROR("An adapter speed is not selected in the init script."
- " Insert a call to adapter_khz or jtag_rclk to proceed.");
+ " Insert a call to \"adapter speed\" or \"jtag_rclk\" to proceed.");
return ERROR_JTAG_INIT_FAILED;
}
else
jtag_add_reset(0, 1);
return ERROR_OK;
- } else if (transport_is_swd() || transport_is_hla())
+ } else if (transport_is_swd() || transport_is_hla() ||
+ transport_is_dapdirect_jtag() || transport_is_dapdirect_swd())
return adapter_system_reset(1);
else if (get_current_transport() != NULL)
LOG_ERROR("reset is not supported on %s",
if (transport_is_jtag()) {
jtag_add_reset(0, 0);
return ERROR_OK;
- } else if (transport_is_swd() || transport_is_hla())
+ } else if (transport_is_swd() || transport_is_hla() ||
+ transport_is_dapdirect_jtag() || transport_is_dapdirect_swd())
return adapter_system_reset(0);
else if (get_current_transport() != NULL)
LOG_ERROR("reset is not supported on %s",