#endif // PARPORT_USE_PPDEV
-static int amt_jtagaccel_execute_queue(void);
-static int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx);
-static int amt_jtagaccel_speed(int speed);
-static int amt_jtagaccel_init(void);
-static int amt_jtagaccel_quit(void);
-
-static int amt_jtagaccel_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int amt_jtagaccel_handle_rtck_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
/* tap_move[i][j]: tap movement command to go from state i to state j
* 0: Test-Logic-Reset
* 1: Run-Test/Idle
};
-jtag_interface_t amt_jtagaccel_interface =
-{
- .name = "amt_jtagaccel",
-
- .execute_queue = amt_jtagaccel_execute_queue,
-
- .speed = amt_jtagaccel_speed,
- .register_commands = amt_jtagaccel_register_commands,
- .init = amt_jtagaccel_init,
- .quit = amt_jtagaccel_quit,
-};
-
-static int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "parport_port", amt_jtagaccel_handle_parport_port_command,
- COMMAND_CONFIG, NULL);
- register_command(cmd_ctx, NULL, "rtck", amt_jtagaccel_handle_rtck_command,
- COMMAND_CONFIG, NULL);
-
- return ERROR_OK;
-}
-
static void amt_jtagaccel_reset(int trst, int srst)
{
if (trst == 1)
return ERROR_OK;
}
+
+static int amt_jtagaccel_register_commands(struct command_context_s *cmd_ctx)
+{
+ register_command(cmd_ctx, NULL, "parport_port",
+ amt_jtagaccel_handle_parport_port_command, COMMAND_CONFIG,
+ NULL);
+ register_command(cmd_ctx, NULL, "rtck",
+ amt_jtagaccel_handle_rtck_command, COMMAND_CONFIG,
+ NULL);
+
+ return ERROR_OK;
+}
+
+jtag_interface_t amt_jtagaccel_interface = {
+ .name = "amt_jtagaccel",
+ .register_commands = &amt_jtagaccel_register_commands,
+ .init = &amt_jtagaccel_init,
+ .quit = &amt_jtagaccel_quit,
+ .speed = &amt_jtagaccel_speed,
+ .execute_queue = &amt_jtagaccel_execute_queue,
+ };
#endif
#endif
-static int ft2232_execute_queue(void);
-static int ft2232_speed(int speed);
-static int ft2232_speed_div(int speed, int* khz);
-static int ft2232_khz(int khz, int* jtag_speed);
-static int ft2232_register_commands(struct command_context_s* cmd_ctx);
-static int ft2232_init(void);
-static int ft2232_quit(void);
-
-static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-static int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-
/**
* Send out \a num_cycles on the TCK line while the TAP(s) are in a
* stable state. Calling code must ensure that current state is stable,
clock_tms(0x4b, tms_bits, tms_count, 0);
}
-jtag_interface_t ft2232_interface =
-{
- .name = "ft2232",
- .execute_queue = ft2232_execute_queue,
- .speed = ft2232_speed,
- .speed_div = ft2232_speed_div,
- .khz = ft2232_khz,
- .register_commands = ft2232_register_commands,
- .init = ft2232_init,
- .quit = ft2232_quit,
-};
-
static int ft2232_write(uint8_t* buf, int size, uint32_t* bytes_written)
{
#if BUILD_FT2232_FTD2XX == 1
return ERROR_OK;
}
-static int ft2232_register_commands(struct command_context_s* cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "ft2232_device_desc", ft2232_handle_device_desc_command,
- COMMAND_CONFIG, "the USB device description of the FTDI FT2232 device");
- register_command(cmd_ctx, NULL, "ft2232_serial", ft2232_handle_serial_command,
- COMMAND_CONFIG, "the serial number of the FTDI FT2232 device");
- register_command(cmd_ctx, NULL, "ft2232_layout", ft2232_handle_layout_command,
- COMMAND_CONFIG, "the layout of the FT2232 GPIO signals used to control output-enables and reset signals");
- register_command(cmd_ctx, NULL, "ft2232_vid_pid", ft2232_handle_vid_pid_command,
- COMMAND_CONFIG, "the vendor ID and product ID of the FTDI FT2232 device");
- register_command(cmd_ctx, NULL, "ft2232_latency", ft2232_handle_latency_command,
- COMMAND_CONFIG, "set the FT2232 latency timer to a new value");
- return ERROR_OK;
-}
-
static void ft2232_end_state(tap_state_t state)
{
if (tap_is_state_stable(state))
return retval;
}
-static int ft2232_execute_queue()
+static int ft2232_execute_queue(void)
{
jtag_command_t* cmd = jtag_command_queue; /* currently processed command */
int retval;
buffer_write(high_output);
buffer_write(high_direction);
}
+
+static int ft2232_register_commands(struct command_context_s* cmd_ctx)
+{
+ register_command(cmd_ctx, NULL, "ft2232_device_desc",
+ ft2232_handle_device_desc_command, COMMAND_CONFIG,
+ "the USB device description of the FTDI FT2232 device");
+ register_command(cmd_ctx, NULL, "ft2232_serial",
+ ft2232_handle_serial_command, COMMAND_CONFIG,
+ "the serial number of the FTDI FT2232 device");
+ register_command(cmd_ctx, NULL, "ft2232_layout",
+ ft2232_handle_layout_command, COMMAND_CONFIG,
+ "the layout of the FT2232 GPIO signals used "
+ "to control output-enables and reset signals");
+ register_command(cmd_ctx, NULL, "ft2232_vid_pid",
+ ft2232_handle_vid_pid_command, COMMAND_CONFIG,
+ "the vendor ID and product ID of the FTDI FT2232 device");
+ register_command(cmd_ctx, NULL, "ft2232_latency",
+ ft2232_handle_latency_command, COMMAND_CONFIG,
+ "set the FT2232 latency timer to a new value");
+
+ return ERROR_OK;
+}
+
+
+jtag_interface_t ft2232_interface = {
+ .name = "ft2232",
+ .register_commands = &ft2232_register_commands,
+ .init = &ft2232_init,
+ .quit = &ft2232_quit,
+ .speed = &ft2232_speed,
+ .speed_div = &ft2232_speed_div,
+ .khz = &ft2232_khz,
+ .execute_queue = &ft2232_execute_queue,
+ };
static int device_handle;
#endif
-static int gw16012_execute_queue(void);
-static int gw16012_register_commands(struct command_context_s *cmd_ctx);
-static int gw16012_speed(int speed);
-static int gw16012_init(void);
-static int gw16012_quit(void);
-
-static int gw16012_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
-jtag_interface_t gw16012_interface =
-{
- .name = "gw16012",
-
- .execute_queue = gw16012_execute_queue,
-
- .speed = gw16012_speed,
- .register_commands = gw16012_register_commands,
- .init = gw16012_init,
- .quit = gw16012_quit,
-};
-
-static int gw16012_register_commands(struct command_context_s *cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "parport_port", gw16012_handle_parport_port_command,
- COMMAND_CONFIG, NULL);
-
- return ERROR_OK;
-}
-
static void gw16012_data(uint8_t value)
{
value = (value & 0x7f) | gw16012_msb;
return ERROR_OK;
}
+
+static int gw16012_register_commands(struct command_context_s *cmd_ctx)
+{
+ register_command(cmd_ctx, NULL, "parport_port",
+ gw16012_handle_parport_port_command, COMMAND_CONFIG,
+ NULL);
+
+ return ERROR_OK;
+}
+
+jtag_interface_t gw16012_interface = {
+ .name = "gw16012",
+ .register_commands = &gw16012_register_commands,
+ .init = &gw16012_init,
+ .quit = &gw16012_quit,
+ .speed = &gw16012_speed,
+ .execute_queue = &gw16012_execute_queue,
+ };
static unsigned long statusport;
#endif
-/* low level command set
- */
-static int parport_read(void);
-static void parport_write(int tck, int tms, int tdi);
-static void parport_reset(int trst, int srst);
-static void parport_led(int on);
-
-static int parport_speed(int speed);
-static int parport_register_commands(struct command_context_s *cmd_ctx);
-static int parport_init(void);
-static int parport_quit(void);
-
-/* interface commands */
-static int parport_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int parport_handle_parport_cable_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int parport_handle_write_on_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
-jtag_interface_t parport_interface =
-{
- .name = "parport",
-
- .execute_queue = bitbang_execute_queue,
-
- .speed = parport_speed,
- .register_commands = parport_register_commands,
- .init = parport_init,
- .quit = parport_quit,
-};
-
-static bitbang_interface_t parport_bitbang =
-{
- .read = parport_read,
- .write = parport_write,
- .reset = parport_reset,
- .blink = parport_led
-};
-
static int parport_read(void)
{
int data = 0;
return ERROR_OK;
}
-static int parport_register_commands(struct command_context_s *cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "parport_port", parport_handle_parport_port_command,
- COMMAND_CONFIG, "either the address of the I/O port or the number of the '/dev/parport' device");
- register_command(cmd_ctx, NULL, "parport_cable", parport_handle_parport_cable_command,
- COMMAND_CONFIG, "the layout of the parallel port cable used to connect to the target");
- register_command(cmd_ctx, NULL, "parport_write_on_exit", parport_handle_write_on_exit_command,
- COMMAND_CONFIG, "configure the parallel driver to write a known value to the parallel interface");
-
- return ERROR_OK;
-}
-
#if PARPORT_USE_GIVEIO == 1
static int parport_get_giveio_access(void)
{
}
#endif
+static bitbang_interface_t parport_bitbang = {
+ .read = &parport_read,
+ .write = &parport_write,
+ .reset = &parport_reset,
+ .blink = &parport_led,
+ };
+
static int parport_init(void)
{
cable_t *cur_cable;
return ERROR_OK;
}
+
+static int parport_register_commands(struct command_context_s *cmd_ctx)
+{
+ register_command(cmd_ctx, NULL, "parport_port",
+ parport_handle_parport_port_command, COMMAND_CONFIG,
+ "either the address of the I/O port "
+ "or the number of the '/dev/parport' device");
+
+ register_command(cmd_ctx, NULL, "parport_cable",
+ parport_handle_parport_cable_command, COMMAND_CONFIG,
+ "the layout of the parallel port cable "
+ "used to connect to the target");
+
+ register_command(cmd_ctx, NULL, "parport_write_on_exit",
+ parport_handle_write_on_exit_command, COMMAND_CONFIG,
+ "configure the parallel driver to write "
+ "a known value to the parallel interface");
+
+ return ERROR_OK;
+}
+
+jtag_interface_t parport_interface = {
+ .name = "parport",
+ .register_commands = &parport_register_commands,
+ .init = &parport_init,
+ .quit = &parport_quit,
+ .speed = &parport_speed,
+ .execute_queue = &bitbang_execute_queue,
+ };
extern jtag_interface_t *jtag_interface;
-/* jtag commands */
-static int handle_interface_list_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc);
-static int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_jtag_khz_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_jtag_rclk_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_reset_config_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_jtag_nsrst_delay_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_jtag_ntrst_delay_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_jtag_nsrst_assert_width_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_jtag_ntrst_assert_width_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
-static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
-static int handle_jtag_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_runtest_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
-static int Jim_Command_pathmove(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
-static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const *args);
-
-static int handle_verify_ircapture_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_verify_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int handle_tms_sequence_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
-
enum jtag_tap_cfg_param {
JCFG_EVENT
};
}
-int jtag_register_commands(struct command_context_s *cmd_ctx)
-{
- register_jim(cmd_ctx, "jtag", jim_jtag_command, "perform jtag tap actions");
-
- register_command(cmd_ctx, NULL, "interface", handle_interface_command,
- COMMAND_CONFIG, "try to configure interface");
- register_command(cmd_ctx, NULL,
- "interface_list", &handle_interface_list_command,
- COMMAND_ANY, "list all built-in interfaces");
- register_command(cmd_ctx, NULL, "jtag_khz", handle_jtag_khz_command,
- COMMAND_ANY, "set maximum jtag speed (if supported); "
- "parameter is maximum khz, or 0 for adaptive clocking (RTCK).");
- register_command(cmd_ctx, NULL, "jtag_rclk", handle_jtag_rclk_command,
- COMMAND_ANY, "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed");
- register_command(cmd_ctx, NULL, "reset_config", handle_reset_config_command,
- COMMAND_ANY,
- "reset_config "
- "[none|trst_only|srst_only|trst_and_srst] "
- "[srst_pulls_trst|trst_pulls_srst|combined|separate] "
- "[srst_gates_jtag|srst_nogate] "
- "[trst_push_pull|trst_open_drain] "
- "[srst_push_pull|srst_open_drain]");
- register_command(cmd_ctx, NULL, "jtag_nsrst_delay", handle_jtag_nsrst_delay_command,
- COMMAND_ANY, "jtag_nsrst_delay <ms> - delay after deasserting srst in ms");
- register_command(cmd_ctx, NULL, "jtag_ntrst_delay", handle_jtag_ntrst_delay_command,
- COMMAND_ANY, "jtag_ntrst_delay <ms> - delay after deasserting trst in ms");
- register_command(cmd_ctx, NULL, "jtag_nsrst_assert_width", handle_jtag_nsrst_assert_width_command,
- COMMAND_ANY, "jtag_nsrst_assert_width <ms> - delay after asserting srst in ms");
- register_command(cmd_ctx, NULL, "jtag_ntrst_assert_width", handle_jtag_ntrst_assert_width_command,
- COMMAND_ANY, "jtag_ntrst_assert_width <ms> - delay after asserting trst in ms");
-
- register_command(cmd_ctx, NULL, "scan_chain", handle_scan_chain_command,
- COMMAND_EXEC, "print current scan chain configuration");
-
- register_command(cmd_ctx, NULL, "jtag_reset", handle_jtag_reset_command,
- COMMAND_EXEC, "toggle reset lines <trst> <srst>");
- register_command(cmd_ctx, NULL, "runtest", handle_runtest_command,
- COMMAND_EXEC, "move to Run-Test/Idle, and execute <num_cycles>");
- register_command(cmd_ctx, NULL, "irscan", handle_irscan_command,
- COMMAND_EXEC, "execute IR scan <device> <instr> [dev2] [instr2] ...");
- register_jim(cmd_ctx, "drscan", Jim_Command_drscan, "execute DR scan <device> <num_bits> <value> <num_bits1> <value2> ...");
- register_jim(cmd_ctx, "flush_count", Jim_Command_flush_count, "returns number of times the JTAG queue has been flushed");
- register_jim(cmd_ctx, "pathmove", Jim_Command_pathmove, "move JTAG to state1 then to state2, state3, etc. <state1>,<state2>,<stat3>...");
-
- register_command(cmd_ctx, NULL, "verify_ircapture", handle_verify_ircapture_command,
- COMMAND_ANY, "verify value captured during Capture-IR <enable | disable>");
- register_command(cmd_ctx, NULL, "verify_jtag", handle_verify_jtag_command,
- COMMAND_ANY, "verify value capture <enable | disable>");
- register_command(cmd_ctx, NULL, "tms_sequence", handle_tms_sequence_command,
- COMMAND_ANY, "choose short(default) or long tms_sequence <short | long>");
- return ERROR_OK;
-}
-
static int default_khz(int khz, int *jtag_speed)
{
LOG_ERROR("Translation from khz to jtag_speed not implemented");
return ERROR_OK;
}
+static int handle_interface_list_command(struct command_context_s *cmd_ctx,
+ char *cmd, char **args, int argc)
+{
+ if (strcmp(cmd, "interface_list") == 0 && argc > 0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ command_print(cmd_ctx, "The following JTAG interfaces are available:");
+ for (unsigned i = 0; NULL != jtag_interfaces[i]; i++)
+ {
+ const char *name = jtag_interfaces[i]->name;
+ command_print(cmd_ctx, "%u: %s", i + 1, name);
+ }
+
+ return ERROR_OK;
+}
+
static int handle_interface_command(struct command_context_s *cmd_ctx,
char *cmd, char **args, int argc)
{
return ERROR_JTAG_INVALID_INTERFACE;
}
-static int handle_interface_list_command(struct command_context_s *cmd_ctx,
- char *cmd, char **args, int argc)
-{
- if (strcmp(cmd, "interface_list") == 0 && argc > 0)
- return ERROR_COMMAND_SYNTAX_ERROR;
-
- command_print(cmd_ctx, "The following JTAG interfaces are available:");
- for (unsigned i = 0; NULL != jtag_interfaces[i]; i++)
- {
- const char *name = jtag_interfaces[i]->name;
- command_print(cmd_ctx, "%u: %s", i + 1, name);
- }
-
- return ERROR_OK;
-}
-
static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
jtag_tap_t *tap;
return ERROR_OK;
}
+
+int jtag_register_commands(struct command_context_s *cmd_ctx)
+{
+ register_jim(cmd_ctx, "jtag", jim_jtag_command,
+ "perform jtag tap actions");
+
+ register_command(cmd_ctx, NULL, "interface",
+ handle_interface_command, COMMAND_CONFIG,
+ "try to configure interface");
+ register_command(cmd_ctx, NULL, "interface_list",
+ &handle_interface_list_command, COMMAND_ANY,
+ "list all built-in interfaces");
+
+ register_command(cmd_ctx, NULL, "jtag_khz",
+ handle_jtag_khz_command, COMMAND_ANY,
+ "set maximum jtag speed (if supported); "
+ "parameter is maximum khz, or 0 for adaptive clocking (RTCK).");
+ register_command(cmd_ctx, NULL, "jtag_rclk",
+ handle_jtag_rclk_command, COMMAND_ANY,
+ "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed");
+ register_command(cmd_ctx, NULL, "reset_config",
+ handle_reset_config_command, COMMAND_ANY,
+ "reset_config "
+ "[none|trst_only|srst_only|trst_and_srst] "
+ "[srst_pulls_trst|trst_pulls_srst|combined|separate] "
+ "[srst_gates_jtag|srst_nogate] "
+ "[trst_push_pull|trst_open_drain] "
+ "[srst_push_pull|srst_open_drain]");
+
+ register_command(cmd_ctx, NULL, "jtag_nsrst_delay",
+ handle_jtag_nsrst_delay_command, COMMAND_ANY,
+ "jtag_nsrst_delay <ms> "
+ "- delay after deasserting srst in ms");
+ register_command(cmd_ctx, NULL, "jtag_ntrst_delay",
+ handle_jtag_ntrst_delay_command, COMMAND_ANY,
+ "jtag_ntrst_delay <ms> "
+ "- delay after deasserting trst in ms");
+
+ register_command(cmd_ctx, NULL, "jtag_nsrst_assert_width",
+ handle_jtag_nsrst_assert_width_command, COMMAND_ANY,
+ "jtag_nsrst_assert_width <ms> "
+ "- delay after asserting srst in ms");
+ register_command(cmd_ctx, NULL, "jtag_ntrst_assert_width",
+ handle_jtag_ntrst_assert_width_command, COMMAND_ANY,
+ "jtag_ntrst_assert_width <ms> "
+ "- delay after asserting trst in ms");
+
+ register_command(cmd_ctx, NULL, "scan_chain",
+ handle_scan_chain_command, COMMAND_EXEC,
+ "print current scan chain configuration");
+
+ register_command(cmd_ctx, NULL, "jtag_reset",
+ handle_jtag_reset_command, COMMAND_EXEC,
+ "toggle reset lines <trst> <srst>");
+ register_command(cmd_ctx, NULL, "runtest",
+ handle_runtest_command, COMMAND_EXEC,
+ "move to Run-Test/Idle, and execute <num_cycles>");
+ register_command(cmd_ctx, NULL, "irscan",
+ handle_irscan_command, COMMAND_EXEC,
+ "execute IR scan <device> <instr> [dev2] [instr2] ...");
+
+ register_jim(cmd_ctx, "drscan", Jim_Command_drscan,
+ "execute DR scan <device> "
+ "<num_bits> <value> <num_bits1> <value2> ...");
+
+ register_jim(cmd_ctx, "flush_count", Jim_Command_flush_count,
+ "returns number of times the JTAG queue has been flushed");
+
+ register_jim(cmd_ctx, "pathmove", Jim_Command_pathmove,
+ "<state1>,<state2>,<state3>... "
+ "- move JTAG to state1 then to state2, state3, etc.");
+
+ register_command(cmd_ctx, NULL, "verify_ircapture",
+ handle_verify_ircapture_command, COMMAND_ANY,
+ "verify value captured during Capture-IR <enable | disable>");
+ register_command(cmd_ctx, NULL, "verify_jtag",
+ handle_verify_jtag_command, COMMAND_ANY,
+ "verify value capture <enable | disable>");
+
+ register_command(cmd_ctx, NULL, "tms_sequence",
+ handle_tms_sequence_command, COMMAND_ANY,
+ "choose short(default) or long tms_sequence <short | long>");
+
+ return ERROR_OK;
+}
+
+
static int pending_scan_results_length;
static pending_scan_result_t pending_scan_results_buffer[MAX_PENDING_SCAN_RESULTS];
-/* External interface functions */
-static int vsllink_execute_queue(void);
-static int vsllink_speed(int speed);
-static int vsllink_khz(int khz, int *jtag_speed);
-static int vsllink_speed_div(int jtag_speed, int *khz);
-static int vsllink_register_commands(struct command_context_s *cmd_ctx);
-static int vsllink_init(void);
-static int vsllink_quit(void);
-
-/* CLI command handler functions */
-static int vsllink_handle_usb_vid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int vsllink_handle_usb_pid_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int vsllink_handle_usb_bulkin_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int vsllink_handle_usb_bulkout_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int vsllink_handle_usb_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int vsllink_handle_mode_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
/* Queue command functions */
static void vsllink_end_state(tap_state_t state);
static void vsllink_state_move_dma(void);
static vsllink_jtag_t* vsllink_jtag_handle = NULL;
-/***************************************************************************/
-/* External interface implementation */
-
-jtag_interface_t vsllink_interface =
-{
- .name = "vsllink",
- .execute_queue = vsllink_execute_queue,
- .speed = vsllink_speed,
- .khz = vsllink_khz,
- .speed_div = vsllink_speed_div,
- .register_commands = vsllink_register_commands,
- .init = vsllink_init,
- .quit = vsllink_quit
-};
-
static void reset_command_pointer(void)
{
if (vsllink_mode == VSLLINK_MODE_NORMAL)
}
}
-static int vsllink_register_commands(struct command_context_s *cmd_ctx)
-{
- register_command(cmd_ctx, NULL, "vsllink_usb_vid", vsllink_handle_usb_vid_command,
- COMMAND_CONFIG, NULL);
- register_command(cmd_ctx, NULL, "vsllink_usb_pid", vsllink_handle_usb_pid_command,
- COMMAND_CONFIG, NULL);
- register_command(cmd_ctx, NULL, "vsllink_usb_bulkin", vsllink_handle_usb_bulkin_command,
- COMMAND_CONFIG, NULL);
- register_command(cmd_ctx, NULL, "vsllink_usb_bulkout", vsllink_handle_usb_bulkout_command,
- COMMAND_CONFIG, NULL);
- register_command(cmd_ctx, NULL, "vsllink_usb_interface", vsllink_handle_usb_interface_command,
- COMMAND_CONFIG, NULL);
- register_command(cmd_ctx, NULL, "vsllink_mode", vsllink_handle_mode_command,
- COMMAND_CONFIG, NULL);
-
- return ERROR_OK;
-}
-
static int vsllink_handle_mode_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc != 1) {
}
}
#endif // _DEBUG_USB_COMMS_ || _DEBUG_JTAG_IO_
+
+static int vsllink_register_commands(struct command_context_s *cmd_ctx)
+{
+ register_command(cmd_ctx, NULL, "vsllink_usb_vid",
+ vsllink_handle_usb_vid_command, COMMAND_CONFIG,
+ NULL);
+ register_command(cmd_ctx, NULL, "vsllink_usb_pid",
+ vsllink_handle_usb_pid_command, COMMAND_CONFIG,
+ NULL);
+ register_command(cmd_ctx, NULL, "vsllink_usb_bulkin",
+ vsllink_handle_usb_bulkin_command, COMMAND_CONFIG,
+ NULL);
+ register_command(cmd_ctx, NULL, "vsllink_usb_bulkout",
+ vsllink_handle_usb_bulkout_command, COMMAND_CONFIG,
+ NULL);
+ register_command(cmd_ctx, NULL, "vsllink_usb_interface",
+ vsllink_handle_usb_interface_command, COMMAND_CONFIG,
+ NULL);
+ register_command(cmd_ctx, NULL, "vsllink_mode",
+ vsllink_handle_mode_command, COMMAND_CONFIG,
+ NULL);
+
+ return ERROR_OK;
+}
+
+jtag_interface_t vsllink_interface = {
+ .name = "vsllink",
+ .register_commands = &vsllink_register_commands,
+ .init = &vsllink_init,
+ .quit = &vsllink_quit,
+ .khz = &vsllink_khz,
+ .speed = &vsllink_speed,
+ .speed_div = &vsllink_speed_div,
+ .execute_queue = &vsllink_execute_queue,
+ };