aboutsummaryrefslogtreecommitdiff
path: root/src/jtag/zy1000/zy1000.c
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2013-11-07 00:40:50 +0100
committerSpencer Oliver <spen@spen-soft.co.uk>2014-01-20 13:28:26 +0000
commit63fa73169bd88258ef82f709e79769eacc50f793 (patch)
tree5f259281041de2aa5d7097db46a64d4175279a96 /src/jtag/zy1000/zy1000.c
parent87e91f4db9bea66a7866261130c6152c0304bc29 (diff)
Retire jtag_add_dr_out
The out only version of jtag_add_dr_scan smells like a bogus optimization that complicates the minidriver API for questionable gain. The function was only used by four old ARM targets. Rewrite the callers to use the generic function and remove all implementations. Change-Id: I13b643687ee8ed6bc9b6336e7096c34f40ea96af Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1801 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/jtag/zy1000/zy1000.c')
-rw-r--r--src/jtag/zy1000/zy1000.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c
index bcf46387..16c3e5d0 100644
--- a/src/jtag/zy1000/zy1000.c
+++ b/src/jtag/zy1000/zy1000.c
@@ -631,16 +631,6 @@ static void jtag_pre_post_bits(struct jtag_tap *tap, int *pre, int *post)
*post = post_bits;
}
-#if 0
-static const int embeddedice_num_bits[] = {32, 6};
- uint32_t values[2];
-
- values[0] = value;
- values[1] = (1 << 5) | reg_addr;
-
- jtag_add_dr_out(tap, 2, embeddedice_num_bits, values, TAP_IDLE);
-#endif
-
void embeddedice_write_dcc(struct jtag_tap *tap,
int reg_addr,
const uint8_t *buffer,
@@ -700,8 +690,7 @@ int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap,
uint32_t, const uint32_t *, size_t);
return arm11_run_instr_data_to_core_noack_inner_default(tap, opcode, data, count);
} else {
- static const int bits[] = {32, 2};
- uint32_t values[] = {0, 0};
+ static const uint8_t zero;
/* FIX!!!!!! the target_write_memory() API started this nasty problem
* with unaligned uint32_t * pointers... */
@@ -710,7 +699,7 @@ int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap,
while (--count > 0) {
#if 1
/* Danger! This code doesn't update cmd_queue_cur_state, so
- * invoking jtag_add_pathmove() before jtag_add_dr_out() after
+ * invoking jtag_add_pathmove() before jtag_add_dr_scan() after
* this loop would fail!
*/
shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, pre_bits, 0);
@@ -750,15 +739,15 @@ int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap,
TAP_DRSELECT, TAP_DRCAPTURE, TAP_DRSHIFT
};
- values[0] = *t++;
- values[0] |= (*t++<<8);
- values[0] |= (*t++<<16);
- values[0] |= (*t++<<24);
+ struct scan_field fields[2] = {
+ { .num_bits = 32, .out_value = t },
+ { .num_bits = 2, .out_value = &zero },
+ };
+ t += 4;
- jtag_add_dr_out(tap,
+ jtag_add_dr_scan(tap,
2,
- bits,
- values,
+ fields,
TAP_IDLE);
jtag_add_pathmove(ARRAY_SIZE(arm11_MOVE_DRPAUSE_IDLE_DRPAUSE_with_delay),
@@ -766,18 +755,17 @@ int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap,
#endif
}
- values[0] = *t++;
- values[0] |= (*t++<<8);
- values[0] |= (*t++<<16);
- values[0] |= (*t++<<24);
+ struct scan_field fields[2] = {
+ { .num_bits = 32, .out_value = t },
+ { .num_bits = 2, .out_value = &zero },
+ };
/* This will happen on the last iteration updating cmd_queue_cur_state
* so we don't have to track it during the common code path
*/
- jtag_add_dr_out(tap,
+ jtag_add_dr_scan(tap,
2,
- bits,
- values,
+ fields,
TAP_IDLE);
return jtag_execute_queue();