aboutsummaryrefslogtreecommitdiff
path: root/src/target/embeddedice.h
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/target/embeddedice.h
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/target/embeddedice.h')
-rw-r--r--src/target/embeddedice.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/target/embeddedice.h b/src/target/embeddedice.h
index af28d38f..f110e82e 100644
--- a/src/target/embeddedice.h
+++ b/src/target/embeddedice.h
@@ -112,13 +112,16 @@ int embeddedice_handshake(struct arm_jtag *jtag_info, int hsbit, uint32_t timeou
*/
static inline void embeddedice_write_reg_inner(struct jtag_tap *tap, int reg_addr, uint32_t value)
{
- static const int embeddedice_num_bits[] = {32, 6};
- uint32_t values[2];
+ uint8_t out_reg_addr = (1 << 5) | reg_addr;
+ uint8_t out_value[4];
+ buf_set_u32(out_value, 0, 32, value);
- values[0] = value;
- values[1] = (1 << 5) | reg_addr;
+ struct scan_field fields[2] = {
+ { .num_bits = 32, .out_value = out_value },
+ { .num_bits = 6, .out_value = &out_reg_addr },
+ };
- jtag_add_dr_out(tap, 2, embeddedice_num_bits, values, TAP_IDLE);
+ jtag_add_dr_scan(tap, 2, fields, TAP_IDLE);
}
void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, const uint8_t *buffer,