66 scan->num_fields = num_taps;
67 scan->fields = out_fields;
98 assert(field == out_fields + num_taps);
112 size_t bypass_devices = 0;
128 scan->ir_scan =
false;
129 scan->num_fields = in_num_fields + bypass_devices;
130 scan->fields = out_fields;
141 assert(active == tap);
147 for (
int j = 0; j < in_num_fields; j++) {
153 assert(field > start_field);
166 assert(field == out_fields +
scan->num_fields);
183 scan->ir_scan = ir_scan;
184 scan->num_fields = 1;
185 scan->fields = out_fields;
217 cmd->cmd.statemove->end_state =
state;
236 cmd->cmd.tms->num_bits = num_bits;
239 if (!
cmd->cmd.tms->bits)
257 cmd->cmd.pathmove->num_states = num_states;
260 for (
int i = 0; i < num_states; i++)
261 cmd->cmd.pathmove->path[i] = path[i];
276 cmd->cmd.runtest->num_cycles = num_cycles;
277 cmd->cmd.runtest->end_state =
state;
292 cmd->cmd.stableclocks->num_cycles = num_cycles;
307 cmd->cmd.reset->trst = req_trst;
308 cmd->cmd.reset->srst = req_srst;
323 cmd->cmd.sleep->us = us;
355 assert(reentry == 0);
void * buf_cpy(const void *from, void *_to, unsigned size)
Copies size bits out of from and into to.
void * buf_set_ones(void *_buf, unsigned size)
Set the contents of buf with count bits, all set to 1.
void jtag_queue_command(struct jtag_command *cmd)
void jtag_scan_field_clone(struct scan_field *dst, const struct scan_field *src)
Copy a struct scan_field for insertion into the queue.
void jtag_command_queue_reset(void)
void * cmd_queue_alloc(size_t size)
unsigned jtag_tap_count_enabled(void)
struct jtag_tap * jtag_tap_next_enabled(struct jtag_tap *p)
int default_interface_jtag_execute_queue(void)
Calls the interface callback to execute the queue.
int interface_jtag_add_clocks(int num_cycles)
int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t state)
int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state)
int interface_jtag_execute_queue(void)
int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t state)
void jtag_add_callback4(jtag_callback_t f, jtag_callback_data_t data0, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
void jtag_add_callback(jtag_callback1_t f, jtag_callback_data_t data0)
A simpler version of jtag_add_callback4().
static struct jtag_callback_entry * jtag_callback_queue_head
int interface_jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields, const struct scan_field *in_fields, tap_state_t state)
see jtag_add_dr_scan()
static void jtag_callback_queue_reset(void)
int interface_jtag_add_reset(int req_trst, int req_srst)
This drives the actual srst and trst pins.
int interface_jtag_add_ir_scan(struct jtag_tap *active, const struct scan_field *in_fields, tap_state_t state)
see jtag_add_ir_scan()
int interface_jtag_add_pathmove(int num_states, const tap_state_t *path)
static int jtag_add_plain_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t state, bool ir_scan)
static struct jtag_callback_entry * jtag_callback_queue_tail
int interface_jtag_add_sleep(uint32_t us)
int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
void interface_jtag_add_callback4(jtag_callback_t callback, jtag_callback_data_t data0, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
static int jtag_convert_to_callback4(jtag_callback_data_t data0, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
void interface_jtag_add_callback(jtag_callback1_t callback, jtag_callback_data_t data0)
int interface_jtag_add_tlr(void)
The JTAG interface can be implemented with a software or hardware fifo.
int(* jtag_callback_t)(jtag_callback_data_t data0, jtag_callback_data_t data1, jtag_callback_data_t data2, jtag_callback_data_t data3)
Defines the interface of the JTAG callback mechanism.
tap_state
Defines JTAG Test Access Port states.
enum tap_state tap_state_t
Defines JTAG Test Access Port states.
intptr_t jtag_callback_data_t
Defines the type of data passed to the jtag_callback_t interface.
void(* jtag_callback1_t)(jtag_callback_data_t data0)
Defines a simple JTAG callback that can allow conversions on data scanned in from an interface.
static struct scan_blk scan
struct jtag_callback_entry * next
jtag_callback_data_t data1
jtag_callback_data_t data0
jtag_callback_data_t data2
jtag_callback_data_t data3
The scan_command provide a means of encapsulating a set of scan_field_s structures that should be sca...
This structure defines a single scan field in the scan.
int num_bits
The number of bits this field specifies.
uint8_t * in_value
A pointer to a 32-bit memory location for data scanned out.
const uint8_t * out_value
A pointer to value to be scanned into the device.
#define DIV_ROUND_UP(m, n)
Rounds m up to the nearest multiple of n using division.