static unsigned jtag_num_taps = 0;
static enum reset_types jtag_reset_config = RESET_NONE;
-static tap_state_t cmd_queue_end_state = TAP_RESET;
tap_state_t cmd_queue_cur_state = TAP_RESET;
static bool jtag_verify_capture_ir = true;
*/
if (trst_with_tlr) {
LOG_DEBUG("JTAG reset with TLR instead of TRST");
- jtag_set_end_state(TAP_RESET);
jtag_add_tlr();
} else if (jtag_trst != new_trst) {
}
}
-/* DEPRECATED! store such global state outside JTAG layer */
-void jtag_set_end_state(tap_state_t state)
-{
- if ((state == TAP_DRSHIFT)||(state == TAP_IRSHIFT))
- {
- LOG_ERROR("BUG: TAP_DRSHIFT/IRSHIFT can't be end state. Calling code should use a larger scan field");
- }
-
- if (state != TAP_INVALID)
- cmd_queue_end_state = state;
-}
-
-/* DEPRECATED! store such global state outside JTAG layer */
-tap_state_t jtag_get_end_state(void)
-{
- return cmd_queue_end_state;
-}
-
void jtag_add_sleep(uint32_t us)
{
/// @todo Here, keep_alive() appears to be a layering violation!!!
*/
void jtag_add_reset(int req_tlr_or_trst, int srst);
-
-/**
- * DEPRECATED! store such global state outside JTAG layer
- *
- * Function jtag_set_end_state
- *
- * Set a global variable to \a state if \a state != TAP_INVALID.
- *
- */
-void jtag_set_end_state(tap_state_t state);
-
-/**
- * DEPRECATED! store such global state outside JTAG layer
- *
- * Function jtag_get_end_state
- *
- * Return the value of the global variable for end state
- */
-tap_state_t jtag_get_end_state(void);
-
void jtag_add_sleep(uint32_t us);
int jtag_add_tms_seq(unsigned nbits, const uint8_t *seq, enum tap_state t);
if ((retval = xilinx_read_bit_file(&bit_file, filename)) != ERROR_OK)
return retval;
- jtag_set_end_state(TAP_IDLE);
virtex2_set_instr(virtex2_info->tap, 0xb); /* JPROG_B */
jtag_execute_queue();
jtag_add_sleep(1000);
jtag_add_tlr();
- jtag_set_end_state(TAP_IDLE);
virtex2_set_instr(virtex2_info->tap, 0xc); /* JSTART */
jtag_add_runtest(13, TAP_IDLE);
virtex2_set_instr(virtex2_info->tap, 0x3f); /* BYPASS */
struct scan_field fields[2];
uint8_t out_addr_buf;
- jtag_set_end_state(TAP_IDLE);
arm_jtag_set_instr(jtag_info, instr, NULL, TAP_IDLE);
/* Scan out a read or write operation using some DP or AP register.
struct scan_field fields[1];
/* This is a standard JTAG operation -- no DAP tweakage */
- jtag_set_end_state(TAP_IDLE);
retval = arm_jtag_set_instr(jtag_info, JTAG_DP_IDCODE, NULL, TAP_IDLE);
if (retval != ERROR_OK)
return retval;
buf_set_u32(out_buf, 0, 32, flip_u32(out, 32));
- jtag_set_end_state(TAP_DRPAUSE);
if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_DRPAUSE)) != ERROR_OK)
{
return retval;
struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
/* set RESTART instruction */
- jtag_set_end_state(TAP_IDLE);
if (arm7_9->need_bypass_before_restart) {
arm7_9->need_bypass_before_restart = 0;
arm_jtag_set_instr(jtag_info, 0xf, NULL, TAP_IDLE);
struct reg *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
/* set RESTART instruction */
- jtag_set_end_state(TAP_IDLE);
if (arm7_9->need_bypass_before_restart) {
arm7_9->need_bypass_before_restart = 0;
arm_jtag_set_instr(jtag_info, 0xf, NULL, TAP_IDLE);
struct arm_jtag *jtag_info = &arm7_9->jtag_info;
/* set RESTART instruction */
- jtag_set_end_state(TAP_IDLE);
if (arm7_9->need_bypass_before_restart) {
arm7_9->need_bypass_before_restart = 0;
arm_jtag_set_instr(jtag_info, 0xf, NULL, TAP_IDLE);
uint8_t databus[4];
uint8_t breakpoint;
- jtag_set_end_state(TAP_DRPAUSE);
-
fields[0].num_bits = 1;
fields[0].out_value = NULL;
fields[0].in_value = &breakpoint;
static __inline int arm7tdmi_clock_out(struct arm_jtag *jtag_info,
uint32_t out, uint32_t *deprecated, int breakpoint)
{
- jtag_set_end_state(TAP_DRPAUSE);
arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE);
arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE);
int retval = ERROR_OK;
struct scan_field fields[2];
- jtag_set_end_state(TAP_DRPAUSE);
if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK)
{
return retval;
int retval = ERROR_OK;
struct scan_field fields[2];
- jtag_set_end_state(TAP_DRPAUSE);
if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK)
{
return retval;
jtag_info = &arm920t->arm7_9_common.jtag_info;
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
buf_set_u32(value_buf, 0, 32, value);
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
jtag_info = &arm920t->arm7_9_common.jtag_info;
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
buf_set_u32(address_buf, 0, 14, address);
- jtag_set_end_state(TAP_IDLE);
if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE)) != ERROR_OK)
{
return retval;
buf_set_u32(address_buf, 0, 14, address);
buf_set_u32(value_buf, 0, 32, value);
- jtag_set_end_state(TAP_IDLE);
if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE)) != ERROR_OK)
{
return retval;
uint8_t reg_addr_buf = reg_addr & 0x3f;
uint8_t nr_w_buf = 0;
- jtag_set_end_state(TAP_IDLE);
if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE)) != ERROR_OK)
{
return retval;
buf_set_u32(value_buf, 0, 32, value);
- jtag_set_end_state(TAP_IDLE);
if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE)) != ERROR_OK)
{
return retval;
uint8_t instructionbus[4];
uint8_t debug_reason;
- jtag_set_end_state(TAP_DRPAUSE);
-
fields[0].num_bits = 32;
fields[0].out_value = NULL;
fields[0].in_value = databus;
if (sysspeed)
buf_set_u32(&sysspeed_buf, 2, 1, 1);
- jtag_set_end_state(TAP_DRPAUSE);
if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK)
{
return retval;
int retval = ERROR_OK;;
struct scan_field fields[3];
- jtag_set_end_state(TAP_DRPAUSE);
if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK)
{
return retval;
int retval = ERROR_OK;
struct scan_field fields[3];
- jtag_set_end_state(TAP_DRPAUSE);
if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK)
{
return retval;
uint8_t field1_out[1];
uint8_t field2_out[1];
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(ice_reg->jtag_info, 0x2, TAP_IDLE);
arm_jtag_set_instr(ice_reg->jtag_info, ice_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
uint8_t field1_out[1];
uint8_t field2_out[1];
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
LOG_DEBUG("%i: 0x%8.8" PRIx32 "", ice_reg->addr, value);
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(ice_reg->jtag_info, 0x2, TAP_IDLE);
arm_jtag_set_instr(ice_reg->jtag_info, ice_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
uint8_t field1_out[1];
uint8_t field2_out[1];
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
else
return ERROR_INVALID_ARGUMENTS;
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
struct scan_field fields[3];
int i;
- jtag_set_end_state(TAP_IDLE);
etb_scann(etb, 0x0);
etb_set_instr(etb, 0xc);
LOG_DEBUG("%i", (int)(etb_reg->addr));
- jtag_set_end_state(TAP_IDLE);
etb_scann(etb_reg->etb, 0x0);
etb_set_instr(etb_reg->etb, 0xc);
LOG_DEBUG("%i: 0x%8.8" PRIx32 "", (int)(etb_reg->addr), value);
- jtag_set_end_state(TAP_IDLE);
etb_scann(etb_reg->etb, 0x0);
etb_set_instr(etb_reg->etb, 0xc);
LOG_DEBUG("%s (%u)", r->name, reg_addr);
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(etm_reg->jtag_info, 0x6, TAP_IDLE);
arm_jtag_set_instr(etm_reg->jtag_info, etm_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
LOG_DEBUG("%s (%u): 0x%8.8" PRIx32 "", r->name, reg_addr, value);
- jtag_set_end_state(TAP_IDLE);
arm_jtag_scann(etm_reg->jtag_info, 0x6, TAP_IDLE);
arm_jtag_set_instr(etm_reg->jtag_info, etm_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
buf_set_u32(instr_buf, 0, 32, flip_u32(instr, 32));
- jtag_set_end_state(TAP_DRPAUSE);
arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE);
arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE);
{
struct scan_field field;
- jtag_set_end_state(TAP_IDLE);
-
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_IDCODE);
field.num_bits = 32;
{
struct scan_field field;
- jtag_set_end_state(TAP_IDLE);
-
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_IMPCODE);
field.num_bits = 32;
int mips_ejtag_enter_debug(struct mips_ejtag *ejtag_info)
{
uint32_t ejtag_ctrl;
- jtag_set_end_state(TAP_IDLE);
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL);
/* set debug break bit */
uint32_t ejtag_ctrl = ejtag_info->ejtag_ctrl;
/* read ejtag control reg */
- jtag_set_end_state(TAP_IDLE);
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL);
mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
{
/* we have detected a reset, clear flag
* otherwise ejtag will not work */
- jtag_set_end_state(TAP_IDLE);
ejtag_ctrl = ejtag_info->ejtag_ctrl & ~EJTAG_CTRL_ROCC;
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL);
{
if ((target->state == TARGET_RUNNING) || (target->state == TARGET_RESET))
{
- jtag_set_end_state(TAP_IDLE);
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_NORMALBOOT);
target->state = TARGET_HALTED;
if (target->reset_halt)
{
/* use hardware to catch reset */
- jtag_set_end_state(TAP_IDLE);
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_EJTAGBOOT);
}
else
{
- jtag_set_end_state(TAP_IDLE);
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_NORMALBOOT);
}
uint8_t field2_check_value = 0x0;
uint8_t field2_check_mask = 0x1;
- jtag_set_end_state(TAP_DRPAUSE);
xscale_jtag_set_instr(target->tap,
XSCALE_SELDCSR << xscale->xscale_variant,
TAP_DRPAUSE);
fields[1].out_value = xscale->reg_cache->reg_list[XSCALE_DCSR].value;
fields[1].in_value = NULL;
- jtag_set_end_state(TAP_IDLE);
-
jtag_add_dr_scan(target->tap, 3, fields, TAP_DRPAUSE);
/* DANGER!!! this must be here. It will make sure that the arguments
fields[2].check_value = &field2_check_value;
fields[2].check_mask = &field2_check_mask;
- jtag_set_end_state(TAP_IDLE);
xscale_jtag_set_instr(target->tap,
XSCALE_DBGTX << xscale->xscale_variant,
TAP_IDLE);
uint8_t field2_check_value = 0x0;
uint8_t field2_check_mask = 0x1;
- jtag_set_end_state(TAP_IDLE);
-
xscale_jtag_set_instr(target->tap,
XSCALE_DBGTX << xscale->xscale_variant,
TAP_IDLE);
uint8_t field2_check_value = 0x0;
uint8_t field2_check_mask = 0x1;
- jtag_set_end_state(TAP_IDLE);
-
xscale_jtag_set_instr(target->tap,
XSCALE_DBGRX << xscale->xscale_variant,
TAP_IDLE);
int retval;
int done_count = 0;
- jtag_set_end_state(TAP_IDLE);
-
xscale_jtag_set_instr(target->tap,
XSCALE_DBGRX << xscale->xscale_variant,
TAP_IDLE);
if (ext_dbg_brk != -1)
xscale->external_debug_break = ext_dbg_brk;
- jtag_set_end_state(TAP_IDLE);
xscale_jtag_set_instr(target->tap,
XSCALE_SELDCSR << xscale->xscale_variant,
TAP_IDLE);
LOG_DEBUG("loading miniIC at 0x%8.8" PRIx32 "", va);
/* LDIC into IR */
- jtag_set_end_state(TAP_IDLE);
xscale_jtag_set_instr(target->tap,
XSCALE_LDIC << xscale->xscale_variant,
TAP_IDLE);
uint8_t cmd;
struct scan_field fields[2];
- jtag_set_end_state(TAP_IDLE);
xscale_jtag_set_instr(target->tap,
XSCALE_LDIC << xscale->xscale_variant,
TAP_IDLE);
/* select DCSR instruction (set endstate to R-T-I to ensure we don't
* end up in T-L-R, which would reset JTAG
*/
- jtag_set_end_state(TAP_IDLE);
xscale_jtag_set_instr(target->tap,
XSCALE_SELDCSR << xscale->xscale_variant,
TAP_IDLE);