From: Øyvind Harboe Date: Thu, 18 Mar 2010 11:07:41 +0000 (+0100) Subject: jtag: retire one instance of jtag_get_end_state() usage X-Git-Tag: v0.5.0-rc1~821^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ec108ff59e23ec32abf1223488ad96dd26205a5b;p=openocd jtag: retire one instance of jtag_get_end_state() usage Less global variables.... Signed-off-by: Øyvind Harboe --- diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index 091b77ab..41443ff2 100644 --- a/src/target/adi_v5_jtag.c +++ b/src/target/adi_v5_jtag.c @@ -88,7 +88,7 @@ int adi_jtag_dp_scan(struct adiv5_dap *swjdp, uint8_t out_addr_buf; jtag_set_end_state(TAP_IDLE); - arm_jtag_set_instr(jtag_info, instr, NULL); + arm_jtag_set_instr(jtag_info, instr, NULL, TAP_IDLE); /* Scan out a read or write operation using some DP or AP register. * For APACC access with any sticky error flag set, this is discarded. @@ -330,10 +330,9 @@ static int jtag_idcode_q_read(struct adiv5_dap *dap, int retval; struct scan_field fields[1]; - jtag_set_end_state(TAP_IDLE); - /* This is a standard JTAG operation -- no DAP tweakage */ - retval = arm_jtag_set_instr(jtag_info, JTAG_DP_IDCODE, NULL); + 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; diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 71d4a017..6e72c7a7 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -55,11 +55,11 @@ 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)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_DRPAUSE)) != ERROR_OK) { return retval; } - if ((retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL)) != ERROR_OK) + if ((retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE)) != ERROR_OK) { return retval; } diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index c6a08cf1..85c68163 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -690,9 +690,9 @@ int arm7_9_execute_sys_speed(struct target *target) 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); + arm_jtag_set_instr(jtag_info, 0xf, NULL, TAP_IDLE); } - arm_jtag_set_instr(jtag_info, 0x4, NULL); + arm_jtag_set_instr(jtag_info, 0x4, NULL, TAP_IDLE); long long then = timeval_ms(); int timeout; @@ -743,9 +743,9 @@ int arm7_9_execute_fast_sys_speed(struct target *target) 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); + arm_jtag_set_instr(jtag_info, 0xf, NULL, TAP_IDLE); } - arm_jtag_set_instr(jtag_info, 0x4, NULL); + arm_jtag_set_instr(jtag_info, 0x4, NULL, TAP_IDLE); if (!set) { @@ -1746,9 +1746,9 @@ int arm7_9_restart_core(struct target *target) 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); + arm_jtag_set_instr(jtag_info, 0xf, NULL, TAP_IDLE); } - arm_jtag_set_instr(jtag_info, 0x4, NULL); + arm_jtag_set_instr(jtag_info, 0x4, NULL, TAP_IDLE); jtag_add_runtest(1, TAP_IDLE); return jtag_execute_queue(); diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c index 2d6d68f6..25151ff4 100644 --- a/src/target/arm7tdmi.c +++ b/src/target/arm7tdmi.c @@ -66,11 +66,11 @@ static int arm7tdmi_examine_debug_reason(struct target *target) fields[1].out_value = NULL; fields[1].in_value = databus; - if ((retval = arm_jtag_scann(&arm7_9->jtag_info, 0x1)) != ERROR_OK) + if ((retval = arm_jtag_scann(&arm7_9->jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(&arm7_9->jtag_info, arm7_9->jtag_info.intest_instr, NULL); + arm_jtag_set_instr(&arm7_9->jtag_info, arm7_9->jtag_info.intest_instr, NULL, TAP_DRPAUSE); jtag_add_dr_scan(arm7_9->jtag_info.tap, 2, fields, TAP_DRPAUSE); if ((retval = jtag_execute_queue()) != ERROR_OK) @@ -120,8 +120,8 @@ 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); - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE); return arm7tdmi_clock_out_inner(jtag_info, out, breakpoint); } @@ -133,11 +133,11 @@ static int arm7tdmi_clock_data_in(struct arm_jtag *jtag_info, uint32_t *in) struct scan_field fields[2]; jtag_set_end_state(TAP_DRPAUSE); - if ((retval = arm_jtag_scann(jtag_info, 0x1)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE); fields[0].num_bits = 1; fields[0].out_value = NULL; @@ -218,11 +218,11 @@ static int arm7tdmi_clock_data_in_endianness(struct arm_jtag *jtag_info, struct scan_field fields[2]; jtag_set_end_state(TAP_DRPAUSE); - if ((retval = arm_jtag_scann(jtag_info, 0x1)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE); fields[0].num_bits = 1; fields[0].out_value = NULL; diff --git a/src/target/arm920t.c b/src/target/arm920t.c index 68d3997c..2e7c72db 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -92,8 +92,8 @@ 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); - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_scann(jtag_info, 0xf, TAP_IDLE); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 1; fields[0].out_value = &access_type_buf; @@ -143,8 +143,8 @@ 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); - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_scann(jtag_info, 0xf, TAP_IDLE); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 1; fields[0].out_value = &access_type_buf; @@ -193,8 +193,8 @@ 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); - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_scann(jtag_info, 0xf, TAP_IDLE); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); buf_set_u32(cp15_opcode_buf, 0, 32, cp15_opcode); diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index ea951e55..c45d9840 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -64,11 +64,11 @@ 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)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 32; fields[0].out_value = NULL; @@ -121,7 +121,7 @@ static int arm926ejs_cp15_read(struct target *target, uint32_t op1, uint32_t op2 LOG_DEBUG("addr: 0x%x value: %8.8x", address, *value); #endif - arm_jtag_set_instr(jtag_info, 0xc, NULL); + arm_jtag_set_instr(jtag_info, 0xc, NULL, TAP_IDLE); return ERROR_OK; } @@ -153,11 +153,11 @@ static int arm926ejs_cp15_write(struct target *target, uint32_t op1, uint32_t op buf_set_u32(value_buf, 0, 32, value); jtag_set_end_state(TAP_IDLE); - if ((retval = arm_jtag_scann(jtag_info, 0xf)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 32; fields[0].out_value = value_buf; @@ -207,7 +207,7 @@ static int arm926ejs_cp15_write(struct target *target, uint32_t op1, uint32_t op LOG_DEBUG("addr: 0x%x value: %8.8x", address, value); #endif - arm_jtag_set_instr(jtag_info, 0xf, NULL); + arm_jtag_set_instr(jtag_info, 0xf, NULL, TAP_IDLE); return ERROR_OK; } diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 67678c14..c1e80582 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -85,11 +85,11 @@ static int arm966e_read_cp15(struct target *target, int reg_addr, uint32_t *valu uint8_t nr_w_buf = 0; jtag_set_end_state(TAP_IDLE); - if ((retval = arm_jtag_scann(jtag_info, 0xf)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 32; /* REVISIT: table 7-2 shows that bits 31-31 need to be @@ -140,11 +140,11 @@ 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)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 32; fields[0].out_value = value_buf; diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index f0911880..b4b6f04a 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -101,11 +101,11 @@ int arm9tdmi_examine_debug_reason(struct target *target) fields[2].out_value = NULL; fields[2].in_value = instructionbus; - if ((retval = arm_jtag_scann(&arm7_9->jtag_info, 0x1)) != ERROR_OK) + if ((retval = arm_jtag_scann(&arm7_9->jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(&arm7_9->jtag_info, arm7_9->jtag_info.intest_instr, NULL); + arm_jtag_set_instr(&arm7_9->jtag_info, arm7_9->jtag_info.intest_instr, NULL, TAP_DRPAUSE); jtag_add_dr_scan(arm7_9->jtag_info.tap, 3, fields, TAP_DRPAUSE); if ((retval = jtag_execute_queue()) != ERROR_OK) @@ -155,12 +155,12 @@ int arm9tdmi_clock_out(struct arm_jtag *jtag_info, uint32_t instr, buf_set_u32(&sysspeed_buf, 2, 1, 1); jtag_set_end_state(TAP_DRPAUSE); - if ((retval = arm_jtag_scann(jtag_info, 0x1)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE); fields[0].num_bits = 32; fields[0].out_value = out_buf; @@ -214,12 +214,12 @@ int arm9tdmi_clock_data_in(struct arm_jtag *jtag_info, uint32_t *in) struct scan_field fields[3]; jtag_set_end_state(TAP_DRPAUSE); - if ((retval = arm_jtag_scann(jtag_info, 0x1)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE); fields[0].num_bits = 32; fields[0].out_value = NULL; @@ -281,12 +281,12 @@ int arm9tdmi_clock_data_in_endianness(struct arm_jtag *jtag_info, struct scan_field fields[3]; jtag_set_end_state(TAP_DRPAUSE); - if ((retval = arm_jtag_scann(jtag_info, 0x1)) != ERROR_OK) + if ((retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE)) != ERROR_OK) { return retval; } - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE); fields[0].num_bits = 32; fields[0].out_value = NULL; diff --git a/src/target/arm_jtag.c b/src/target/arm_jtag.c index 5ed104cf..f8b5f4f4 100644 --- a/src/target/arm_jtag.c +++ b/src/target/arm_jtag.c @@ -31,7 +31,7 @@ #define _ARM_JTAG_SCAN_N_CHECK_ #endif -int arm_jtag_set_instr_inner(struct arm_jtag *jtag_info, uint32_t new_instr, void *no_verify_capture) +int arm_jtag_set_instr_inner(struct arm_jtag *jtag_info, uint32_t new_instr, void *no_verify_capture, tap_state_t end_state) { struct jtag_tap *tap; tap = jtag_info->tap; @@ -45,19 +45,19 @@ int arm_jtag_set_instr_inner(struct arm_jtag *jtag_info, uint32_t new_instr, vo if (no_verify_capture == NULL) { - jtag_add_ir_scan(tap, &field, jtag_get_end_state()); + jtag_add_ir_scan(tap, &field, 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(tap, &field, jtag_get_end_state()); + jtag_add_ir_scan_noverify(tap, &field, end_state); } return ERROR_OK; } -int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain) +int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain, tap_state_t end_state) { int retval = ERROR_OK; uint32_t values[1]; @@ -66,7 +66,7 @@ int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain) values[0]=new_scan_chain; num_bits[0]=jtag_info->scann_size; - if ((retval = arm_jtag_set_instr(jtag_info, jtag_info->scann_instr, NULL)) != ERROR_OK) + if ((retval = arm_jtag_set_instr(jtag_info, jtag_info->scann_instr, NULL, end_state)) != ERROR_OK) { return retval; } @@ -75,7 +75,7 @@ int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain) 1, num_bits, values, - jtag_get_end_state()); + end_state); jtag_info->cur_scan_chain = new_scan_chain; diff --git a/src/target/arm_jtag.h b/src/target/arm_jtag.h index cf230b43..37c228f8 100644 --- a/src/target/arm_jtag.h +++ b/src/target/arm_jtag.h @@ -2,7 +2,7 @@ * Copyright (C) 2005 by Dominic Rath * * Dominic.Rath@gmx.de * * * - * Copyright (C) 2007,2008 Øyvind Harboe * + * Copyright (C) 2007-2010 Øyvind Harboe * * oyvind.harboe@zylin.com * * * * This program is free software; you can redistribute it and/or modify * @@ -36,9 +36,11 @@ struct arm_jtag uint32_t intest_instr; }; -int arm_jtag_set_instr_inner(struct arm_jtag *jtag_info, uint32_t new_instr, void *no_verify_capture); +int arm_jtag_set_instr_inner(struct arm_jtag *jtag_info, uint32_t new_instr, + void *no_verify_capture, + tap_state_t end_state); static inline int arm_jtag_set_instr(struct arm_jtag *jtag_info, - uint32_t new_instr, void *no_verify_capture) + uint32_t new_instr, void *no_verify_capture, tap_state_t end_state) { /* inline most common code path */ struct jtag_tap *tap; @@ -48,7 +50,7 @@ static inline int arm_jtag_set_instr(struct arm_jtag *jtag_info, if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr) { - return arm_jtag_set_instr_inner(jtag_info, new_instr, no_verify_capture); + return arm_jtag_set_instr_inner(jtag_info, new_instr, no_verify_capture, end_state); } return ERROR_OK; @@ -56,14 +58,14 @@ static inline int arm_jtag_set_instr(struct arm_jtag *jtag_info, } -int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain); -static inline int arm_jtag_scann(struct arm_jtag *jtag_info, uint32_t new_scan_chain) +int arm_jtag_scann_inner(struct arm_jtag *jtag_info, uint32_t new_scan_chain, tap_state_t end_state); +static inline int arm_jtag_scann(struct arm_jtag *jtag_info, uint32_t new_scan_chain, tap_state_t end_state) { /* inline most common code path */ int retval = ERROR_OK; if (jtag_info->cur_scan_chain != new_scan_chain) { - return arm_jtag_scann_inner(jtag_info, new_scan_chain); + return arm_jtag_scann_inner(jtag_info, new_scan_chain, end_state); } return retval; diff --git a/src/target/embeddedice.c b/src/target/embeddedice.c index fe266d62..9272f667 100644 --- a/src/target/embeddedice.c +++ b/src/target/embeddedice.c @@ -344,9 +344,9 @@ int embeddedice_read_reg_w_check(struct reg *reg, uint8_t field2_out[1]; jtag_set_end_state(TAP_IDLE); - arm_jtag_scann(ice_reg->jtag_info, 0x2); + 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); + arm_jtag_set_instr(ice_reg->jtag_info, ice_reg->jtag_info->intest_instr, NULL, TAP_IDLE); /* bits 31:0 -- data (ignored here) */ fields[0].num_bits = 32; @@ -406,8 +406,8 @@ int embeddedice_receive(struct arm_jtag *jtag_info, uint32_t *data, uint32_t siz uint8_t field2_out[1]; jtag_set_end_state(TAP_IDLE); - arm_jtag_scann(jtag_info, 0x2); - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_scann(jtag_info, 0x2, TAP_IDLE); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 32; fields[0].out_value = NULL; @@ -491,9 +491,9 @@ 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); + 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); + arm_jtag_set_instr(ice_reg->jtag_info, ice_reg->jtag_info->intest_instr, NULL, TAP_IDLE); uint8_t reg_addr = ice_reg->addr & 0x1f; embeddedice_write_reg_inner(ice_reg->jtag_info->tap, reg_addr, value); @@ -524,8 +524,8 @@ int embeddedice_send(struct arm_jtag *jtag_info, uint32_t *data, uint32_t size) uint8_t field2_out[1]; jtag_set_end_state(TAP_IDLE); - arm_jtag_scann(jtag_info, 0x2); - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_scann(jtag_info, 0x2, TAP_IDLE); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 32; fields[0].out_value = field0_out; @@ -577,8 +577,8 @@ int embeddedice_handshake(struct arm_jtag *jtag_info, int hsbit, uint32_t timeou return ERROR_INVALID_ARGUMENTS; jtag_set_end_state(TAP_IDLE); - arm_jtag_scann(jtag_info, 0x2); - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_scann(jtag_info, 0x2, TAP_IDLE); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE); fields[0].num_bits = 32; fields[0].out_value = NULL; diff --git a/src/target/etm.c b/src/target/etm.c index a1c77b0f..3c25f4e8 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -505,8 +505,8 @@ 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); - arm_jtag_set_instr(etm_reg->jtag_info, etm_reg->jtag_info->intest_instr, NULL); + 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); fields[0].num_bits = 32; fields[0].out_value = reg->value; @@ -588,8 +588,8 @@ 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); - arm_jtag_set_instr(etm_reg->jtag_info, etm_reg->jtag_info->intest_instr, NULL); + 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); fields[0].num_bits = 32; uint8_t tmp1[4]; diff --git a/src/target/feroceon.c b/src/target/feroceon.c index 22ddb557..405c50c0 100644 --- a/src/target/feroceon.c +++ b/src/target/feroceon.c @@ -85,9 +85,9 @@ 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); + arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE); - arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL); + arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE); fields[0].num_bits = 32; fields[0].out_value = out_buf;