OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | openjtag_scan_result |
Macros | |
#define | CY7C65215_JTAG_CLASS 0xff |
#define | CY7C65215_JTAG_DISABLE 0xD1 /* bRequest: disable JTAG */ |
#define | CY7C65215_JTAG_ENABLE 0xD0 /* bRequest: enable JTAG */ |
#define | CY7C65215_JTAG_READ 0xD2 /* bRequest: read buffer */ |
#define | CY7C65215_JTAG_REQUEST 0x40 /* bmRequestType: vendor host-to-device */ |
#define | CY7C65215_JTAG_SUBCLASS 0x04 |
#define | CY7C65215_JTAG_WRITE 0xD3 /* bRequest: write buffer */ |
#define | CY7C65215_USB_TIMEOUT 100 |
#define | OPENJTAG_BUFFER_SIZE 504 |
#define | OPENJTAG_MAX_PENDING_RESULTS 256 |
Typedefs | |
typedef enum openjtag_tap_state | openjtag_tap_state_t |
Enumerations | |
enum | { OPENJTAG_VARIANT_STANDARD , OPENJTAG_VARIANT_CY7C65215 } |
enum | openjtag_tap_state { OPENJTAG_TAP_INVALID = -1 , OPENJTAG_TAP_RESET = 0 , OPENJTAG_TAP_IDLE = 1 , OPENJTAG_TAP_SELECT_DR = 2 , OPENJTAG_TAP_CAPTURE_DR = 3 , OPENJTAG_TAP_SHIFT_DR = 4 , OPENJTAG_TAP_EXIT1_DR = 5 , OPENJTAG_TAP_PAUSE_DR = 6 , OPENJTAG_TAP_EXIT2_DR = 7 , OPENJTAG_TAP_UPDATE_DR = 8 , OPENJTAG_TAP_SELECT_IR = 9 , OPENJTAG_TAP_CAPURE_IR = 10 , OPENJTAG_TAP_SHIFT_IR = 11 , OPENJTAG_TAP_EXIT1_IR = 12 , OPENJTAG_TAP_PAUSE_IR = 13 , OPENJTAG_TAP_EXIT2_IR = 14 , OPENJTAG_TAP_UPDATE_IR = 15 } |
Functions | |
COMMAND_HANDLER (openjtag_handle_device_desc_command) | |
COMMAND_HANDLER (openjtag_handle_variant_command) | |
COMMAND_HANDLER (openjtag_handle_vid_pid_command) | |
static void | openjtag_add_byte (char buf) |
static void | openjtag_add_scan (uint8_t *buffer, int length, struct scan_command *scan_cmd) |
static int | openjtag_buf_read (uint8_t *buf, uint32_t qty, uint32_t *bytes_read) |
static int | openjtag_buf_read_cy7c65215 (uint8_t *buf, uint32_t qty, uint32_t *bytes_read) |
static int | openjtag_buf_read_standard (uint8_t *buf, uint32_t qty, uint32_t *bytes_read) |
static int | openjtag_buf_write (uint8_t *buf, int size, uint32_t *bytes_written) |
static int | openjtag_buf_write_cy7c65215 (uint8_t *buf, int size, uint32_t *bytes_written) |
static int | openjtag_buf_write_standard (uint8_t *buf, int size, uint32_t *bytes_written) |
static void | openjtag_execute_command (struct jtag_command *cmd) |
static int | openjtag_execute_queue (struct jtag_command *cmd_queue) |
static void | openjtag_execute_reset (struct jtag_command *cmd) |
static void | openjtag_execute_runtest (struct jtag_command *cmd) |
static void | openjtag_execute_scan (struct jtag_command *cmd) |
static void | openjtag_execute_sleep (struct jtag_command *cmd) |
static void | openjtag_execute_statemove (struct jtag_command *cmd) |
static int | openjtag_execute_tap_queue (void) |
static int8_t | openjtag_get_tap_state (int8_t state) |
static int | openjtag_init (void) |
static int | openjtag_init_cy7c65215 (void) |
static int | openjtag_init_standard (void) |
static int | openjtag_khz (int khz, int *jtag_speed) |
static int | openjtag_quit (void) |
static int | openjtag_quit_cy7c65215 (void) |
static int | openjtag_quit_standard (void) |
static int | openjtag_sendcommand (uint8_t cmd) |
static void | openjtag_set_state (uint8_t openocd_state) |
static int | openjtag_speed (int speed) |
static int | openjtag_speed_div (int speed, int *khz) |
static void | openjtag_write_tap_buffer (void) |
Variables | |
static const uint16_t | cy7c65215_pids [] = {0x0007, 0} |
static const uint16_t | cy7c65215_vids [] = {0x04b4, 0} |
static unsigned int | ep_in |
static unsigned int | ep_out |
static struct ftdi_context | ftdic |
struct adapter_driver | openjtag_adapter_driver |
static const struct command_registration | openjtag_command_handlers [] |
static char * | openjtag_device_desc |
static struct jtag_interface | openjtag_interface |
static uint16_t | openjtag_pid = 0x6001 |
static struct openjtag_scan_result | openjtag_scan_result_buffer [OPENJTAG_MAX_PENDING_RESULTS] |
static int | openjtag_scan_result_count |
static const struct command_registration | openjtag_subcommand_handlers [] |
static enum { ... } | openjtag_variant = OPENJTAG_VARIANT_STANDARD |
static const char *const | openjtag_variant_names [] |
static uint16_t | openjtag_vid = 0x0403 |
static uint8_t | usb_rx_buf [OPENJTAG_BUFFER_SIZE] |
static uint32_t | usb_rx_buf_len |
static uint8_t | usb_tx_buf [OPENJTAG_BUFFER_SIZE] |
static int | usb_tx_buf_offs |
static struct libusb_device_handle * | usbh |
#define CY7C65215_JTAG_CLASS 0xff |
Definition at line 117 of file openjtag.c.
#define CY7C65215_JTAG_DISABLE 0xD1 /* bRequest: disable JTAG */ |
Definition at line 108 of file openjtag.c.
#define CY7C65215_JTAG_ENABLE 0xD0 /* bRequest: enable JTAG */ |
Definition at line 107 of file openjtag.c.
#define CY7C65215_JTAG_READ 0xD2 /* bRequest: read buffer */ |
Definition at line 109 of file openjtag.c.
#define CY7C65215_JTAG_REQUEST 0x40 /* bmRequestType: vendor host-to-device */ |
Definition at line 106 of file openjtag.c.
#define CY7C65215_JTAG_SUBCLASS 0x04 |
Definition at line 118 of file openjtag.c.
#define CY7C65215_JTAG_WRITE 0xD3 /* bRequest: write buffer */ |
Definition at line 110 of file openjtag.c.
#define CY7C65215_USB_TIMEOUT 100 |
Definition at line 112 of file openjtag.c.
#define OPENJTAG_BUFFER_SIZE 504 |
Definition at line 84 of file openjtag.c.
#define OPENJTAG_MAX_PENDING_RESULTS 256 |
Definition at line 85 of file openjtag.c.
typedef enum openjtag_tap_state openjtag_tap_state_t |
anonymous enum |
Enumerator | |
---|---|
OPENJTAG_VARIANT_STANDARD | |
OPENJTAG_VARIANT_CY7C65215 |
Definition at line 39 of file openjtag.c.
enum openjtag_tap_state |
Definition at line 53 of file openjtag.c.
COMMAND_HANDLER | ( | openjtag_handle_device_desc_command | ) |
Definition at line 852 of file openjtag.c.
References CMD_ARGC, CMD_ARGV, ERROR_OK, LOG_ERROR, and openjtag_device_desc.
COMMAND_HANDLER | ( | openjtag_handle_variant_command | ) |
Definition at line 862 of file openjtag.c.
References CMD_ARGC, CMD_ARGV, ERROR_OK, LOG_ERROR, name, openjtag_variant, and openjtag_variant_names.
COMMAND_HANDLER | ( | openjtag_handle_vid_pid_command | ) |
Definition at line 881 of file openjtag.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, openjtag_pid, and openjtag_vid.
|
static |
Definition at line 605 of file openjtag.c.
References LOG_DEBUG_IO, OPENJTAG_BUFFER_SIZE, openjtag_execute_tap_queue(), usb_tx_buf, and usb_tx_buf_offs.
Referenced by openjtag_add_scan(), openjtag_execute_reset(), openjtag_execute_runtest(), and openjtag_set_state().
|
static |
Definition at line 618 of file openjtag.c.
References bits, openjtag_scan_result::bits, openjtag_scan_result::buffer, buffer, openjtag_scan_result::command, count, DIV_ROUND_UP, length, LOG_DEBUG_IO, openjtag_add_byte(), OPENJTAG_BUFFER_SIZE, openjtag_execute_tap_queue(), openjtag_scan_result_buffer, openjtag_scan_result_count, and usb_tx_buf_offs.
Referenced by openjtag_execute_scan().
|
static |
Definition at line 330 of file openjtag.c.
References openjtag_buf_read_cy7c65215(), openjtag_buf_read_standard(), openjtag_variant, and OPENJTAG_VARIANT_CY7C65215.
Referenced by openjtag_write_tap_buffer().
|
static |
Definition at line 297 of file openjtag.c.
References CY7C65215_JTAG_READ, CY7C65215_JTAG_REQUEST, CY7C65215_USB_TIMEOUT, ep_in, ERROR_JTAG_DEVICE_ERROR, ERROR_OK, jtag_libusb_bulk_read(), jtag_libusb_control_transfer(), LOG_ERROR, NULL, and usbh.
Referenced by openjtag_buf_read().
|
static |
Definition at line 269 of file openjtag.c.
References ERROR_JTAG_DEVICE_ERROR, ERROR_OK, ftdic, and LOG_DEBUG_IO.
Referenced by openjtag_buf_read().
|
static |
Definition at line 258 of file openjtag.c.
References openjtag_buf_write_cy7c65215(), openjtag_buf_write_standard(), openjtag_variant, OPENJTAG_VARIANT_CY7C65215, and size.
Referenced by openjtag_sendcommand(), and openjtag_write_tap_buffer().
|
static |
Definition at line 226 of file openjtag.c.
References CY7C65215_JTAG_REQUEST, CY7C65215_JTAG_WRITE, CY7C65215_USB_TIMEOUT, ep_out, ERROR_JTAG_DEVICE_ERROR, ERROR_OK, jtag_libusb_bulk_write(), jtag_libusb_control_transfer(), LOG_ERROR, NULL, size, and usbh.
Referenced by openjtag_buf_write().
|
static |
Definition at line 206 of file openjtag.c.
References ERROR_JTAG_DEVICE_ERROR, ERROR_OK, ftdic, LOG_ERROR, and size.
Referenced by openjtag_buf_write().
|
static |
Definition at line 783 of file openjtag.c.
References cmd, JTAG_PATHMOVE, JTAG_RESET, JTAG_RUNTEST, JTAG_SCAN, JTAG_SLEEP, JTAG_TLR_RESET, LOG_DEBUG_IO, LOG_ERROR, openjtag_execute_reset(), openjtag_execute_runtest(), openjtag_execute_scan(), openjtag_execute_sleep(), and openjtag_execute_statemove().
Referenced by openjtag_execute_queue().
|
static |
Definition at line 810 of file openjtag.c.
References cmd, openjtag_execute_command(), and openjtag_execute_tap_queue().
|
static |
Definition at line 666 of file openjtag.c.
References cmd, LOG_DEBUG_IO, and openjtag_add_byte().
Referenced by openjtag_execute_command().
|
static |
Definition at line 748 of file openjtag.c.
References cmd, MIN, openjtag_add_byte(), openjtag_set_state(), openjtag_variant, OPENJTAG_VARIANT_CY7C65215, tap_get_end_state(), tap_get_state(), TAP_IDLE, tap_set_end_state(), and tap_set_state.
Referenced by openjtag_execute_command().
|
static |
Definition at line 716 of file openjtag.c.
References buffer, cmd, jtag_build_buffer(), LOG_DEBUG_IO, openjtag_add_scan(), openjtag_set_state(), TAP_DRPAUSE, TAP_DRSHIFT, tap_get_end_state(), tap_get_state(), TAP_IRPAUSE, TAP_IRSHIFT, tap_set_end_state(), tap_set_state, and tap_state_name().
Referenced by openjtag_execute_command().
|
static |
Definition at line 682 of file openjtag.c.
References cmd, and jtag_sleep().
Referenced by openjtag_execute_command().
|
static |
Definition at line 704 of file openjtag.c.
References cmd, LOG_DEBUG_IO, openjtag_set_state(), tap_get_end_state(), tap_set_end_state(), and tap_set_state.
Referenced by openjtag_execute_command().
|
static |
Definition at line 551 of file openjtag.c.
References bits, openjtag_scan_result::bits, openjtag_scan_result::buffer, buffer, count, DIV_ROUND_UP, ERROR_OK, jtag_read_buffer(), LOG_DEBUG_IO, openjtag_scan_result_buffer, openjtag_scan_result_count, openjtag_variant, OPENJTAG_VARIANT_CY7C65215, openjtag_write_tap_buffer(), usb_rx_buf, and usb_rx_buf_len.
Referenced by openjtag_add_byte(), openjtag_add_scan(), and openjtag_execute_queue().
|
static |
Definition at line 181 of file openjtag.c.
References OPENJTAG_TAP_CAPTURE_DR, OPENJTAG_TAP_CAPURE_IR, OPENJTAG_TAP_EXIT1_DR, OPENJTAG_TAP_EXIT1_IR, OPENJTAG_TAP_EXIT2_DR, OPENJTAG_TAP_EXIT2_IR, OPENJTAG_TAP_IDLE, OPENJTAG_TAP_INVALID, OPENJTAG_TAP_PAUSE_DR, OPENJTAG_TAP_PAUSE_IR, OPENJTAG_TAP_RESET, OPENJTAG_TAP_SELECT_DR, OPENJTAG_TAP_SELECT_IR, OPENJTAG_TAP_SHIFT_DR, OPENJTAG_TAP_SHIFT_IR, OPENJTAG_TAP_UPDATE_DR, OPENJTAG_TAP_UPDATE_IR, state, TAP_DRCAPTURE, TAP_DREXIT1, TAP_DREXIT2, TAP_DRPAUSE, TAP_DRSELECT, TAP_DRSHIFT, TAP_DRUPDATE, TAP_IDLE, TAP_INVALID, TAP_IRCAPTURE, TAP_IREXIT1, TAP_IREXIT2, TAP_IRPAUSE, TAP_IRSELECT, TAP_IRSHIFT, TAP_IRUPDATE, and TAP_RESET.
Referenced by openjtag_set_state().
|
static |
Definition at line 472 of file openjtag.c.
References ERROR_OK, openjtag_init_cy7c65215(), openjtag_init_standard(), openjtag_scan_result_count, openjtag_sendcommand(), openjtag_speed(), openjtag_variant, OPENJTAG_VARIANT_CY7C65215, usb_rx_buf_len, and usb_tx_buf_offs.
|
static |
Definition at line 436 of file openjtag.c.
References CY7C65215_JTAG_CLASS, CY7C65215_JTAG_ENABLE, CY7C65215_JTAG_REQUEST, CY7C65215_JTAG_SUBCLASS, cy7c65215_pids, CY7C65215_USB_TIMEOUT, cy7c65215_vids, ep_in, ep_out, ERROR_OK, jtag_libusb_choose_interface(), jtag_libusb_close(), jtag_libusb_control_transfer(), jtag_libusb_open(), LOG_ERROR, NULL, and usbh.
Referenced by openjtag_init().
|
static |
Definition at line 384 of file openjtag.c.
References ERROR_JTAG_DEVICE_ERROR, ERROR_JTAG_INIT_FAILED, ERROR_OK, ftdi_tcioflush(), ftdic, LOG_DEBUG, LOG_ERROR, LOG_WARNING, NULL, openjtag_device_desc, openjtag_pid, and openjtag_vid.
Referenced by openjtag_init().
|
static |
Definition at line 829 of file openjtag.c.
References ERROR_OK.
|
static |
Definition at line 520 of file openjtag.c.
References openjtag_quit_cy7c65215(), openjtag_quit_standard(), openjtag_variant, and OPENJTAG_VARIANT_CY7C65215.
|
static |
Definition at line 504 of file openjtag.c.
References CY7C65215_JTAG_DISABLE, CY7C65215_JTAG_REQUEST, CY7C65215_USB_TIMEOUT, ERROR_OK, jtag_libusb_close(), jtag_libusb_control_transfer(), LOG_WARNING, NULL, and usbh.
Referenced by openjtag_quit().
|
static |
Definition at line 496 of file openjtag.c.
References ERROR_OK, and ftdic.
Referenced by openjtag_quit().
|
static |
Definition at line 340 of file openjtag.c.
References cmd, and openjtag_buf_write().
Referenced by openjtag_init(), and openjtag_speed().
|
static |
Definition at line 687 of file openjtag.c.
References openjtag_add_byte(), openjtag_get_tap_state(), OPENJTAG_TAP_RESET, and state.
Referenced by openjtag_execute_runtest(), openjtag_execute_scan(), and openjtag_execute_statemove().
|
static |
Definition at line 346 of file openjtag.c.
References ERROR_OK, LOG_WARNING, and openjtag_sendcommand().
Referenced by openjtag_init().
|
static |
Definition at line 822 of file openjtag.c.
References ERROR_OK.
|
static |
Definition at line 530 of file openjtag.c.
References openjtag_buf_read(), openjtag_buf_write(), usb_rx_buf, usb_rx_buf_len, usb_tx_buf, and usb_tx_buf_offs.
Referenced by openjtag_execute_tap_queue().
|
static |
Definition at line 115 of file openjtag.c.
Referenced by openjtag_init_cy7c65215().
|
static |
Definition at line 114 of file openjtag.c.
Referenced by openjtag_init_cy7c65215().
|
static |
Definition at line 120 of file openjtag.c.
Referenced by cmsis_dap_usb_open(), openjtag_buf_read_cy7c65215(), and openjtag_init_cy7c65215().
|
static |
Definition at line 120 of file openjtag.c.
Referenced by cmsis_dap_usb_open(), openjtag_buf_write_cy7c65215(), and openjtag_init_cy7c65215().
|
static |
Definition at line 80 of file openjtag.c.
Referenced by openjtag_buf_read_standard(), openjtag_buf_write_standard(), openjtag_init_standard(), openjtag_quit_standard(), ublast_ftdi_init(), ublast_ftdi_read(), and ublast_ftdi_write().
struct adapter_driver openjtag_adapter_driver |
Definition at line 881 of file openjtag.c.
|
static |
Definition at line 881 of file openjtag.c.
|
static |
Definition at line 80 of file openjtag.c.
Referenced by COMMAND_HANDLER(), and openjtag_init_standard().
|
static |
Definition at line 881 of file openjtag.c.
|
static |
Definition at line 78 of file openjtag.c.
Referenced by COMMAND_HANDLER(), and openjtag_init_standard().
|
static |
Definition at line 97 of file openjtag.c.
Referenced by openjtag_add_scan(), and openjtag_execute_tap_queue().
|
static |
Definition at line 101 of file openjtag.c.
Referenced by openjtag_add_scan(), openjtag_execute_tap_queue(), and openjtag_init().
|
static |
Definition at line 881 of file openjtag.c.
enum { ... } openjtag_variant |
|
static |
Definition at line 44 of file openjtag.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 77 of file openjtag.c.
Referenced by COMMAND_HANDLER(), and openjtag_init_standard().
|
static |
Definition at line 97 of file openjtag.c.
Referenced by openjtag_execute_tap_queue(), and openjtag_write_tap_buffer().
|
static |
Definition at line 96 of file openjtag.c.
Referenced by openjtag_execute_tap_queue(), openjtag_init(), and openjtag_write_tap_buffer().
|
static |
Definition at line 95 of file openjtag.c.
Referenced by openjtag_add_byte(), and openjtag_write_tap_buffer().
|
static |
Definition at line 94 of file openjtag.c.
Referenced by openjtag_add_byte(), openjtag_add_scan(), openjtag_init(), and openjtag_write_tap_buffer().
|
static |
Definition at line 103 of file openjtag.c.
Referenced by openjtag_buf_read_cy7c65215(), openjtag_buf_write_cy7c65215(), openjtag_init_cy7c65215(), and openjtag_quit_cy7c65215().