]> git.sur5r.net Git - openocd/commitdiff
jtag: retire jtag_get/set_end_state()
authorØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 18 Mar 2010 17:53:39 +0000 (18:53 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Fri, 19 Mar 2010 07:31:44 +0000 (08:31 +0100)
Voila! This get rids of mysteries about what what
state the TAP is in.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
18 files changed:
src/jtag/core.c
src/jtag/jtag.h
src/pld/virtex2.c
src/target/adi_v5_jtag.c
src/target/arm720t.c
src/target/arm7_9_common.c
src/target/arm7tdmi.c
src/target/arm920t.c
src/target/arm926ejs.c
src/target/arm966e.c
src/target/arm9tdmi.c
src/target/embeddedice.c
src/target/etb.c
src/target/etm.c
src/target/feroceon.c
src/target/mips_ejtag.c
src/target/mips_m4k.c
src/target/xscale.c

index a09472a76c0133a5c6fc2784da75bb54d3ccf80c..65ca8245773ed1d25a57a7e9bfdf319461f63f05 100644 (file)
@@ -86,7 +86,6 @@ static struct jtag_tap *__jtag_all_taps = NULL;
 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;
@@ -717,7 +716,6 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
         */
        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) {
@@ -743,24 +741,6 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
        }
 }
 
-/* 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!!!
index a92c986d1107ef40b37efdbfb020f5f0aace7cc0..a6d16e932e59f5479e5c8148c1476ed3c1a97c68 100644 (file)
@@ -550,26 +550,6 @@ void jtag_add_runtest(int num_cycles, tap_state_t endstate);
  */
 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);
index 93509dec1cd8ec06eb3a8fd4cac132409d8dab7c..b2833fae1d48ac30c95b30eeee8120470823f0bb 100644 (file)
@@ -141,7 +141,6 @@ static int virtex2_load(struct pld_device *pld_device, const char *filename)
        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);
@@ -160,7 +159,6 @@ static int virtex2_load(struct pld_device *pld_device, const char *filename)
 
        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 */
index d59465bee04e7509e390465efeaedb89785e2657..0d795fb4871a0cc8fc180852c54671095a7521c3 100644 (file)
@@ -87,7 +87,6 @@ int adi_jtag_dp_scan(struct adiv5_dap *dap,
        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.
@@ -331,7 +330,6 @@ static int jtag_idcode_q_read(struct adiv5_dap *dap,
        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;
index 6e72c7a704b36722e45bd9a402c83ede140323b7..009336082135dfdea6b72ea9e10e762ff654a9c9 100644 (file)
@@ -54,7 +54,6 @@ static int arm720t_scan_cp15(struct target *target,
 
        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;
index 4c8d83d66461f37b0f741fefca9fb61c8306c903..8f63f3c0ae547cb24845720a1a0daf93a8061995 100644 (file)
@@ -687,7 +687,6 @@ int arm7_9_execute_sys_speed(struct target *target)
        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);
@@ -740,7 +739,6 @@ int arm7_9_execute_fast_sys_speed(struct target *target)
        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);
@@ -1743,7 +1741,6 @@ int arm7_9_restart_core(struct target *target)
        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);
index f14527510f1f83b8e0af1454933d87b7ef991ae9..541adc8ed94206525d673fed80684fa555035bed 100644 (file)
@@ -56,8 +56,6 @@ static int arm7tdmi_examine_debug_reason(struct target *target)
                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;
@@ -119,7 +117,6 @@ static __inline int arm7tdmi_clock_out_inner(struct arm_jtag *jtag_info, uint32_
 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);
 
@@ -132,7 +129,6 @@ static int arm7tdmi_clock_data_in(struct arm_jtag *jtag_info, uint32_t *in)
        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;
@@ -217,7 +213,6 @@ static int arm7tdmi_clock_data_in_endianness(struct arm_jtag *jtag_info,
        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;
index 2e7c72db1a90740db69d480e01cce13e8b6534c5..4916de1da02480f2a0f72cb7bbba9072cc1359d2 100644 (file)
@@ -91,7 +91,6 @@ static int arm920t_read_cp15_physical(struct target *target,
 
        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);
 
@@ -142,7 +141,6 @@ static int arm920t_write_cp15_physical(struct target *target,
 
        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);
 
@@ -192,7 +190,6 @@ static int arm920t_execute_cp15(struct target *target, uint32_t cp15_opcode,
 
        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);
 
index c45d98407ab3aab1e960034c083131a897039d4e..ff18bae825861ec8bf4417da71a8907233ac7551 100644 (file)
@@ -63,7 +63,6 @@ static int arm926ejs_cp15_read(struct target *target, uint32_t op1, uint32_t op2
 
        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;
@@ -152,7 +151,6 @@ static int arm926ejs_cp15_write(struct target *target, uint32_t op1, uint32_t op
        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;
index c1e80582bf21488608f6bae8562c0491f8850079..b4207c8c15df0e3e4946945b1f10e23bbfb2627f 100644 (file)
@@ -84,7 +84,6 @@ static int arm966e_read_cp15(struct target *target, int reg_addr, uint32_t *valu
        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;
@@ -139,7 +138,6 @@ int arm966e_write_cp15(struct target *target, int reg_addr, uint32_t value)
 
        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;
index 4f28599a525e8f988551ebd940ed4b37b3bb6cc2..744ee7614098c08e5ab1e89183172e8cac85db8b 100644 (file)
@@ -87,8 +87,6 @@ int arm9tdmi_examine_debug_reason(struct target *target)
                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;
@@ -154,7 +152,6 @@ int arm9tdmi_clock_out(struct arm_jtag *jtag_info, uint32_t instr,
        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;
@@ -213,7 +210,6 @@ int arm9tdmi_clock_data_in(struct arm_jtag *jtag_info, uint32_t *in)
        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;
@@ -280,7 +276,6 @@ int arm9tdmi_clock_data_in_endianness(struct arm_jtag *jtag_info,
        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;
index 9272f667c8dd99a5019b25f00d8924fe8b4daf1b..59cd5624f0be07461eaba058718c231cebd5c521 100644 (file)
@@ -343,7 +343,6 @@ int embeddedice_read_reg_w_check(struct reg *reg,
        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);
@@ -405,7 +404,6 @@ int embeddedice_receive(struct arm_jtag *jtag_info, uint32_t *data, uint32_t siz
        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);
 
@@ -490,7 +488,6 @@ void embeddedice_write_reg(struct reg *reg, uint32_t value)
 
        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);
@@ -523,7 +520,6 @@ int embeddedice_send(struct arm_jtag *jtag_info, uint32_t *data, uint32_t size)
        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);
 
@@ -576,7 +572,6 @@ int embeddedice_handshake(struct arm_jtag *jtag_info, int hsbit, uint32_t timeou
        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);
 
index 96a6e0ded102885bba6daf4d07e7afbaac7cee21..32808741929bf9374e39ace2745b07d6949e7cef 100644 (file)
@@ -173,7 +173,6 @@ static int etb_read_ram(struct etb *etb, uint32_t *data, int num_frames)
        struct scan_field fields[3];
        int i;
 
-       jtag_set_end_state(TAP_IDLE);
        etb_scann(etb, 0x0);
        etb_set_instr(etb, 0xc);
 
@@ -227,7 +226,6 @@ static int etb_read_reg_w_check(struct reg *reg,
 
        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);
 
@@ -310,7 +308,6 @@ static int etb_write_reg(struct reg *reg, uint32_t value)
 
        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);
 
index 3c25f4e8373ff33808a98ffa0b9733dc75cbc089..3850ced52dd90ce10145113b92b7cc6b12abb294 100644 (file)
@@ -504,7 +504,6 @@ static int etm_read_reg_w_check(struct reg *reg,
 
        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);
 
@@ -587,7 +586,6 @@ static int etm_write_reg(struct reg *reg, uint32_t value)
 
        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);
 
index 405c50c07faa6c70b0256d4f84c65b2219f93fcc..efd3040a9df4ce7e791abe8652c2c42ab59c024e 100644 (file)
@@ -84,7 +84,6 @@ int feroceon_dummy_clock_out(struct arm_jtag *jtag_info, uint32_t instr)
 
        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);
index d79c58d7b01256152c98f7f336b6437bfc0230d9..37e1f09fc464c45241b415525eeded0cc55a3cc4 100644 (file)
@@ -56,8 +56,6 @@ int mips_ejtag_get_idcode(struct mips_ejtag *ejtag_info, uint32_t *idcode)
 {
        struct scan_field field;
 
-       jtag_set_end_state(TAP_IDLE);
-
        mips_ejtag_set_instr(ejtag_info, EJTAG_INST_IDCODE);
 
        field.num_bits = 32;
@@ -78,8 +76,6 @@ int mips_ejtag_get_impcode(struct mips_ejtag *ejtag_info, uint32_t *impcode)
 {
        struct scan_field field;
 
-       jtag_set_end_state(TAP_IDLE);
-
        mips_ejtag_set_instr(ejtag_info, EJTAG_INST_IMPCODE);
 
        field.num_bits = 32;
@@ -209,7 +205,6 @@ int mips_ejtag_config_step(struct mips_ejtag *ejtag_info, int enable_step)
 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 */
index 5919f5b93ae9482d974fc8694d43505ab9e04ea5..5604b6a55b4360061ecf59d031a0b90ae09beceb 100644 (file)
@@ -112,7 +112,6 @@ int mips_m4k_poll(struct target *target)
        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);
 
@@ -122,7 +121,6 @@ int mips_m4k_poll(struct target *target)
        {
                /* 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);
@@ -135,7 +133,6 @@ int mips_m4k_poll(struct target *target)
        {
                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;
@@ -227,12 +224,10 @@ int mips_m4k_assert_reset(struct target *target)
        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);
        }
 
index f22513a048d568fa628990f75990d2eba4df2d73..f0e2311f905f0c1d4b785815fcfb4bdc5151ba3b 100644 (file)
@@ -191,7 +191,6 @@ static int xscale_read_dcsr(struct target *target)
        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);
@@ -235,8 +234,6 @@ static int xscale_read_dcsr(struct target *target)
        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
@@ -286,7 +283,6 @@ static int xscale_receive(struct target *target, uint32_t *buffer, int num_words
        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);
@@ -369,8 +365,6 @@ static int xscale_read_tx(struct target *target, int consume)
        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);
@@ -466,8 +460,6 @@ static int xscale_write_rx(struct target *target)
        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);
@@ -545,8 +537,6 @@ static int xscale_send(struct target *target, uint8_t *buffer, int count, int si
        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);
@@ -629,7 +619,6 @@ static int xscale_write_dcsr(struct target *target, int hold_rst, int ext_dbg_br
        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);
@@ -692,7 +681,6 @@ static int xscale_load_ic(struct target *target, uint32_t va, uint32_t buffer[8]
        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);
@@ -744,7 +732,6 @@ static int xscale_invalidate_ic_line(struct target *target, uint32_t va)
        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);
@@ -1484,7 +1471,6 @@ static int xscale_assert_reset(struct target *target)
        /* 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);