return retval;
}
+ if (jtag->speed == NULL) {
+ LOG_INFO("This adapter doesn't support configurable speed");
+ return ERROR_OK;
+ }
+
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.");
static void at91rm9200_write(int tck, int tms, int tdi);
static void at91rm9200_reset(int trst, int srst);
-static int at91rm9200_speed(int speed);
static int at91rm9200_init(void);
static int at91rm9200_quit(void);
pio_base[device->SRST_PIO + PIO_CODR] = device->SRST_MASK;
}
-static int at91rm9200_speed(int speed)
-{
-
- return ERROR_OK;
-}
-
COMMAND_HANDLER(at91rm9200_handle_device_command)
{
if (CMD_ARGC == 0)
struct jtag_interface at91rm9200_interface = {
.name = "at91rm9200",
.execute_queue = bitbang_execute_queue,
- .speed = at91rm9200_speed,
.commands = at91rm9200_command_handlers,
.init = at91rm9200_init,
.quit = at91rm9200_quit,
#undef DEBUG_SERIAL
/*#define DEBUG_SERIAL */
static int buspirate_execute_queue(void);
-static int buspirate_speed(int speed);
-static int buspirate_khz(int khz, int *jtag_speed);
static int buspirate_init(void);
static int buspirate_quit(void);
static void buspirate_serial_close(int fd);
static void buspirate_print_buffer(char *buf, int size);
-static int buspirate_speed(int speed)
-{
- /* TODO */
- LOG_INFO("Want to set speed to %dkHz, but not implemented yet", speed);
- return ERROR_OK;
-}
-
-static int buspirate_khz(int khz, int *jtag_speed)
-{
- *jtag_speed = khz;
- return ERROR_OK;
-}
-
static int buspirate_execute_queue(void)
{
/* currently processed command */
struct jtag_interface buspirate_interface = {
.name = "buspirate",
.execute_queue = buspirate_execute_queue,
- .speed = buspirate_speed,
- .khz = buspirate_khz,
.commands = buspirate_command_handlers,
.init = buspirate_init,
.quit = buspirate_quit
static void ep93xx_write(int tck, int tms, int tdi);
static void ep93xx_reset(int trst, int srst);
-static int ep93xx_speed(int speed);
static int ep93xx_init(void);
static int ep93xx_quit(void);
.supported = DEBUG_CAP_TMS_SEQ,
.execute_queue = bitbang_execute_queue,
- .speed = ep93xx_speed,
.init = ep93xx_init,
.quit = ep93xx_quit,
};
nanosleep(&ep93xx_zzzz, NULL);
}
-static int ep93xx_speed(int speed)
-{
-
- return ERROR_OK;
-}
-
static int set_gonk_mode(void)
{
void *syscon;
gw16012_control(0x0b);
}
-static int gw16012_speed(int speed)
-{
-
- return ERROR_OK;
-}
-
static void gw16012_end_state(tap_state_t state)
{
if (tap_is_state_stable(state))
.init = gw16012_init,
.quit = gw16012_quit,
- .speed = gw16012_speed,
.execute_queue = gw16012_execute_queue,
};
/* External interface functions */
static int opendous_execute_queue(void);
-static int opendous_speed(int speed);
-static int opendous_speed_div(int speed, int *khz);
-static int opendous_khz(int khz, int *jtag_speed);
static int opendous_init(void);
static int opendous_quit(void);
.name = "opendous",
.commands = opendous_command_handlers,
.execute_queue = opendous_execute_queue,
- .speed = opendous_speed,
- .speed_div = opendous_speed_div,
- .khz = opendous_khz,
.init = opendous_init,
.quit = opendous_quit,
};
return opendous_tap_execute();
}
-/* Sets speed in kHz. */
-static int opendous_speed(int speed)
-{
- if (speed <= OPENDOUS_MAX_SPEED) {
- /* one day... */
- return ERROR_OK;
- } else
- LOG_INFO("Requested speed %dkHz exceeds maximum of %dkHz, ignored", speed, OPENDOUS_MAX_SPEED);
-
- return ERROR_OK;
-}
-
-static int opendous_speed_div(int speed, int *khz)
-{
- *khz = speed;
-
- return ERROR_OK;
-}
-
-static int opendous_khz(int khz, int *jtag_speed)
-{
- *jtag_speed = khz;
- /* TODO: convert this into delay value for opendous */
-
- return ERROR_OK;
-}
-
static int opendous_init(void)
{
int check_cnt;
return ERROR_OK;
}
-static int osbdm_khz(int khz, int *speed)
-{
- *speed = khz;
- return ERROR_OK;
-}
-
-static int osbdm_speed(int speed)
-{
- return ERROR_OK;
-}
-
-static int osbdm_speed_div(int speed, int *khz)
-{
- *khz = speed;
- return ERROR_OK;
-}
-
struct jtag_interface osbdm_interface = {
.name = "osbdm",
.transports = jtag_only,
.execute_queue = osbdm_execute_queue,
- .khz = osbdm_khz,
- .speed = osbdm_speed,
- .speed_div = osbdm_speed_div,
-
.init = osbdm_init,
.quit = osbdm_quit
};
.blink = &remote_bitbang_blink,
};
-static int remote_bitbang_speed(int speed)
-{
- return ERROR_OK;
-}
-
static int remote_bitbang_init_tcp(void)
{
LOG_INFO("Connecting to %s:%i", remote_bitbang_host, remote_bitbang_port);
return remote_bitbang_init_tcp();
}
-static int remote_bitbang_khz(int khz, int *jtag_speed)
-{
- *jtag_speed = 0;
- return ERROR_OK;
-}
-
-static int remote_bitbang_speed_div(int speed, int *khz)
-{
- /* I don't think this really matters any. */
- *khz = 1;
- return ERROR_OK;
-}
-
COMMAND_HANDLER(remote_bitbang_handle_remote_bitbang_port_command)
{
if (CMD_ARGC == 1) {
struct jtag_interface remote_bitbang_interface = {
.name = "remote_bitbang",
.execute_queue = &bitbang_execute_queue,
- .speed = &remote_bitbang_speed,
.commands = remote_bitbang_command_handlers,
.init = &remote_bitbang_init,
.quit = &remote_bitbang_quit,
- .khz = &remote_bitbang_khz,
- .speed_div = &remote_bitbang_speed_div,
};
}
}
-/* No speed control is implemented yet */
-static int sysfsgpio_speed(int speed)
-{
- return ERROR_OK;
-}
-
-static int sysfsgpio_khz(int khz, int *jtag_speed)
-{
- /* no adaptive clocking */
- if (khz == 0)
- return ERROR_FAIL;
-
- *jtag_speed = 0;
- return ERROR_OK;
-}
-
-static int sysfsgpio_speed_div(int speed, int *khz)
-{
- *khz = 1;
- return ERROR_OK;
-}
-
/* gpio numbers for each gpio. Negative values are invalid */
static int tck_gpio = -1;
static int tms_gpio = -1;
.supported = DEBUG_CAP_TMS_SEQ,
.execute_queue = bitbang_execute_queue,
.transports = jtag_only,
- .speed = sysfsgpio_speed,
- .khz = sysfsgpio_khz,
- .speed_div = sysfsgpio_speed_div,
.commands = sysfsgpio_command_handlers,
.init = sysfsgpio_init,
.quit = sysfsgpio_quit,
usb_blaster_addtowritebuffer(out_value, false);
}
-static int usb_blaster_speed(int speed)
-{
-#if BUILD_USB_BLASTER_FTD2XX == 1
- LOG_DEBUG("TODO: usb_blaster_speed() isn't implemented for libftd2xx!");
-#elif BUILD_USB_BLASTER_LIBFTDI == 1
- LOG_DEBUG("TODO: usb_blaster_speed() isn't optimally implemented!");
-
- /* TODO: libftdi's ftdi_set_baudrate chokes on high rates, use lowlevel
- * usb function instead! And additionally allow user to throttle.
- */
- if (ftdi_set_baudrate(&ftdic, 3000000 / 4) < 0) {
- LOG_ERROR("Can't set baud rate to max: %s",
- ftdi_get_error_string(&ftdic));
- return ERROR_JTAG_DEVICE_ERROR;
- }
- ;
-#endif
-
- return ERROR_OK;
-}
-
static void usb_blaster_reset(int trst, int srst)
{
LOG_DEBUG("TODO: usb_blaster_reset(%d,%d) isn't implemented!",
.execute_queue = bitbang_execute_queue,
- .speed = usb_blaster_speed,
.init = usb_blaster_init,
.quit = usb_blaster_quit,
};
static void usbprog_jtag_set_bit(struct usbprog_jtag *usbprog_jtag, int bit, int value);
/* static int usbprog_jtag_get_bit(struct usbprog_jtag *usbprog_jtag, int bit); */
-static int usbprog_speed(int speed)
-{
- return ERROR_OK;
-}
-
static int usbprog_execute_queue(void)
{
struct jtag_command *cmd = jtag_command_queue; /* currently processed command */
.name = "usbprog",
.execute_queue = usbprog_execute_queue,
- .speed = usbprog_speed,
.init = usbprog_init,
.quit = usbprog_quit
};
return ERROR_OK;
}
-static int hl_interface_speed(int speed)
-{
- LOG_DEBUG("hl_interface_speed: ignore speed %d", speed);
-
- return ERROR_OK;
-}
-
-static int hl_speed_div(int speed, int *khz)
-{
- *khz = speed;
- return ERROR_OK;
-}
-
-static int hl_khz(int khz, int *jtag_speed)
-{
- *jtag_speed = khz;
- return ERROR_OK;
-}
-
static int hl_interface_execute_queue(void)
{
LOG_DEBUG("hl_interface_execute_queue: ignored");
.transports = hl_transports,
.init = hl_interface_init,
.quit = hl_interface_quit,
- .speed = hl_interface_speed,
- .speed_div = hl_speed_div,
- .khz = hl_khz,
.execute_queue = hl_interface_execute_queue,
};
# These are already the defaults.
# usb_blaster_vid_pid 0x09FB 0x6001
# usb_blaster_device_desc "USB-Blaster"
-adapter_khz 3000
#
interface osbdm
reset_config srst_only
-
-#
-# OSBDM doesn't support speed control
-#
-adapter_khz 1
hla_device_desc "ST-LINK/V1"
hla_vid_pid 0x0483 0x3744
-# unused but set to disable warnings
-adapter_khz 1000
hla_device_desc "ST-LINK/V2"
hla_vid_pid 0x0483 0x3748
-# unused but set to disable warnings
-adapter_khz 1000
interface sysfsgpio
-# This has no effect on the driver, but is required
-adapter_khz 100
-
# Each of the JTAG lines need a gpio number set: tck tms tdi tdo
# Header pin numbers: 23 22 19 21
sysfsgpio_jtag_nums 11 25 10 9
hla_layout ti-icdi
hla_vid_pid 0x1cbe 0x00fd
-# unused but set to disable warnings
-adapter_khz 1000
interface usb_blaster
usb_blaster_vid_pid 0x16C0 0x06AD
usb_blaster_device_desc "USB-JTAG-IF"
-adapter_khz 3000
-