diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-03-01 20:00:59 +0100 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-03-08 08:12:25 +0100 |
commit | e018c7c1d29e8dabb9b4a90bb9eb3574eb1668bb (patch) | |
tree | e89d52d68c83186556ef6ae3ad6c82032fe26642 /src/pld | |
parent | f7d1be714b91fcc12e56c8fa78c702e75a733019 (diff) | |
download | openocd_libswd-e018c7c1d29e8dabb9b4a90bb9eb3574eb1668bb.tar.gz openocd_libswd-e018c7c1d29e8dabb9b4a90bb9eb3574eb1668bb.tar.bz2 openocd_libswd-e018c7c1d29e8dabb9b4a90bb9eb3574eb1668bb.tar.xz openocd_libswd-e018c7c1d29e8dabb9b4a90bb9eb3574eb1668bb.zip |
jtag: retire tap field
jtag_add_dr/ir_scan() now takes the tap as the first
argument, rather than for each of the fields passed
in.
The code never exercised the path where there was
more than one tap being scanned, who knows if it even
worked.
This simplifies the implementation and reduces clutter
in the calling code.
use jtag_add_ir/dr_plain_scan() for more fancy situations.
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/pld')
-rw-r--r-- | src/pld/virtex2.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index bbf6b667..15685e61 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -35,13 +35,12 @@ static int virtex2_set_instr(struct jtag_tap *tap, uint32_t new_instr) { struct scan_field field; - field.tap = tap; field.num_bits = tap->ir_length; field.out_value = calloc(DIV_ROUND_UP(field.num_bits, 8), 1); buf_set_u32(field.out_value, 0, field.num_bits, new_instr); field.in_value = NULL; - jtag_add_ir_scan(1, &field, jtag_set_end_state(TAP_IDLE)); + jtag_add_ir_scan(tap, 1, &field, jtag_set_end_state(TAP_IDLE)); free(field.out_value); } @@ -59,7 +58,6 @@ static int virtex2_send_32(struct pld_device *pld_device, values = malloc(num_words * 4); - scan_field.tap = virtex2_info->tap; scan_field.num_bits = num_words * 32; scan_field.out_value = values; scan_field.in_value = NULL; @@ -69,7 +67,7 @@ static int virtex2_send_32(struct pld_device *pld_device, virtex2_set_instr(virtex2_info->tap, 0x5); /* CFG_IN */ - jtag_add_dr_scan(1, &scan_field, jtag_set_end_state(TAP_DRPAUSE)); + jtag_add_dr_scan(virtex2_info->tap, 1, &scan_field, jtag_set_end_state(TAP_DRPAUSE)); free(values); @@ -88,7 +86,6 @@ static int virtex2_receive_32(struct pld_device *pld_device, struct virtex2_pld_device *virtex2_info = pld_device->driver_priv; struct scan_field scan_field; - scan_field.tap = virtex2_info->tap; scan_field.num_bits = 32; scan_field.out_value = NULL; scan_field.in_value = NULL; @@ -99,7 +96,7 @@ static int virtex2_receive_32(struct pld_device *pld_device, { scan_field.in_value = (uint8_t *)words; - jtag_add_dr_scan(1, &scan_field, jtag_set_end_state(TAP_DRPAUSE)); + jtag_add_dr_scan(virtex2_info->tap, 1, &scan_field, jtag_set_end_state(TAP_DRPAUSE)); jtag_add_callback(virtexflip32, (jtag_callback_data_t)words); @@ -139,7 +136,6 @@ static int virtex2_load(struct pld_device *pld_device, const char *filename) unsigned int i; struct scan_field field; - field.tap = virtex2_info->tap; field.in_value = NULL; if ((retval = xilinx_read_bit_file(&bit_file, filename)) != ERROR_OK) @@ -159,7 +155,7 @@ static int virtex2_load(struct pld_device *pld_device, const char *filename) field.num_bits = bit_file.length * 8; field.out_value = bit_file.data; - jtag_add_dr_scan(1, &field, jtag_set_end_state(TAP_DRPAUSE)); + jtag_add_dr_scan(virtex2_info->tap, 1, &field, jtag_set_end_state(TAP_DRPAUSE)); jtag_execute_queue(); jtag_add_tlr(); |