field.out_value = NULL;
field.in_value = &status;
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
jtag_execute_queue();
} while(!(status & ISC_STATUS_BUSY));
field.out_value = §or;
field.in_value = NULL;
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
return ERROR_OK;
}
field.out_value = NULL;
field.in_value = scanbuf;
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
jtag_execute_queue();
status = buf_get_u32(scanbuf, 0, 8);
field.out_value = NULL;
field.in_value = scanbuf;
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
jtag_execute_queue();
status = buf_get_u32(scanbuf, 0, 8);
field.out_value = NULL;
field.in_value = &status;
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
jtag_execute_queue();
} while(!(status & ISC_STATUS_BUSY));
return cmd_queue_end_state;
}
+tap_state_t jtag_get_end_state(void)
+{
+ return cmd_queue_end_state;
+}
+
void jtag_add_sleep(u32 us)
{
keep_alive(); /* we might be running on a very slow JTAG clk */
return ERROR_COMMAND_SYNTAX_ERROR;
}
- jtag_add_runtest(strtol(args[0], NULL, 0), jtag_add_end_state(TAP_INVALID));
+ jtag_add_runtest(strtol(args[0], NULL, 0), jtag_get_end_state());
jtag_execute_queue();
return ERROR_OK;
/**
- * Function jtag_add_stable_clocks
+ * Function jtag_add_end_state
*
* Set a global variable to \a state if \a state != TAP_INVALID.
*
*
**/
extern tap_state_t jtag_add_end_state(tap_state_t state);
+/**
+ * Function jtag_get_end_state
+ *
+ * Return the value of the global variable for end state
+ *
+ **/
+extern tap_state_t jtag_get_end_state(void);
extern void jtag_add_sleep(u32 us);
void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, u8 *buffer, int little, int count)
{
// static int const reg_addr=0x5;
- tap_state_t end_state=jtag_add_end_state(TAP_INVALID);
+ tap_state_t end_state=jtag_get_end_state();
if (jtag_NextEnabledTap(jtag_NextEnabledTap(NULL))==NULL)
{
/* better performance via code duplication */
23 * ARM11_REGCACHE_MODEREGS + \
9 * ARM11_REGCACHE_FREGS)
-#define ARM11_TAP_DEFAULT jtag_add_end_state(TAP_INVALID)
+#define ARM11_TAP_DEFAULT jtag_get_end_state()
#define CHECK_RETVAL(action) \
if (in)
{
fields[1].in_value = (u8 *)in;
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
jtag_add_callback(arm7flip32, (u8 *)in);
} else
{
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
}
if (clock)
- jtag_add_runtest(0, jtag_add_end_state(TAP_INVALID));
+ jtag_add_runtest(0, jtag_get_end_state());
#ifdef _DEBUG_INSTRUCTION_EXECUTION_
if((retval = jtag_execute_queue()) != ERROR_OK)
2,
arm7tdmi_num_bits,
values,
- jtag_add_end_state(TAP_INVALID));
+ jtag_get_end_state());
- jtag_add_runtest(0, jtag_add_end_state(TAP_INVALID));
+ jtag_add_runtest(0, jtag_get_end_state());
return ERROR_OK;
}
fields[1].out_value = NULL;
fields[1].in_value = (u8 *)in;
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
jtag_add_callback(arm7flip32, (u8 *)in);
- jtag_add_runtest(0, jtag_add_end_state(TAP_INVALID));
+ jtag_add_runtest(0, jtag_get_end_state());
#ifdef _DEBUG_INSTRUCTION_EXECUTION_
{
fields[1].out_value = NULL;
jtag_alloc_in_value32(&fields[1]);
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
jtag_add_callback4(arm7endianness, in, (jtag_callback_data_t)size, (jtag_callback_data_t)be, (jtag_callback_data_t)fields[1].in_value);
- jtag_add_runtest(0, jtag_add_end_state(TAP_INVALID));
+ jtag_add_runtest(0, jtag_get_end_state());
#ifdef _DEBUG_INSTRUCTION_EXECUTION_
{
fields[3].out_value = &nr_w_buf;
fields[3].in_value = NULL;
- jtag_add_dr_scan(4, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(4, fields, jtag_get_end_state());
fields[1].in_value = (u8 *)value;
- jtag_add_dr_scan(4, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(4, fields, jtag_get_end_state());
jtag_add_callback(arm_le_to_h_u32, (u8 *)value);
fields[3].out_value = &nr_w_buf;
fields[3].in_value = NULL;
- jtag_add_dr_scan(4, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(4, fields, jtag_get_end_state());
#ifdef _DEBUG_INSTRUCTION_EXECUTION_
LOG_DEBUG("addr: 0x%x value: %8.8x", reg_addr, value);
fields[3].out_value = &nr_w_buf;
fields[3].in_value = NULL;
- jtag_add_dr_scan(4, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(4, fields, jtag_get_end_state());
arm9tdmi_clock_out(jtag_info, arm_opcode, 0, NULL, 0);
arm9tdmi_clock_out(jtag_info, ARMV4_5_NOP, 0, NULL, 1);
fields[3].out_value = &nr_w_buf;
fields[3].in_value = NULL;
- jtag_add_dr_scan(4, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(4, fields, jtag_get_end_state());
/*TODO: add timeout*/
do
/* rescan with NOP, to wait for the access to complete */
access = 0;
nr_w_buf = 0;
- jtag_add_dr_scan(4, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(4, fields, jtag_get_end_state());
jtag_add_callback(arm_le_to_h_u32, (u8 *)value);
fields[3].out_value = &nr_w_buf;
fields[3].in_value = NULL;
- jtag_add_dr_scan(4, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(4, fields, jtag_get_end_state());
/*TODO: add timeout*/
do
{
/* rescan with NOP, to wait for the access to complete */
access = 0;
nr_w_buf = 0;
- jtag_add_dr_scan(4, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(4, fields, jtag_get_end_state());
if ((retval = jtag_execute_queue()) != ERROR_OK)
{
return retval;
fields[2].out_value = &nr_w_buf;
fields[2].in_value = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
fields[1].in_value = (u8 *)value;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
jtag_add_callback(arm_le_to_h_u32, (u8 *)value);
fields[2].out_value = &nr_w_buf;
fields[2].in_value = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
#ifdef _DEBUG_INSTRUCTION_EXECUTION_
LOG_DEBUG("addr: 0x%x value: %8.8x", reg_addr, value);
if (in)
{
fields[0].in_value=(u8 *)in;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
jtag_add_callback(arm_le_to_h_u32, (u8 *)in);
}
else
{
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
}
- jtag_add_runtest(0, jtag_add_end_state(TAP_INVALID));
+ jtag_add_runtest(0, jtag_get_end_state());
#ifdef _DEBUG_INSTRUCTION_EXECUTION_
{
fields[2].out_value = NULL;
fields[2].in_value = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
jtag_add_callback(arm_le_to_h_u32, (u8 *)in);
- jtag_add_runtest(0, jtag_add_end_state(TAP_INVALID));
+ jtag_add_runtest(0, jtag_get_end_state());
#ifdef _DEBUG_INSTRUCTION_EXECUTION_
{
fields[2].out_value = NULL;
fields[2].in_value = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
jtag_add_callback4(arm9endianness, in, (jtag_callback_data_t)size, (jtag_callback_data_t)be, (jtag_callback_data_t)fields[0].in_value);
- jtag_add_runtest(0, jtag_add_end_state(TAP_INVALID));
+ jtag_add_runtest(0, jtag_get_end_state());
#ifdef _DEBUG_INSTRUCTION_EXECUTION_
{
fields[1].out_value = outvalue;
fields[1].in_value = invalue;
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
return ERROR_OK;
}
if (invalue)
{
fields[1].in_value = (u8 *)invalue;
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
jtag_add_callback(arm_le_to_h_u32, (u8 *)invalue);
} else
{
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
}
return ERROR_OK;
if (no_verify_capture==NULL)
{
- jtag_add_ir_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_ir_scan(1, &field, jtag_get_end_state());
} else
{
/* FIX!!!! this is a kludge!!! arm926ejs.c should reimplement this arm_jtag_set_instr to
* have special verification code.
*/
- jtag_add_ir_scan_noverify(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_ir_scan_noverify(1, &field, jtag_get_end_state());
}
}
1,
num_bits,
values,
- jtag_add_end_state(TAP_INVALID));
+ jtag_get_end_state());
jtag_info->cur_scan_chain = new_scan_chain;
}
fields[2].check_value = NULL;
fields[2].check_mask = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
fields[0].in_value = reg->value;
fields[0].check_value = check_value;
*/
buf_set_u32(fields[1].out_value, 0, 5, embeddedice_reg_arch_info[EICE_COMMS_CTRL]);
- jtag_add_dr_scan_check(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan_check(3, fields, jtag_get_end_state());
return ERROR_OK;
}
buf_set_u32(fields[2].out_value, 0, 1, 0);
fields[2].in_value = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
while (size > 0)
{
buf_set_u32(fields[1].out_value, 0, 5, embeddedice_reg_arch_info[EICE_COMMS_CTRL]);
fields[0].in_value = (u8 *)data;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
jtag_add_callback(arm_le_to_h_u32, (u8 *)data);
data++;
while (size > 0)
{
buf_set_u32(fields[0].out_value, 0, 32, *data);
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
data++;
size--;
buf_set_u32(fields[2].out_value, 0, 1, 0);
fields[2].in_value = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
gettimeofday(&lap, NULL);
do
{
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
if ((retval = jtag_execute_queue()) != ERROR_OK)
return retval;
3,
embeddedice_num_bits,
values,
- jtag_add_end_state(TAP_INVALID));
+ jtag_get_end_state());
}
void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, u8 *buffer, int little, int count);
field.in_value = NULL;
- jtag_add_ir_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_ir_scan(1, &field, jtag_get_end_state());
free(field.out_value);
}
/* select INTEST instruction */
etb_set_instr(etb, 0x2);
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
etb->cur_scan_chain = new_scan_chain;
buf_set_u32(fields[2].out_value, 0, 1, 0);
fields[2].in_value = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
for (i = 0; i < num_frames; i++)
{
buf_set_u32(fields[1].out_value, 0, 7, 0);
fields[0].in_value = (u8 *)(data+i);
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
jtag_add_callback(etb_getbuf, (u8 *)(data+i));
}
fields[2].check_value = NULL;
fields[2].check_mask = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
/* read the identification register in the second run, to make sure we
* don't read the ETB data register twice, skipping every second entry
fields[0].check_value = check_value;
fields[0].check_mask = check_mask;
- jtag_add_dr_scan_check(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan_check(3, fields, jtag_get_end_state());
free(fields[1].out_value);
free(fields[2].out_value);
fields[2].check_value = NULL;
fields[2].check_mask = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
fields[0].in_value = reg->value;
fields[0].check_value = check_value;
fields[0].check_mask = check_mask;
- jtag_add_dr_scan_check(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan_check(3, fields, jtag_get_end_state());
free(fields[1].out_value);
free(fields[2].out_value);
buf_set_u32(fields[2].out_value, 0, 1, 1);
fields[2].in_value = NULL;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
return ERROR_OK;
}
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
- /* no jtag_add_runtest(0, jtag_add_end_state(TAP_INVALID)) here */
+ /* no jtag_add_runtest(0, jtag_get_end_state()) here */
return ERROR_OK;
}
- jtag_add_ir_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_ir_scan(1, &field, jtag_get_end_state());
}
return ERROR_OK;
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
if (jtag_execute_queue() != ERROR_OK)
{
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
if (jtag_execute_queue() != ERROR_OK)
{
- jtag_add_dr_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(1, &field, jtag_get_end_state());
if ((retval = jtag_execute_queue()) != ERROR_OK)
{
u8 tmp[4];
field.in_value = tmp;
- jtag_add_ir_scan(1, &field, jtag_add_end_state(TAP_INVALID));
+ jtag_add_ir_scan(1, &field, jtag_get_end_state());
/* FIX!!!! isn't this check superfluous? verify_ircapture handles this? */
jtag_check_value_mask(&field, tap->expected, tap->expected_mask);
u8 tmp2;
fields[2].in_value = &tmp2;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
jtag_check_value_mask(fields+0, &field0_check_value, &field0_check_mask);
jtag_check_value_mask(fields+2, &field2_check_value, &field2_check_mask);
jtag_add_end_state(TAP_IDLE);
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
/* DANGER!!! this must be here. It will make sure that the arguments
* to jtag_set_check_value() does not go out of scope! */
jtag_add_end_state(TAP_IDLE);
xscale_jtag_set_instr(xscale->jtag_info.tap, xscale->jtag_info.dbgtx);
- jtag_add_runtest(1, jtag_add_end_state(TAP_INVALID)); /* ensures that we're in the TAP_IDLE state as the above could be a no-op */
+ jtag_add_runtest(1, jtag_get_end_state()); /* ensures that we're in the TAP_IDLE state as the above could be a no-op */
/* repeat until all words have been collected */
int attempts=0;
u8 tmp2;
fields[2].in_value = &tmp2;
- jtag_add_dr_scan(3, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(3, fields, jtag_get_end_state());
jtag_check_value_mask(fields+0, &field0_check_value, &field0_check_mask);
jtag_check_value_mask(fields+2, &field2_check_value, &field2_check_mask);
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
fields[0].num_bits = 32;
fields[0].out_value = packet;
memcpy(&value, packet, sizeof(u32));
cmd = parity(value);
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
}
jtag_execute_queue();
- jtag_add_dr_scan(2, fields, jtag_add_end_state(TAP_INVALID));
+ jtag_add_dr_scan(2, fields, jtag_get_end_state());
return ERROR_OK;
}