diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/flash/str9xpec.c | 30 | ||||
-rw-r--r-- | src/jtag/bitq.c | 10 | ||||
-rw-r--r-- | src/jtag/jtag.c | 88 | ||||
-rw-r--r-- | src/jtag/jtag.h | 6 | ||||
-rw-r--r-- | src/jtag/zy1000.c | 42 | ||||
-rw-r--r-- | src/pld/virtex2.c | 6 | ||||
-rw-r--r-- | src/svf/svf.c | 4 | ||||
-rw-r--r-- | src/target/arm11_dbgtap.c | 5 | ||||
-rw-r--r-- | src/target/arm720t.c | 4 | ||||
-rw-r--r-- | src/target/arm7tdmi.c | 12 | ||||
-rw-r--r-- | src/target/arm920t.c | 24 | ||||
-rw-r--r-- | src/target/arm926ejs.c | 21 | ||||
-rw-r--r-- | src/target/arm966e.c | 12 | ||||
-rw-r--r-- | src/target/arm9tdmi.c | 24 | ||||
-rw-r--r-- | src/target/arm_adi_v5.c | 8 | ||||
-rw-r--r-- | src/target/arm_jtag.c | 2 | ||||
-rw-r--r-- | src/target/avrt.c | 54 | ||||
-rw-r--r-- | src/target/embeddedice.c | 24 | ||||
-rw-r--r-- | src/target/etb.c | 22 | ||||
-rw-r--r-- | src/target/etm.c | 12 | ||||
-rw-r--r-- | src/target/feroceon.c | 6 | ||||
-rw-r--r-- | src/target/mips_ejtag.c | 8 | ||||
-rw-r--r-- | src/target/xscale.c | 18 | ||||
-rw-r--r-- | src/xsvf/xsvf.c | 2 |
24 files changed, 155 insertions, 289 deletions
diff --git a/src/flash/str9xpec.c b/src/flash/str9xpec.c index c5e50bd8..f6ffa6e4 100644 --- a/src/flash/str9xpec.c +++ b/src/flash/str9xpec.c @@ -129,7 +129,7 @@ int str9xpec_set_instr(jtag_tap_t *tap, u32 new_instr, tap_state_t end_state) field.in_value = NULL; - field.in_handler = NULL; + jtag_add_ir_scan(1, &field, end_state); @@ -155,7 +155,7 @@ static u8 str9xpec_isc_status(jtag_tap_t *tap) field.in_value = &status; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IDLE); @@ -247,7 +247,7 @@ static int str9xpec_read_config(struct flash_bank_s *bank) field.in_value = str9xpec_info->options; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IDLE); @@ -399,7 +399,7 @@ static int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last) field.in_value = NULL; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IDLE); @@ -413,7 +413,7 @@ static int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last) field.in_value = buffer; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IRPAUSE); @@ -515,7 +515,7 @@ static int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last) field.in_value = NULL; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IDLE); @@ -581,7 +581,7 @@ static int str9xpec_lock_device(struct flash_bank_s *bank) field.in_value = &status; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, -1); @@ -667,7 +667,7 @@ static int str9xpec_set_address(struct flash_bank_s *bank, u8 sector) field.in_value = NULL; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, -1); @@ -756,7 +756,7 @@ static int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 field.in_value = NULL; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IDLE); @@ -774,7 +774,7 @@ static int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 field.in_value = scanbuf; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, -1); @@ -816,7 +816,7 @@ static int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 field.in_value = NULL; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IDLE); @@ -834,7 +834,7 @@ static int str9xpec_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 field.in_value = scanbuf; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, -1); @@ -898,7 +898,7 @@ static int str9xpec_handle_part_id_command(struct command_context_s *cmd_ctx, ch field.in_value = buffer; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IDLE); @@ -1023,7 +1023,7 @@ static int str9xpec_write_options(struct flash_bank_s *bank) field.in_value = NULL; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_IDLE); @@ -1041,7 +1041,7 @@ static int str9xpec_write_options(struct flash_bank_s *bank) field.in_value = &status; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, -1); diff --git a/src/jtag/bitq.c b/src/jtag/bitq.c index 6d47c48b..cbba5511 100644 --- a/src/jtag/bitq.c +++ b/src/jtag/bitq.c @@ -66,7 +66,7 @@ void bitq_in_proc(void) while (bitq_in_state.field_idx<bitq_in_state.cmd->cmd.scan->num_fields) { field = &bitq_in_state.cmd->cmd.scan->fields[bitq_in_state.field_idx]; - if (field->in_value || field->in_handler) + if (field->in_value) { if (bitq_in_state.bit_pos==0) { @@ -124,12 +124,6 @@ void bitq_in_proc(void) in_mask <<= 1; bitq_in_state.bit_pos++; } - - - if (field->in_handler && bitq_in_state.status==ERROR_OK) - { - bitq_in_state.status = (*field->in_handler)(in_buff, field->in_handler_priv, field); - } } bitq_in_state.field_idx++; /* advance to next field */ @@ -238,7 +232,7 @@ void bitq_scan_field(scan_field_t* field, int pause) u8* out_ptr; u8 out_mask; - if (field->in_value || field->in_handler) + if (field->in_value) tdo_req = 1; else tdo_req = 0; diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 28b648bf..2fd4c2c1 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -623,7 +623,6 @@ int MINIDRIVER(interface_jtag_add_ir_scan)(int num_fields, scan_field_t *fields, (*last_cmd)->cmd.scan->fields[nth_tap].tap = tap; (*last_cmd)->cmd.scan->fields[nth_tap].num_bits = scan_size; (*last_cmd)->cmd.scan->fields[nth_tap].in_value = NULL; - (*last_cmd)->cmd.scan->fields[nth_tap].in_handler = NULL; /* disable verification by default */ /* search the list */ for (j = 0; j < num_fields; j++) @@ -690,10 +689,6 @@ int MINIDRIVER(interface_jtag_add_plain_ir_scan)(int num_fields, scan_field_t *f (*last_cmd)->cmd.scan->fields[i].num_bits = num_bits; (*last_cmd)->cmd.scan->fields[i].out_value = buf_cpy(fields[i].out_value, cmd_queue_alloc(num_bytes), num_bits); (*last_cmd)->cmd.scan->fields[i].in_value = fields[i].in_value; - (*last_cmd)->cmd.scan->fields[i].in_check_value = fields[i].in_check_value; - (*last_cmd)->cmd.scan->fields[i].in_check_mask = fields[i].in_check_mask; - (*last_cmd)->cmd.scan->fields[i].in_handler = NULL; - (*last_cmd)->cmd.scan->fields[i].in_handler_priv = NULL; } return ERROR_OK; } @@ -772,10 +767,7 @@ int MINIDRIVER(interface_jtag_add_dr_scan)(int num_fields, scan_field_t *fields, (*last_cmd)->cmd.scan->fields[field_count].num_bits = scan_size; (*last_cmd)->cmd.scan->fields[field_count].out_value = buf_cpy(fields[j].out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size); (*last_cmd)->cmd.scan->fields[field_count].in_value = fields[j].in_value; - (*last_cmd)->cmd.scan->fields[field_count].in_check_value = fields[j].in_check_value; - (*last_cmd)->cmd.scan->fields[field_count].in_check_mask = fields[j].in_check_mask; - (*last_cmd)->cmd.scan->fields[field_count].in_handler = fields[j].in_handler; - (*last_cmd)->cmd.scan->fields[field_count++].in_handler_priv = fields[j].in_handler_priv; + field_count++; } } if (!found) @@ -792,10 +784,7 @@ int MINIDRIVER(interface_jtag_add_dr_scan)(int num_fields, scan_field_t *fields, (*last_cmd)->cmd.scan->fields[field_count].num_bits = 1; (*last_cmd)->cmd.scan->fields[field_count].out_value = NULL; (*last_cmd)->cmd.scan->fields[field_count].in_value = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_check_value = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_check_mask = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_handler = NULL; - (*last_cmd)->cmd.scan->fields[field_count++].in_handler_priv = NULL; + field_count++; } else { @@ -881,10 +870,7 @@ void MINIDRIVER(interface_jtag_add_dr_out)(jtag_tap_t *target_tap, (*last_cmd)->cmd.scan->fields[field_count].num_bits = scan_size; (*last_cmd)->cmd.scan->fields[field_count].out_value = buf_cpy(out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size); (*last_cmd)->cmd.scan->fields[field_count].in_value = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_check_value = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_check_mask = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_handler = NULL; - (*last_cmd)->cmd.scan->fields[field_count++].in_handler_priv = NULL; + field_count++; } } else { @@ -900,10 +886,7 @@ void MINIDRIVER(interface_jtag_add_dr_out)(jtag_tap_t *target_tap, (*last_cmd)->cmd.scan->fields[field_count].num_bits = 1; (*last_cmd)->cmd.scan->fields[field_count].out_value = NULL; (*last_cmd)->cmd.scan->fields[field_count].in_value = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_check_value = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_check_mask = NULL; - (*last_cmd)->cmd.scan->fields[field_count].in_handler = NULL; - (*last_cmd)->cmd.scan->fields[field_count++].in_handler_priv = NULL; + field_count++; } } } @@ -945,10 +928,6 @@ int MINIDRIVER(interface_jtag_add_plain_dr_scan)(int num_fields, scan_field_t *f (*last_cmd)->cmd.scan->fields[i].num_bits = num_bits; (*last_cmd)->cmd.scan->fields[i].out_value = buf_cpy(fields[i].out_value, cmd_queue_alloc(num_bytes), num_bits); (*last_cmd)->cmd.scan->fields[i].in_value = fields[i].in_value; - (*last_cmd)->cmd.scan->fields[i].in_check_value = fields[i].in_check_value; - (*last_cmd)->cmd.scan->fields[i].in_check_mask = fields[i].in_check_mask; - (*last_cmd)->cmd.scan->fields[i].in_handler = fields[i].in_handler; - (*last_cmd)->cmd.scan->fields[i].in_handler_priv = fields[i].in_handler_priv; } return ERROR_OK; @@ -1333,7 +1312,7 @@ int jtag_read_buffer(u8 *buffer, scan_command_t *cmd) /* if neither in_value nor in_handler * are specified we don't have to examine this field */ - if (cmd->fields[i].in_value || cmd->fields[i].in_handler) + if (cmd->fields[i].in_value) { int num_bits = cmd->fields[i].num_bits; u8 *captured = buf_set_buf(buffer, bit_count, malloc(CEIL(num_bits, 8)), 0, num_bits); @@ -1347,28 +1326,6 @@ int jtag_read_buffer(u8 *buffer, scan_command_t *cmd) if (cmd->fields[i].in_value) { buf_cpy(captured, cmd->fields[i].in_value, num_bits); - - if (cmd->fields[i].in_handler) - { - if (cmd->fields[i].in_handler(cmd->fields[i].in_value, cmd->fields[i].in_handler_priv, cmd->fields+i) != ERROR_OK) - { - LOG_WARNING("in_handler: with \"in_value\", mismatch in %s", cmd->ir_scan ? "SIR" : "SDR" ); - retval = ERROR_JTAG_QUEUE_FAILED; - } - } - } - - /* no in_value specified, but a handler takes care of the scanned data */ - if (cmd->fields[i].in_handler && (!cmd->fields[i].in_value)) - { - if (cmd->fields[i].in_handler(captured, cmd->fields[i].in_handler_priv, cmd->fields+i) != ERROR_OK) - { - /* We're going to call the error:handler later, but if the in_handler - * reported an error we report this failure upstream - */ - LOG_WARNING("in_handler: w/o \"in_value\", mismatch in %s", cmd->ir_scan ? "SIR" : "SDR" ); - retval = ERROR_JTAG_QUEUE_FAILED; - } } free(captured); @@ -1432,26 +1389,6 @@ int jtag_check_value_inner(u8 *captured, scan_field_t *field, u8 *in_check_value return retval; } -int jtag_check_value(u8 *captured, void *priv, scan_field_t *field) -{ - return jtag_check_value_inner(captured, field, field->in_check_value, field->in_check_mask); -} - -/* - set up checking of this field using the in_handler. The values passed in must be valid until - after jtag_execute() has completed. - */ -void jtag_set_check_value(scan_field_t *field, u8 *value, u8 *mask, struct invalidstruct *obsolete) -{ - if (value) - field->in_handler = jtag_check_value; - else - field->in_handler = NULL; /* No check, e.g. embeddedice uses value==NULL to indicate no check */ - field->in_handler_priv = NULL; - field->in_check_value = value; - field->in_check_mask = mask; -} - void jtag_check_value_mask(scan_field_t *field, u8 *value, u8 *mask) { assert(field->in_value != NULL); @@ -1466,7 +1403,6 @@ void jtag_check_value_mask(scan_field_t *field, u8 *value, u8 *mask) int retval=jtag_check_value_inner(field->in_value, field, value, mask); jtag_set_error(retval); - } @@ -1478,7 +1414,7 @@ enum scan_type jtag_scan_type(scan_command_t *cmd) for (i = 0; i < cmd->num_fields; i++) { - if (cmd->fields[i].in_value || cmd->fields[i].in_handler) + if (cmd->fields[i].in_value) type |= SCAN_IN; if (cmd->fields[i].out_value) type |= SCAN_OUT; @@ -1566,7 +1502,7 @@ int jtag_examine_chain(void) field.in_value = idcode_buffer; - field.in_handler = NULL; + for (i = 0; i < JTAG_MAX_CHAIN_SIZE; i++) { @@ -1740,7 +1676,7 @@ int jtag_validate_chain(void) field.num_bits = total_ir_length; field.out_value = ir_test; field.in_value = ir_test; - field.in_handler = NULL; + jtag_add_plain_ir_scan(1, &field, TAP_RESET); jtag_execute_queue(); @@ -2858,9 +2794,6 @@ static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, c fields[i].out_value = malloc(CEIL(field_size, 8)); buf_set_u32(fields[i].out_value, 0, field_size, strtoul(args[i*2+1], NULL, 0)); fields[i].in_value = NULL; - fields[i].in_check_mask = NULL; - fields[i].in_handler = NULL; - fields[i].in_handler_priv = NULL; } jtag_add_ir_scan(argc / 2, fields, TAP_INVALID); @@ -2973,10 +2906,7 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args fields[field_count].out_value = malloc(CEIL(bits, 8)); str_to_buf(str, len, fields[field_count].out_value, bits, 0); fields[field_count].in_value = fields[field_count].out_value; - fields[field_count].in_check_mask = NULL; - fields[field_count].in_check_value = NULL; - fields[field_count].in_handler = NULL; - fields[field_count++].in_handler_priv = NULL; + field_count++; } jtag_add_dr_scan(num_fields, fields, TAP_INVALID); diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index 656741f9..dc6ef36c 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -272,11 +272,6 @@ typedef struct scan_field_s int num_bits; /* number of bits this field specifies (up to 32) */ u8* out_value; /* value to be scanned into the device */ u8* in_value; /* pointer to a 32-bit memory location to take data scanned out */ - /* in_check_value/mask, in_handler_error_handler, in_handler_priv can be used by the in handler, otherwise they contain garbage */ - u8* in_check_value; /* deprecated! only used from jtag_set_check_value. used to validate scan results */ - u8* in_check_mask; /* deprecated! only used from jtag_set_check_value. check specified bits against check_value */ - in_handler_t in_handler; /* deprecated! SET TO NULL. DO NOT USE! process received buffer using this handler */ - void* in_handler_priv; /* deprecated! only used by obsolete in_handler implementations */ } scan_field_t; enum scan_type { @@ -736,7 +731,6 @@ struct invalidstruct }; -extern void jtag_set_check_value(scan_field_t* field, u8* value, u8* mask, struct invalidstruct *obsolete); /* execute jtag queue and check value and use mask if mask is != NULL. invokes * jtag_set_error() with any error. */ extern void jtag_check_value_mask(scan_field_t *field, u8 *value, u8 *mask); diff --git a/src/jtag/zy1000.c b/src/jtag/zy1000.c index b1778068..ae082e2c 100644 --- a/src/jtag/zy1000.c +++ b/src/jtag/zy1000.c @@ -468,24 +468,6 @@ static __inline void scanFields(int num_fields, scan_field_t *fields, tap_state_ if (fields[i].in_value!=NULL) { inBuffer=fields[i].in_value; - } else if (fields[i].in_handler!=NULL) - { - if (in_buff_size*8<num_bits) - { - // we need more space - if (in_buff!=NULL) - free(in_buff); - in_buff=NULL; - in_buff_size=(num_bits+7)/8; - in_buff=malloc(in_buff_size); - if (in_buff==NULL) - { - LOG_ERROR("Out of memory"); - jtag_error=ERROR_JTAG_QUEUE_FAILED; - return; - } - } - inBuffer=in_buff; } // here we shuffle N bits out/in @@ -535,17 +517,6 @@ static __inline void scanFields(int num_fields, scan_field_t *fields, tap_state_ } j+=k; } - - if (fields[i].in_handler!=NULL) - { - // invoke callback - int r=fields[i].in_handler(inBuffer, fields[i].in_handler_priv, fields+i); - if (r!=ERROR_OK) - { - /* this will cause jtag_execute_queue() to return an error */ - jtag_error=r; - } - } } } @@ -577,15 +548,6 @@ int interface_jtag_add_ir_scan(int num_fields, scan_field_t *fields, tap_state_t { found = 1; - if ((jtag_verify_capture_ir)&&(fields[j].in_handler==NULL)) - { - jtag_set_check_value(fields+j, tap->expected, tap->expected_mask, NULL); - } else if (jtag_verify_capture_ir) - { - fields[j].in_check_value = tap->expected; - fields[j].in_check_mask = tap->expected_mask; - } - scanFields(1, fields+j, TAP_IRSHIFT, pause); /* update device information */ buf_cpy(fields[j].out_value, tap->cur_instr, scan_size); @@ -656,10 +618,6 @@ int interface_jtag_add_dr_scan(int num_fields, scan_field_t *fields, tap_state_t tmp.num_bits = 1; tmp.out_value = NULL; tmp.in_value = NULL; - tmp.in_check_value = NULL; - tmp.in_check_mask = NULL; - tmp.in_handler = NULL; - tmp.in_handler_priv = NULL; scanFields(1, &tmp, TAP_DRSHIFT, pause); } diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index 5a069421..ae03572f 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -60,7 +60,7 @@ int virtex2_set_instr(jtag_tap_t *tap, u32 new_instr) field.in_value = NULL; - field.in_handler = NULL; + jtag_add_ir_scan(1, &field, TAP_IDLE); @@ -84,7 +84,6 @@ int virtex2_send_32(struct pld_device_s *pld_device, int num_words, u32 *words) scan_field.num_bits = num_words * 32; scan_field.out_value = values; scan_field.in_value = NULL; - scan_field.in_handler = NULL; for (i = 0; i < num_words; i++) buf_set_u32(values + 4 * i, 0, 32, flip_u32(*words++, 32)); @@ -109,7 +108,6 @@ int virtex2_receive_32(struct pld_device_s *pld_device, int num_words, u32 *word scan_field.out_value = NULL; u8 tmp[4]; scan_field.in_value = tmp; - scan_field.in_handler = NULL; virtex2_set_instr(virtex2_info->tap, 0x4); /* CFG_OUT */ @@ -159,7 +157,7 @@ int virtex2_load(struct pld_device_s *pld_device, char *filename) field.in_value = NULL; - field.in_handler = NULL; + if ((retval = xilinx_read_bit_file(&bit_file, filename)) != ERROR_OK) diff --git a/src/svf/svf.c b/src/svf/svf.c index c94461ca..93f8ba44 100644 --- a/src/svf/svf.c +++ b/src/svf/svf.c @@ -985,7 +985,7 @@ static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str) field.in_value = &svf_tdi_buffer[svf_buffer_index]; - field.in_handler = NULL; + jtag_add_plain_dr_scan(1, &field, svf_para.dr_end_state); @@ -1086,7 +1086,7 @@ static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str) field.in_value = &svf_tdi_buffer[svf_buffer_index]; - field.in_handler = NULL; + jtag_add_plain_ir_scan(1, &field, svf_para.ir_end_state); diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index 7a639fde..4f320c1e 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -87,11 +87,6 @@ void arm11_setup_field(arm11_common_t * arm11, int num_bits, void * out_data, vo { field->tap = arm11->jtag_info.tap; field->num_bits = num_bits; - field->in_check_mask = NULL; - field->in_check_value = NULL; - field->in_handler = NULL; - field->in_handler_priv = NULL; - field->out_value = out_data; field->in_value = in_data; } diff --git a/src/target/arm720t.c b/src/target/arm720t.c index ec1b3238..5c4ba16a 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -113,13 +113,13 @@ int arm720t_scan_cp15(target_t *target, u32 out, u32 *in, int instruction, int c fields[0].num_bits = 1; fields[0].out_value = &instruction_buf; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 32; fields[1].out_value = out_buf; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + if (in) { u8 tmp[4]; diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c index 647e68b9..268d09e5 100644 --- a/src/target/arm7tdmi.c +++ b/src/target/arm7tdmi.c @@ -115,13 +115,13 @@ int arm7tdmi_examine_debug_reason(target_t *target) fields[0].num_bits = 1; fields[0].out_value = NULL; fields[0].in_value = &breakpoint; - fields[0].in_handler = NULL; + fields[1].tap = arm7_9->jtag_info.tap; fields[1].num_bits = 32; fields[1].out_value = NULL; fields[1].in_value = databus; - fields[1].in_handler = NULL; + if((retval = arm_jtag_scann(&arm7_9->jtag_info, 0x1)) != ERROR_OK) { @@ -194,7 +194,7 @@ int arm7tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in) fields[0].num_bits = 1; fields[0].out_value = NULL; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -202,7 +202,7 @@ int arm7tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in) fields[1].out_value = NULL; u8 tmp[4]; fields[1].in_value = tmp; - fields[1].in_handler = NULL; + jtag_add_dr_scan_now(2, fields, TAP_INVALID); @@ -286,14 +286,14 @@ int arm7tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size, fields[0].num_bits = 1; fields[0].out_value = NULL; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 32; fields[1].out_value = NULL; u8 tmp[4]; fields[1].in_value = tmp; - fields[1].in_handler = NULL; + jtag_add_dr_scan_now(2, fields, TAP_INVALID); diff --git a/src/target/arm920t.c b/src/target/arm920t.c index d2ae9792..d83f54ba 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -114,25 +114,25 @@ int arm920t_read_cp15_physical(target_t *target, int reg_addr, u32 *value) fields[0].num_bits = 1; fields[0].out_value = &access_type_buf; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 32; fields[1].out_value = NULL; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; fields[2].num_bits = 6; fields[2].out_value = ®_addr_buf; fields[2].in_value = NULL; - fields[2].in_handler = NULL; + fields[3].tap = jtag_info->tap; fields[3].num_bits = 1; fields[3].out_value = &nr_w_buf; fields[3].in_value = NULL; - fields[3].in_handler = NULL; + jtag_add_dr_scan(4, fields, TAP_INVALID); @@ -175,7 +175,7 @@ int arm920t_write_cp15_physical(target_t *target, int reg_addr, u32 value) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -185,7 +185,7 @@ int arm920t_write_cp15_physical(target_t *target, int reg_addr, u32 value) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; @@ -195,7 +195,7 @@ int arm920t_write_cp15_physical(target_t *target, int reg_addr, u32 value) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + fields[3].tap = jtag_info->tap; @@ -205,7 +205,7 @@ int arm920t_write_cp15_physical(target_t *target, int reg_addr, u32 value) fields[3].in_value = NULL; - fields[3].in_handler = NULL; + jtag_add_dr_scan(4, fields, TAP_INVALID); @@ -242,7 +242,7 @@ int arm920t_execute_cp15(target_t *target, u32 cp15_opcode, u32 arm_opcode) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -252,7 +252,7 @@ int arm920t_execute_cp15(target_t *target, u32 cp15_opcode, u32 arm_opcode) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; @@ -262,7 +262,7 @@ int arm920t_execute_cp15(target_t *target, u32 cp15_opcode, u32 arm_opcode) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + fields[3].tap = jtag_info->tap; @@ -272,7 +272,7 @@ int arm920t_execute_cp15(target_t *target, u32 cp15_opcode, u32 arm_opcode) fields[3].in_value = NULL; - fields[3].in_handler = NULL; + jtag_add_dr_scan(4, fields, TAP_INVALID); diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index d24951b5..f05087e4 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -96,6 +96,10 @@ target_type_t arm926ejs_target = int arm926ejs_catch_broken_irscan(u8 *captured, void *priv, scan_field_t *field) { + /* FIX!!!! this code should be reenabled. For now it does not check + * the queue...*/ + return 0; +#if 0 /* The ARM926EJ-S' instruction register is 4 bits wide */ u8 t = *captured & 0xf; u8 t2 = *field->in_check_value & 0xf; @@ -109,6 +113,7 @@ int arm926ejs_catch_broken_irscan(u8 *captured, void *priv, scan_field_t *field) return ERROR_OK; } return ERROR_JTAG_QUEUE_FAILED;; +#endif } #define ARM926EJS_CP15_ADDR(opcode_1, opcode_2, CRn, CRm) ((opcode_1 << 11) | (opcode_2 << 8) | (CRn << 4) | (CRm << 0)) @@ -139,26 +144,26 @@ int arm926ejs_cp15_read(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u3 fields[0].out_value = NULL; u8 tmp[4]; fields[0].in_value = tmp; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 1; fields[1].out_value = &access; fields[1].in_value = &access; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; fields[2].num_bits = 14; fields[2].out_value = address_buf; fields[2].in_value = NULL; - fields[2].in_handler = NULL; + fields[3].tap = jtag_info->tap; fields[3].num_bits = 1; fields[3].out_value = &nr_w_buf; fields[3].in_value = NULL; - fields[3].in_handler = NULL; + jtag_add_dr_scan(4, fields, TAP_INVALID); @@ -217,7 +222,7 @@ int arm926ejs_cp15_write(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -227,7 +232,7 @@ int arm926ejs_cp15_write(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u fields[1].in_value = &access; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; @@ -237,7 +242,7 @@ int arm926ejs_cp15_write(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u fields[2].in_value = NULL; - fields[2].in_handler = NULL; + fields[3].tap = jtag_info->tap; @@ -247,7 +252,7 @@ int arm926ejs_cp15_write(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u fields[3].in_value = NULL; - fields[3].in_handler = NULL; + jtag_add_dr_scan(4, fields, TAP_INVALID); diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 40754781..efaf0ab0 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -188,19 +188,19 @@ int arm966e_read_cp15(target_t *target, int reg_addr, u32 *value) fields[0].num_bits = 32; fields[0].out_value = NULL; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 6; fields[1].out_value = ®_addr_buf; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; fields[2].num_bits = 1; fields[2].out_value = &nr_w_buf; fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); @@ -250,7 +250,7 @@ int arm966e_write_cp15(target_t *target, int reg_addr, u32 value) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -260,7 +260,7 @@ int arm966e_write_cp15(target_t *target, int reg_addr, u32 value) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; @@ -270,7 +270,7 @@ int arm966e_write_cp15(target_t *target, int reg_addr, u32 value) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index 57dab4fa..5098b3e2 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -132,7 +132,7 @@ int arm9tdmi_examine_debug_reason(target_t *target) fields[0].in_value = databus; - fields[0].in_handler = NULL; + fields[1].tap = arm7_9->jtag_info.tap; @@ -142,7 +142,7 @@ int arm9tdmi_examine_debug_reason(target_t *target) fields[1].in_value = &debug_reason; - fields[1].in_handler = NULL; + fields[2].tap = arm7_9->jtag_info.tap; @@ -152,7 +152,7 @@ int arm9tdmi_examine_debug_reason(target_t *target) fields[2].in_value = instructionbus; - fields[2].in_handler = NULL; + if((retval = arm_jtag_scann(&arm7_9->jtag_info, 0x1)) != ERROR_OK) @@ -217,20 +217,20 @@ int arm9tdmi_clock_out(arm_jtag_t *jtag_info, u32 instr, u32 out, u32 *in, int s fields[0].num_bits = 32; fields[0].out_value = out_buf; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 3; fields[1].out_value = &sysspeed_buf; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; fields[2].num_bits = 32; fields[2].out_value = instr_buf; fields[2].in_value = NULL; - fields[2].in_handler = NULL; + if (in) { @@ -285,19 +285,19 @@ int arm9tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in) fields[0].out_value = NULL; u8 tmp[4]; fields[0].in_value = tmp; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 3; fields[1].out_value = NULL; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; fields[2].num_bits = 32; fields[2].out_value = NULL; fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan_now(3, fields, TAP_INVALID); @@ -350,19 +350,19 @@ int arm9tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size, fields[0].out_value = NULL; u8 tmp[4]; fields[0].in_value = tmp; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 3; fields[1].out_value = NULL; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; fields[2].num_bits = 32; fields[2].out_value = NULL; fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan_now(3, fields, TAP_INVALID); diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 871caefc..fb30989a 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -81,7 +81,7 @@ int adi_jtag_dp_scan(arm_jtag_t *jtag_info, u8 instr, u8 reg_addr, u8 RnW, u8 *o fields[0].in_value = ack; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -89,7 +89,7 @@ int adi_jtag_dp_scan(arm_jtag_t *jtag_info, u8 instr, u8 reg_addr, u8 RnW, u8 *o fields[1].out_value = outvalue; fields[1].in_value = invalue; - fields[1].in_handler = NULL; + @@ -114,7 +114,7 @@ int adi_jtag_dp_scan_u32(arm_jtag_t *jtag_info, u8 instr, u8 reg_addr, u8 RnW, u buf_set_u32(&out_addr_buf, 0, 3, ((reg_addr >> 1) & 0x6) | (RnW & 0x1)); fields[0].out_value = &out_addr_buf; fields[0].in_value = ack; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -122,7 +122,7 @@ int adi_jtag_dp_scan_u32(arm_jtag_t *jtag_info, u8 instr, u8 reg_addr, u8 RnW, u buf_set_u32(out_value_buf, 0, 32, outvalue); fields[1].out_value = out_value_buf; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + if (invalue) { diff --git a/src/target/arm_jtag.c b/src/target/arm_jtag.c index 1732aac7..ad57cef9 100644 --- a/src/target/arm_jtag.c +++ b/src/target/arm_jtag.c @@ -53,7 +53,7 @@ int arm_jtag_set_instr(arm_jtag_t *jtag_info, u32 new_instr, void *no_verify_ca field.out_value = t; buf_set_u32(field.out_value, 0, field.num_bits, new_instr); field.in_value = NULL; - field.in_handler = NULL; + if (no_verify_capture==NULL) diff --git a/src/target/avrt.c b/src/target/avrt.c index 86ada2b2..af692dd3 100644 --- a/src/target/avrt.c +++ b/src/target/avrt.c @@ -126,10 +126,10 @@ int avr_register_commands(struct command_context_s *cmd_ctx) int avr_target_create(struct target_s *target, Jim_Interp *interp) { avr_common_t *avr = calloc(1, sizeof(avr_common_t)); - + avr->jtag_info.tap = target->tap; target->arch_info = avr; - + return ERROR_OK; } @@ -157,7 +157,7 @@ int avr_poll(target_t *target) { target->state = TARGET_HALTED; } - + LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } @@ -183,7 +183,7 @@ int avr_step(struct target_s *target, int current, u32 address, int handle_break int avr_assert_reset(target_t *target) { target->state = TARGET_RESET; - + LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } @@ -191,7 +191,7 @@ int avr_assert_reset(target_t *target) int avr_deassert_reset(target_t *target) { target->state = TARGET_RUNNING; - + LOG_DEBUG("%s", __FUNCTION__); return ERROR_OK; } @@ -225,21 +225,17 @@ int mcu_write_ir(jtag_tap_t *tap, u8 *ir_in, u8 *ir_out, int ir_len, int rti) LOG_ERROR("invalid ir_len"); return ERROR_FAIL; } - + { scan_field_t field[1]; - + field[0].tap = tap; field[0].num_bits = tap->ir_length; field[0].out_value = ir_out; field[0].in_value = ir_in; - field[0].in_check_value = NULL; - field[0].in_check_mask = NULL; - field[0].in_handler = NULL; - field[0].in_handler_priv = NULL; jtag_add_plain_ir_scan(sizeof(field) / sizeof(field[0]), field, TAP_IDLE); } - + return ERROR_OK; } @@ -250,21 +246,17 @@ int mcu_write_dr(jtag_tap_t *tap, u8 *dr_in, u8 *dr_out, int dr_len, int rti) LOG_ERROR("invalid tap"); return ERROR_FAIL; } - + { scan_field_t field[1]; - + field[0].tap = tap; field[0].num_bits = dr_len; field[0].out_value = dr_out; field[0].in_value = dr_in; - field[0].in_check_value = NULL; - field[0].in_check_mask = NULL; - field[0].in_handler = NULL; - field[0].in_handler_priv = NULL; jtag_add_plain_dr_scan(sizeof(field) / sizeof(field[0]), field, TAP_IDLE); } - + return ERROR_OK; } @@ -275,9 +267,9 @@ int mcu_write_ir_u8(jtag_tap_t *tap, u8 *ir_in, u8 ir_out, int ir_len, int rti) LOG_ERROR("ir_len overflow, maxium is 8"); return ERROR_FAIL; } - + mcu_write_ir(tap, ir_in, &ir_out, ir_len, rti); - + return ERROR_OK; } @@ -288,9 +280,9 @@ int mcu_write_dr_u8(jtag_tap_t *tap, u8 *dr_in, u8 dr_out, int dr_len, int rti) LOG_ERROR("dr_len overflow, maxium is 8"); return ERROR_FAIL; } - + mcu_write_dr(tap, dr_in, &dr_out, dr_len, rti); - + return ERROR_OK; } @@ -301,9 +293,9 @@ int mcu_write_ir_u16(jtag_tap_t *tap, u16 *ir_in, u16 ir_out, int ir_len, int rt LOG_ERROR("ir_len overflow, maxium is 16"); return ERROR_FAIL; } - + mcu_write_ir(tap, (u8*)ir_in, (u8*)&ir_out, ir_len, rti); - + return ERROR_OK; } @@ -314,9 +306,9 @@ int mcu_write_dr_u16(jtag_tap_t *tap, u16 *dr_in, u16 dr_out, int dr_len, int rt LOG_ERROR("dr_len overflow, maxium is 16"); return ERROR_FAIL; } - + mcu_write_dr(tap, (u8*)dr_in, (u8*)&dr_out, dr_len, rti); - + return ERROR_OK; } @@ -327,9 +319,9 @@ int mcu_write_ir_u32(jtag_tap_t *tap, u32 *ir_in, u32 ir_out, int ir_len, int rt LOG_ERROR("ir_len overflow, maxium is 32"); return ERROR_FAIL; } - + mcu_write_ir(tap, (u8*)ir_in, (u8*)&ir_out, ir_len, rti); - + return ERROR_OK; } @@ -340,9 +332,9 @@ int mcu_write_dr_u32(jtag_tap_t *tap, u32 *dr_in, u32 dr_out, int dr_len, int rt LOG_ERROR("dr_len overflow, maxium is 32"); return ERROR_FAIL; } - + mcu_write_dr(tap, (u8*)dr_in, (u8*)&dr_out, dr_len, rti); - + return ERROR_OK; } diff --git a/src/target/embeddedice.c b/src/target/embeddedice.c index 363d182e..892e8264 100644 --- a/src/target/embeddedice.c +++ b/src/target/embeddedice.c @@ -252,21 +252,21 @@ int embeddedice_read_reg_w_check(reg_t *reg, u8* check_value, u8* check_mask) fields[0].num_bits = 32; fields[0].out_value = reg->value; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = ice_reg->jtag_info->tap; fields[1].num_bits = 5; fields[1].out_value = field1_out; buf_set_u32(fields[1].out_value, 0, 5, reg_addr); fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = ice_reg->jtag_info->tap; fields[2].num_bits = 1; fields[2].out_value = field2_out; buf_set_u32(fields[2].out_value, 0, 1, 0); fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); @@ -304,21 +304,21 @@ int embeddedice_receive(arm_jtag_t *jtag_info, u32 *data, u32 size) fields[0].out_value = NULL; u8 tmp[4]; fields[0].in_value = tmp; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; fields[1].num_bits = 5; fields[1].out_value = field1_out; buf_set_u32(fields[1].out_value, 0, 5, embeddedice_reg_arch_info[EICE_COMMS_DATA]); fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; fields[2].num_bits = 1; fields[2].out_value = field2_out; buf_set_u32(fields[2].out_value, 0, 1, 0); fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); @@ -412,7 +412,7 @@ int embeddedice_send(arm_jtag_t *jtag_info, u32 *data, u32 size) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -423,7 +423,7 @@ int embeddedice_send(arm_jtag_t *jtag_info, u32 *data, u32 size) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; @@ -434,7 +434,7 @@ int embeddedice_send(arm_jtag_t *jtag_info, u32 *data, u32 size) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + while (size > 0) @@ -481,7 +481,7 @@ int embeddedice_handshake(arm_jtag_t *jtag_info, int hsbit, u32 timeout) fields[0].in_value = field0_in; - fields[0].in_handler = NULL; + fields[1].tap = jtag_info->tap; @@ -492,7 +492,7 @@ int embeddedice_handshake(arm_jtag_t *jtag_info, int hsbit, u32 timeout) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; @@ -503,7 +503,7 @@ int embeddedice_handshake(arm_jtag_t *jtag_info, int hsbit, u32 timeout) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); diff --git a/src/target/etb.c b/src/target/etb.c index 1d70f416..8ccc5387 100644 --- a/src/target/etb.c +++ b/src/target/etb.c @@ -74,7 +74,7 @@ static int etb_set_instr(etb_t *etb, u32 new_instr) field.in_value = NULL; - field.in_handler = NULL; + jtag_add_ir_scan(1, &field, TAP_INVALID); @@ -99,7 +99,7 @@ static int etb_scann(etb_t *etb, u32 new_scan_chain) field.in_value = NULL; - field.in_handler = NULL; + /* select INTEST instruction */ @@ -188,21 +188,21 @@ static int etb_read_ram(etb_t *etb, u32 *data, int num_frames) fields[0].out_value = NULL; u8 tmp[4]; fields[0].in_value = tmp; - fields[0].in_handler = NULL; + fields[1].tap = etb->tap; fields[1].num_bits = 7; fields[1].out_value = malloc(1); buf_set_u32(fields[1].out_value, 0, 7, 4); fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = etb->tap; fields[2].num_bits = 1; fields[2].out_value = malloc(1); buf_set_u32(fields[2].out_value, 0, 1, 0); fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); @@ -250,7 +250,7 @@ int etb_read_reg_w_check(reg_t *reg, u8* check_value, u8* check_mask) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = etb_reg->etb->tap; @@ -261,7 +261,7 @@ int etb_read_reg_w_check(reg_t *reg, u8* check_value, u8* check_mask) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = etb_reg->etb->tap; @@ -272,7 +272,7 @@ int etb_read_reg_w_check(reg_t *reg, u8* check_value, u8* check_mask) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); @@ -347,7 +347,7 @@ int etb_write_reg(reg_t *reg, u32 value) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = etb_reg->etb->tap; @@ -358,7 +358,7 @@ int etb_write_reg(reg_t *reg, u32 value) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = etb_reg->etb->tap; @@ -369,7 +369,7 @@ int etb_write_reg(reg_t *reg, u32 value) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); diff --git a/src/target/etm.c b/src/target/etm.c index 24dd0ff7..0c0a39da 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -340,21 +340,21 @@ int etm_read_reg_w_check(reg_t *reg, u8* check_value, u8* check_mask) fields[0].num_bits = 32; fields[0].out_value = reg->value; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = etm_reg->jtag_info->tap; fields[1].num_bits = 7; fields[1].out_value = malloc(1); buf_set_u32(fields[1].out_value, 0, 7, reg_addr); fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = etm_reg->jtag_info->tap; fields[2].num_bits = 1; fields[2].out_value = malloc(1); buf_set_u32(fields[2].out_value, 0, 1, 0); fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); @@ -424,7 +424,7 @@ int etm_write_reg(reg_t *reg, u32 value) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = etm_reg->jtag_info->tap; @@ -435,7 +435,7 @@ int etm_write_reg(reg_t *reg, u32 value) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = etm_reg->jtag_info->tap; @@ -446,7 +446,7 @@ int etm_write_reg(reg_t *reg, u32 value) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); diff --git a/src/target/feroceon.c b/src/target/feroceon.c index abc44f5e..ccf32d8c 100644 --- a/src/target/feroceon.c +++ b/src/target/feroceon.c @@ -137,7 +137,7 @@ int feroceon_dummy_clock_out(arm_jtag_t *jtag_info, u32 instr) fields[0].out_value = out_buf; fields[0].in_value = NULL; - fields[0].in_handler = NULL; + @@ -149,7 +149,7 @@ int feroceon_dummy_clock_out(arm_jtag_t *jtag_info, u32 instr) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = jtag_info->tap; @@ -159,7 +159,7 @@ int feroceon_dummy_clock_out(arm_jtag_t *jtag_info, u32 instr) fields[2].in_value = NULL; - fields[2].in_handler = NULL; + jtag_add_dr_scan(3, fields, TAP_INVALID); diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c index 424105ee..0a4219f7 100644 --- a/src/target/mips_ejtag.c +++ b/src/target/mips_ejtag.c @@ -53,7 +53,7 @@ int mips_ejtag_set_instr(mips_ejtag_t *ejtag_info, int new_instr, void *delete_m field.in_value = NULL; - field.in_handler = NULL; + jtag_add_ir_scan(1, &field, TAP_INVALID); } @@ -76,7 +76,7 @@ int mips_ejtag_get_idcode(mips_ejtag_t *ejtag_info, u32 *idcode, in_handler_t ha field.in_value = (void*)idcode; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_INVALID); @@ -103,7 +103,7 @@ int mips_ejtag_get_impcode(mips_ejtag_t *ejtag_info, u32 *impcode, in_handler_t field.in_value = (void*)impcode; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_INVALID); @@ -134,7 +134,7 @@ int mips_ejtag_drscan_32(mips_ejtag_t *ejtag_info, u32 *data) field.in_value = (u8*)data; - field.in_handler = NULL; + jtag_add_dr_scan(1, &field, TAP_INVALID); diff --git a/src/target/xscale.c b/src/target/xscale.c index d3943561..bba20eab 100644 --- a/src/target/xscale.c +++ b/src/target/xscale.c @@ -270,7 +270,7 @@ int xscale_read_dcsr(target_t *target) fields[1].num_bits = 32; fields[1].out_value = NULL; fields[1].in_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value; - fields[1].in_handler = NULL; + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -346,7 +346,7 @@ int xscale_receive(target_t *target, u32 *buffer, int num_words) fields[1].out_value = NULL; u8 tmp[4]; fields[1].in_value = tmp; - fields[1].in_handler = NULL; + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -462,7 +462,7 @@ int xscale_read_tx(target_t *target, int consume) fields[1].num_bits = 32; fields[1].out_value = NULL; fields[1].in_value = xscale->reg_cache->reg_list[XSCALE_TX].value; - fields[1].in_handler = NULL; + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -554,7 +554,7 @@ int xscale_write_rx(target_t *target) fields[1].num_bits = 32; fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_RX].value; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -726,7 +726,7 @@ int xscale_write_dcsr(target_t *target, int hold_rst, int ext_dbg_brk) fields[1].num_bits = 32; fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value; fields[1].in_value = NULL; - fields[1].in_handler = NULL; + fields[2].tap = xscale->jtag_info.tap; fields[2].num_bits = 1; @@ -796,7 +796,7 @@ int xscale_load_ic(target_t *target, int mini, u32 va, u32 buffer[8]) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = xscale->jtag_info.tap; @@ -806,7 +806,7 @@ int xscale_load_ic(target_t *target, int mini, u32 va, u32 buffer[8]) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + jtag_add_dr_scan(2, fields, TAP_INVALID); @@ -858,7 +858,7 @@ int xscale_invalidate_ic_line(target_t *target, u32 va) fields[0].in_value = NULL; - fields[0].in_handler = NULL; + fields[1].tap = xscale->jtag_info.tap; @@ -868,7 +868,7 @@ int xscale_invalidate_ic_line(target_t *target, u32 va) fields[1].in_value = NULL; - fields[1].in_handler = NULL; + jtag_add_dr_scan(2, fields, TAP_INVALID); diff --git a/src/xsvf/xsvf.c b/src/xsvf/xsvf.c index 0e3152da..da0cb20c 100644 --- a/src/xsvf/xsvf.c +++ b/src/xsvf/xsvf.c @@ -719,7 +719,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha field.in_value = NULL; - field.in_handler = NULL; + if (tap == NULL) jtag_add_plain_ir_scan(1, &field, my_end_state); |