OpenOCD
vsllink.c File Reference
Include dependency graph for vsllink.c:

Go to the source code of this file.

Data Structures

struct  pending_scan_result
 
struct  vsllink
 

Macros

#define BYTES_PER_LINE   16
 
#define MAX_PENDING_SCAN_RESULTS   256
 

Functions

 COMMAND_HANDLER (vsllink_handle_usb_bulkin_command)
 
 COMMAND_HANDLER (vsllink_handle_usb_bulkout_command)
 
 COMMAND_HANDLER (vsllink_handle_usb_interface_command)
 
 COMMAND_HANDLER (vsllink_handle_usb_pid_command)
 
 COMMAND_HANDLER (vsllink_handle_usb_vid_command)
 
static int vsllink_check_usb_strings (struct libusb_device_handle *usb_device_handle, struct libusb_device_descriptor *usb_desc)
 
static void vsllink_debug_buffer (uint8_t *buffer, int length)
 
static void vsllink_end_state (tap_state_t state)
 
static int vsllink_execute_queue (void)
 
static void vsllink_free_buffer (void)
 
static int vsllink_init (void)
 
static int vsllink_interface_init (void)
 
static int vsllink_jtag_execute (void)
 
static int vsllink_khz (int khz, int *jtag_speed)
 
static void vsllink_path_move (int num_states, tap_state_t *path)
 
static int vsllink_quit (void)
 
static int vsllink_reset (int trst, int srst)
 
static void vsllink_runtest (int num_cycles)
 
static void vsllink_scan (bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command)
 
static int vsllink_speed (int speed)
 
static int vsllink_speed_div (int jtag_speed, int *khz)
 
static void vsllink_stableclocks (int num_cycles, int tms)
 
static void vsllink_state_move (void)
 
static int_least32_t vsllink_swd_frequency (int_least32_t hz)
 
static int vsllink_swd_init (void)
 
static void vsllink_swd_read_reg (uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk)
 
static int vsllink_swd_run_queue (void)
 
static int vsllink_swd_switch_seq (enum swd_special_seq seq)
 
static void vsllink_swd_write_reg (uint8_t cmd, uint32_t value, uint32_t ap_delay_clk)
 
static void vsllink_tap_append_scan (int length, uint8_t *buffer, struct scan_command *command)
 
static void vsllink_tap_append_step (int tms, int tdi)
 
static void vsllink_tap_ensure_pending (int scans)
 
static int vsllink_tap_execute (void)
 
static void vsllink_tap_init (void)
 
static void vsllink_tms (int num_bits, const uint8_t *bits)
 
static void vsllink_usb_close (struct vsllink *vsllink)
 
static int vsllink_usb_open (struct vsllink *vsllink)
 

Variables

static struct pending_scan_result pending_scan_results_buffer [MAX_PENDING_SCAN_RESULTS]
 
static int pending_scan_results_length
 
static bool swd_mode
 
static int tap_buffer_size
 
static int tap_length
 
static uint8_t * tdi_buffer
 
static uint8_t * tdo_buffer
 
static uint8_t * tms_buffer
 
struct adapter_driver vsllink_adapter_driver
 
static const struct command_registration vsllink_command_handlers []
 
static struct vsllinkvsllink_handle
 
static struct jtag_interface vsllink_interface
 
static const struct command_registration vsllink_subcommand_handlers []
 
static const struct swd_driver vsllink_swd_driver
 
static int vsllink_tms_offset
 
static const char *const vsllink_transports [] = {"jtag", "swd", NULL}
 

Macro Definition Documentation

◆ BYTES_PER_LINE

#define BYTES_PER_LINE   16

Definition at line 847 of file vsllink.c.

◆ MAX_PENDING_SCAN_RESULTS

#define MAX_PENDING_SCAN_RESULTS   256

Definition at line 37 of file vsllink.c.

Function Documentation

◆ COMMAND_HANDLER() [1/5]

COMMAND_HANDLER ( vsllink_handle_usb_bulkin_command  )

◆ COMMAND_HANDLER() [2/5]

COMMAND_HANDLER ( vsllink_handle_usb_bulkout_command  )

◆ COMMAND_HANDLER() [3/5]

COMMAND_HANDLER ( vsllink_handle_usb_interface_command  )

◆ COMMAND_HANDLER() [4/5]

COMMAND_HANDLER ( vsllink_handle_usb_pid_command  )

◆ COMMAND_HANDLER() [5/5]

COMMAND_HANDLER ( vsllink_handle_usb_vid_command  )

◆ vsllink_check_usb_strings()

static int vsllink_check_usb_strings ( struct libusb_device_handle *  usb_device_handle,
struct libusb_device_descriptor *  usb_desc 
)
static

Definition at line 757 of file vsllink.c.

References adapter_get_required_serial(), ERROR_FAIL, and ERROR_OK.

Referenced by vsllink_usb_open().

◆ vsllink_debug_buffer()

static void vsllink_debug_buffer ( uint8_t *  buffer,
int  length 
)
static

Definition at line 849 of file vsllink.c.

Referenced by vsllink_execute_queue(), and vsllink_jtag_execute().

◆ vsllink_end_state()

static void vsllink_end_state ( tap_state_t  state)
static

◆ vsllink_execute_queue()

◆ vsllink_free_buffer()

static void vsllink_free_buffer ( void  )
static

Definition at line 236 of file vsllink.c.

References NULL, tdi_buffer, tdo_buffer, and tms_buffer.

Referenced by vsllink_init(), and vsllink_quit().

◆ vsllink_init()

◆ vsllink_interface_init()

◆ vsllink_jtag_execute()

◆ vsllink_khz()

static int vsllink_khz ( int  khz,
int *  jtag_speed 
)
static

Definition at line 222 of file vsllink.c.

References ERROR_OK.

◆ vsllink_path_move()

static void vsllink_path_move ( int  num_states,
tap_state_t path 
)
static

◆ vsllink_quit()

◆ vsllink_reset()

◆ vsllink_runtest()

static void vsllink_runtest ( int  num_cycles)
static

◆ vsllink_scan()

static void vsllink_scan ( bool  ir_scan,
enum scan_type  type,
uint8_t *  buffer,
int  scan_size,
struct scan_command command 
)
static

◆ vsllink_speed()

◆ vsllink_speed_div()

static int vsllink_speed_div ( int  jtag_speed,
int *  khz 
)
static

Definition at line 229 of file vsllink.c.

References ERROR_OK.

◆ vsllink_stableclocks()

static void vsllink_stableclocks ( int  num_cycles,
int  tms 
)
static

Definition at line 400 of file vsllink.c.

References vsllink_tap_append_step().

Referenced by vsllink_execute_queue(), and vsllink_runtest().

◆ vsllink_state_move()

static void vsllink_state_move ( void  )
static

◆ vsllink_swd_frequency()

static int_least32_t vsllink_swd_frequency ( int_least32_t  hz)
static

◆ vsllink_swd_init()

static int vsllink_swd_init ( void  )
static

Definition at line 672 of file vsllink.c.

References ERROR_OK, LOG_INFO, and swd_mode.

◆ vsllink_swd_read_reg()

static void vsllink_swd_read_reg ( uint8_t  cmd,
uint32_t *  value,
uint32_t  ap_delay_clk 
)
static

◆ vsllink_swd_run_queue()

static int vsllink_swd_run_queue ( void  )
static

◆ vsllink_swd_switch_seq()

◆ vsllink_swd_write_reg()

static void vsllink_swd_write_reg ( uint8_t  cmd,
uint32_t  value,
uint32_t  ap_delay_clk 
)
static

◆ vsllink_tap_append_scan()

◆ vsllink_tap_append_step()

static void vsllink_tap_append_step ( int  tms,
int  tdi 
)
static

◆ vsllink_tap_ensure_pending()

static void vsllink_tap_ensure_pending ( int  scans)
static

◆ vsllink_tap_execute()

static int vsllink_tap_execute ( void  )
static

◆ vsllink_tap_init()

static void vsllink_tap_init ( void  )
static

Definition at line 531 of file vsllink.c.

References pending_scan_results_length, tap_length, and vsllink_tms_offset.

Referenced by vsllink_init(), and vsllink_jtag_execute().

◆ vsllink_tms()

static void vsllink_tms ( int  num_bits,
const uint8_t *  bits 
)
static

Definition at line 394 of file vsllink.c.

References bits, and vsllink_tap_append_step().

Referenced by vsllink_execute_queue().

◆ vsllink_usb_close()

static void vsllink_usb_close ( struct vsllink vsllink)
static

◆ vsllink_usb_open()

Variable Documentation

◆ pending_scan_results_buffer

struct pending_scan_result pending_scan_results_buffer[MAX_PENDING_SCAN_RESULTS]
static

Definition at line 39 of file vsllink.c.

Referenced by vsllink_jtag_execute(), and vsllink_tap_append_scan().

◆ pending_scan_results_length

int pending_scan_results_length
static

◆ swd_mode

bool swd_mode
static

◆ tap_buffer_size

int tap_buffer_size
static

Definition at line 78 of file vsllink.c.

Referenced by vsllink_init(), vsllink_tap_append_scan(), and vsllink_tap_append_step().

◆ tap_length

int tap_length
static

◆ tdi_buffer

uint8_t* tdi_buffer
static

◆ tdo_buffer

uint8_t* tdo_buffer
static

Definition at line 81 of file vsllink.c.

Referenced by vsllink_free_buffer(), vsllink_init(), and vsllink_jtag_execute().

◆ tms_buffer

uint8_t* tms_buffer
static

◆ vsllink_adapter_driver

struct adapter_driver vsllink_adapter_driver
Initial value:
= {
.name = "vsllink",
.transports = vsllink_transports,
.init = vsllink_init,
.quit = vsllink_quit,
.reset = vsllink_reset,
.speed = vsllink_speed,
.khz = vsllink_khz,
.speed_div = vsllink_speed_div,
.jtag_ops = &vsllink_interface,
.swd_ops = &vsllink_swd_driver,
}

Definition at line 916 of file vsllink.c.

◆ vsllink_command_handlers

const struct command_registration vsllink_command_handlers[]
static
Initial value:
= {
{
.name = "vsllink",
.mode = COMMAND_ANY,
.help = "perform vsllink management",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235

Definition at line 849 of file vsllink.c.

◆ vsllink_handle

struct vsllink* vsllink_handle
static

Definition at line 85 of file vsllink.c.

Referenced by vsllink_interface_init(), and vsllink_quit().

◆ vsllink_interface

struct jtag_interface vsllink_interface
static
Initial value:
= {
.supported = DEBUG_CAP_TMS_SEQ,
.execute_queue = vsllink_execute_queue,
}
#define DEBUG_CAP_TMS_SEQ
Definition: interface.h:189

Definition at line 916 of file vsllink.c.

◆ vsllink_subcommand_handlers

const struct command_registration vsllink_subcommand_handlers[]
static

Definition at line 849 of file vsllink.c.

◆ vsllink_swd_driver

const struct swd_driver vsllink_swd_driver
static
Initial value:
= {
.switch_seq = vsllink_swd_switch_seq,
.read_reg = vsllink_swd_read_reg,
.write_reg = vsllink_swd_write_reg,
}

Definition at line 916 of file vsllink.c.

◆ vsllink_tms_offset

int vsllink_tms_offset
static

Definition at line 25 of file vsllink.c.

Referenced by vsllink_scan(), and vsllink_tap_init().

◆ vsllink_transports

const char* const vsllink_transports[] = {"jtag", "swd", NULL}
static

Definition at line 916 of file vsllink.c.