66 scan->num_fields = num_taps;
67 scan->fields = out_fields;
88 if (tap->ir_bypass_value) {
90 buf_set_u64(v, 0, tap->ir_length, tap->ir_bypass_value);
104 assert(field == out_fields + num_taps);
118 size_t bypass_devices = 0;
119 size_t all_devices = 0;
128 if (all_devices == bypass_devices) {
129 LOG_ERROR(
"At least one TAP shouldn't be in BYPASS mode");
143 scan->ir_scan =
false;
144 scan->num_fields = in_num_fields + bypass_devices;
145 scan->fields = out_fields;
156 assert(active == tap);
162 for (
int j = 0; j < in_num_fields; j++) {
168 assert(field > start_field);
181 assert(field == out_fields +
scan->num_fields);
198 scan->ir_scan = ir_scan;
199 scan->num_fields = 1;
200 scan->fields = out_fields;
232 cmd->cmd.statemove->end_state =
state;
251 cmd->cmd.tms->num_bits = num_bits;
254 if (!
cmd->cmd.tms->bits)
272 cmd->cmd.pathmove->num_states = num_states;
275 for (
unsigned int i = 0; i < num_states; i++)
276 cmd->cmd.pathmove->path[i] = path[i];
291 cmd->cmd.runtest->num_cycles = num_cycles;
292 cmd->cmd.runtest->end_state =
state;
307 cmd->cmd.stableclocks->num_cycles = num_cycles;
322 cmd->cmd.reset->trst = req_trst;
323 cmd->cmd.reset->srst = req_srst;
338 cmd->cmd.sleep->us = us;
370 assert(reentry == 0);
void * buf_set_ones(void *_buf, unsigned int size)
Set the contents of buf with count bits, all set to 1.
void * buf_cpy(const void *from, void *_to, unsigned int size)
Copies size bits out of from and into to.
static void buf_set_u64(uint8_t *_buffer, unsigned int first, unsigned int num, uint64_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
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 int 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_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t 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)
int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path)
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_add_tms_seq(unsigned int num_bits, const uint8_t *seq, enum tap_state state)
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()
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_clocks(unsigned int num_cycles)
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)
int interface_jtag_add_runtest(unsigned int num_cycles, tap_state_t state)
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
#define LOG_ERROR(expr ...)
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 structures that should be scann...
This structure defines a single scan field in the scan.
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.
unsigned int num_bits
The number of bits this field specifies.
#define DIV_ROUND_UP(m, n)
Rounds m up to the nearest multiple of n using division.