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

Go to the source code of this file.

Data Structures

struct  osbdm
 
struct  queue
 
struct  sequence
 

Macros

#define OSBDM_CMD_INIT   0x11
 
#define OSBDM_CMD_SPECIAL   0x27
 
#define OSBDM_CMD_SPECIAL_SRST   0x01
 
#define OSBDM_CMD_SPECIAL_SWAP   0x05
 
#define OSBDM_SWAP_MAX   (((OSBDM_USB_BUFSIZE - 6) / 5) * 16)
 
#define OSBDM_USB_BUFSIZE   64
 
#define OSBDM_USB_EP_READ   0x82
 
#define OSBDM_USB_EP_WRITE   0x01
 
#define OSBDM_USB_TIMEOUT   1000
 

Functions

static int osbdm_add_pathmove (struct queue *queue, tap_state_t *path, unsigned int num_states)
 
static int osbdm_add_runtest (struct queue *queue, unsigned int num_cycles, tap_state_t end_state)
 
static int osbdm_add_scan (struct queue *queue, struct scan_field *fields, unsigned int num_fields, tap_state_t end_state, bool ir_scan)
 
static int osbdm_add_stableclocks (struct queue *queue, unsigned int count)
 
static int osbdm_add_statemove (struct queue *queue, tap_state_t new_state, int skip_first)
 
static int osbdm_add_tms (struct queue *queue, const uint8_t *tms, int num_bits)
 
static int osbdm_execute_command (struct osbdm *osbdm, struct queue *queue, struct jtag_command *cmd)
 
static int osbdm_execute_queue (struct jtag_command *cmd_queue)
 
static int osbdm_flush (struct osbdm *osbdm, struct queue *queue)
 
static int osbdm_init (void)
 
static int osbdm_open (struct osbdm *osbdm)
 
static int osbdm_quit (void)
 
static int osbdm_send_and_recv (struct osbdm *osbdm)
 
static int osbdm_srst (struct osbdm *osbdm, int srst)
 
static int osbdm_swap (struct osbdm *osbdm, void *tms, void *tdi, void *tdo, int length)
 
static struct sequencequeue_add_tail (struct queue *queue, int len)
 
static struct queuequeue_alloc (void)
 
static void queue_drop_head (struct queue *queue)
 
static void queue_free (struct queue *queue)
 

Variables

struct adapter_driver osbdm_adapter_driver
 
static struct osbdm osbdm_context
 
static struct jtag_interface osbdm_interface
 
static const uint16_t osbdm_pid [] = { 0x0042, 0x0058, 0x005e, 0 }
 
static const uint16_t osbdm_vid [] = { 0x15a2, 0x15a2, 0x15a2, 0 }
 

Macro Definition Documentation

◆ OSBDM_CMD_INIT

#define OSBDM_CMD_INIT   0x11

Definition at line 107 of file osbdm.c.

◆ OSBDM_CMD_SPECIAL

#define OSBDM_CMD_SPECIAL   0x27

Definition at line 110 of file osbdm.c.

◆ OSBDM_CMD_SPECIAL_SRST

#define OSBDM_CMD_SPECIAL_SRST   0x01

Definition at line 114 of file osbdm.c.

◆ OSBDM_CMD_SPECIAL_SWAP

#define OSBDM_CMD_SPECIAL_SWAP   0x05

Definition at line 112 of file osbdm.c.

◆ OSBDM_SWAP_MAX

#define OSBDM_SWAP_MAX   (((OSBDM_USB_BUFSIZE - 6) / 5) * 16)

Definition at line 116 of file osbdm.c.

◆ OSBDM_USB_BUFSIZE

#define OSBDM_USB_BUFSIZE   64

Definition at line 98 of file osbdm.c.

◆ OSBDM_USB_EP_READ

#define OSBDM_USB_EP_READ   0x82

Definition at line 104 of file osbdm.c.

◆ OSBDM_USB_EP_WRITE

#define OSBDM_USB_EP_WRITE   0x01

Definition at line 102 of file osbdm.c.

◆ OSBDM_USB_TIMEOUT

#define OSBDM_USB_TIMEOUT   1000

Definition at line 100 of file osbdm.c.

Function Documentation

◆ osbdm_add_pathmove()

static int osbdm_add_pathmove ( struct queue queue,
tap_state_t path,
unsigned int  num_states 
)
static

◆ osbdm_add_runtest()

static int osbdm_add_runtest ( struct queue queue,
unsigned int  num_cycles,
tap_state_t  end_state 
)
static

Definition at line 537 of file osbdm.c.

References ERROR_FAIL, ERROR_OK, osbdm_add_stableclocks(), osbdm_add_statemove(), and TAP_IDLE.

Referenced by osbdm_execute_command().

◆ osbdm_add_scan()

static int osbdm_add_scan ( struct queue queue,
struct scan_field fields,
unsigned int  num_fields,
tap_state_t  end_state,
bool  ir_scan 
)
static

◆ osbdm_add_stableclocks()

static int osbdm_add_stableclocks ( struct queue queue,
unsigned int  count 
)
static

◆ osbdm_add_statemove()

◆ osbdm_add_tms()

static int osbdm_add_tms ( struct queue queue,
const uint8_t *  tms,
int  num_bits 
)
static

◆ osbdm_execute_command()

◆ osbdm_execute_queue()

static int osbdm_execute_queue ( struct jtag_command cmd_queue)
static

◆ osbdm_flush()

static int osbdm_flush ( struct osbdm osbdm,
struct queue queue 
)
static

◆ osbdm_init()

static int osbdm_init ( void  )
static

Definition at line 661 of file osbdm.c.

◆ osbdm_open()

static int osbdm_open ( struct osbdm osbdm)
static

Definition at line 363 of file osbdm.c.

References osbdm::devh, ERROR_FAIL, ERROR_OK, jtag_libusb_open(), NULL, osbdm_pid, and osbdm_vid.

◆ osbdm_quit()

static int osbdm_quit ( void  )
static

Definition at line 375 of file osbdm.c.

References osbdm::devh, ERROR_OK, jtag_libusb_close(), and osbdm_context.

◆ osbdm_send_and_recv()

static int osbdm_send_and_recv ( struct osbdm osbdm)
static

◆ osbdm_srst()

static int osbdm_srst ( struct osbdm osbdm,
int  srst 
)
static

◆ osbdm_swap()

static int osbdm_swap ( struct osbdm osbdm,
void *  tms,
void *  tdi,
void *  tdo,
int  length 
)
static

◆ queue_add_tail()

static struct sequence* queue_add_tail ( struct queue queue,
int  len 
)
static

◆ queue_alloc()

static struct queue* queue_alloc ( void  )
static

Definition at line 86 of file osbdm.c.

References queue::head, LOG_ERROR, and NULL.

Referenced by osbdm_execute_queue().

◆ queue_drop_head()

static void queue_drop_head ( struct queue queue)
static

Definition at line 68 of file osbdm.c.

References queue::head, sequence::next, and sequence::tms.

Referenced by osbdm_flush(), and queue_free().

◆ queue_free()

static void queue_free ( struct queue queue)
static

Definition at line 76 of file osbdm.c.

References queue::head, and queue_drop_head().

Referenced by osbdm_execute_queue().

Variable Documentation

◆ osbdm_adapter_driver

struct adapter_driver osbdm_adapter_driver
Initial value:
= {
.name = "osbdm",
.transports = jtag_only,
.init = osbdm_init,
.quit = osbdm_quit,
.jtag_ops = &osbdm_interface,
}
const char *const jtag_only[]
Definition: adapter.c:27
static int osbdm_init(void)
Definition: osbdm.c:661
static int osbdm_quit(void)
Definition: osbdm.c:375
static struct jtag_interface osbdm_interface
Definition: osbdm.c:681

Definition at line 661 of file osbdm.c.

◆ osbdm_context

struct osbdm osbdm_context
static

Definition at line 121 of file osbdm.c.

Referenced by osbdm_execute_queue(), and osbdm_quit().

◆ osbdm_interface

struct jtag_interface osbdm_interface
static
Initial value:
= {
.execute_queue = osbdm_execute_queue,
}
static int osbdm_execute_queue(struct jtag_command *cmd_queue)
Definition: osbdm.c:631

Definition at line 661 of file osbdm.c.

◆ osbdm_pid

const uint16_t osbdm_pid[] = { 0x0042, 0x0058, 0x005e, 0 }
static

Definition at line 121 of file osbdm.c.

Referenced by osbdm_open().

◆ osbdm_vid

const uint16_t osbdm_vid[] = { 0x15a2, 0x15a2, 0x15a2, 0 }
static

Definition at line 120 of file osbdm.c.

Referenced by osbdm_open().