static int speed_khz = 0;
/* speed to fallback to when RCLK is requested but not supported */
static int rclk_fallback_speed_khz = 0;
-static enum {CLOCK_MODE_SPEED, CLOCK_MODE_KHZ, CLOCK_MODE_RCLK} clock_mode;
+static enum {CLOCK_MODE_UNSELECTED, CLOCK_MODE_KHZ, CLOCK_MODE_RCLK} clock_mode;
static int jtag_speed = 0;
static struct jtag_interface *jtag = NULL;
return retval;
}
+ 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.");
+ return ERROR_JTAG_INIT_FAILED;
+ }
+
int requested_khz = jtag_get_speed_khz();
int actual_khz = requested_khz;
int jtag_speed_var;
retval = jtag_get_speed(&jtag_speed_var);
+ if (retval != ERROR_OK)
+ return retval;
+ retval = jtag->speed(jtag_speed_var);
if (retval != ERROR_OK)
return retval;
retval = jtag_get_speed_readable(&actual_khz);
{
switch(clock_mode)
{
- case CLOCK_MODE_SPEED:
- *speed = jtag_speed;
- break;
case CLOCK_MODE_KHZ:
adapter_khz_to_speed(jtag_get_speed_khz(), speed);
break;
aw_control_fsm |= 0x04;
AMT_AW(aw_control_fsm);
- int jtag_speed_var;
- int retval = jtag_get_speed(&jtag_speed_var);
- if (retval != ERROR_OK)
- return retval;
- amt_jtagaccel_speed(jtag_speed_var);
-
enum reset_types jtag_reset_config = jtag_get_reset_config();
if (jtag_reset_config & RESET_TRST_OPEN_DRAIN)
aw_control_rst &= ~0x8;
return ERROR_JTAG_INIT_FAILED;
}
- int jtag_speed_var;
- retval = jtag_get_speed(&jtag_speed_var);
- if (retval != ERROR_OK)
- return retval;
- ft2232_speed(jtag_speed_var);
-
buf[0] = 0x85; /* Disconnect TDI/DO to TDO/DI for Loopback */
if ((retval = ft2232_write(buf, 1, &bytes_written)) != ERROR_OK)
{
gw16012_input(&status_port);
gw16012_msb = (status_port & 0x80) ^ 0x80;
- int jtag_speed_var;
- int retval = jtag_get_speed(&jtag_speed_var);
- if (retval != ERROR_OK)
- return retval;
- gw16012_speed(jtag_speed_var);
gw16012_reset(0, 0);
return ERROR_OK;
jlink_reset(0, 0);
jtag_sleep(3000);
jlink_tap_init();
- int jtag_speed_var;
- int retval = jtag_get_speed(&jtag_speed_var);
- if (retval != ERROR_OK)
- return retval;
- jlink_speed(jtag_speed_var);
/* v5/6 jlink seems to have an issue if the first tap move
* is not divisible by 8, so we send a TLR on first power up */
bitbang_interface = &parport_bitbang;
- int retval = jtag_get_speed(&wait_states);
- if (retval != ERROR_OK)
- return retval;
-
return ERROR_OK;
}
}
LOG_INFO("PRESTO open, serial number '%s'", presto->serial);
- /* use JTAG speed setting from configuration file */
- int jtag_speed_var;
- int retval = jtag_get_speed(&jtag_speed_var);
- if (retval != ERROR_OK)
- return retval;
- presto_jtag_speed(jtag_speed_var);
-
bitq_interface = &presto_bitq;
return ERROR_OK;
}
tap_state_queue_init();
dtc_queue_init();
- int jtag_speed_var;
- int retval = jtag_get_speed(&jtag_speed_var);
- if (retval != ERROR_OK)
- return retval;
- rlink_speed(jtag_speed_var);
rlink_reset(0, 0);
return ERROR_OK;
bitbang_interface = &usb_blaster_bitbang;
- int jtag_speed_var;
- int retval = jtag_get_speed(&jtag_speed_var);
- if (retval != ERROR_OK)
- return retval;
- usb_blaster_speed(jtag_speed_var);
-
#if 0
#if BUILD_USB_BLASTER_FTD2XX == 1
if ((status = FT_Purge(ftdih, FT_PURGE_RX | FT_PURGE_TX)) != FT_OK)
/* deassert resets. Important to avoid infinite loop waiting for SRST to deassert */
zy1000_reset(0, 0);
- int jtag_speed_var;
- int retval = jtag_get_speed(&jtag_speed_var);
- if (retval != ERROR_OK)
- return retval;
- zy1000_speed(jtag_speed_var);
#if BUILD_ZY1000_MASTER
#if BUILD_ECOSBOARD