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/jtag/tcl.c | |
parent | f7d1be714b91fcc12e56c8fa78c702e75a733019 (diff) | |
download | riscv-openocd-e018c7c1d29e8dabb9b4a90bb9eb3574eb1668bb.zip riscv-openocd-e018c7c1d29e8dabb9b4a90bb9eb3574eb1668bb.tar.gz riscv-openocd-e018c7c1d29e8dabb9b4a90bb9eb3574eb1668bb.tar.bz2 |
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/jtag/tcl.c')
-rw-r--r-- | src/jtag/tcl.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index ffb5d27..da01f81 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -175,7 +175,6 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args Jim_GetLong(interp, args[i], &bits); str = Jim_GetString(args[i + 1], &len); - fields[field_count].tap = tap; fields[field_count].num_bits = bits; fields[field_count].out_value = malloc(DIV_ROUND_UP(bits, 8)); str_to_buf(str, len, fields[field_count].out_value, bits, 0); @@ -183,7 +182,7 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args field_count++; } - jtag_add_dr_scan(num_fields, fields, endstate); + jtag_add_dr_scan(tap, num_fields, fields, endstate); retval = jtag_execute_queue(); if (retval != ERROR_OK) @@ -1462,7 +1461,7 @@ COMMAND_HANDLER(handle_irscan_command) { int i; struct scan_field *fields; - struct jtag_tap *tap; + struct jtag_tap *tap = NULL; tap_state_t endstate; if ((CMD_ARGC < 2) || (CMD_ARGC % 2)) @@ -1510,7 +1509,6 @@ COMMAND_HANDLER(handle_irscan_command) return ERROR_FAIL; } int field_size = tap->ir_length; - fields[i].tap = tap; fields[i].num_bits = field_size; fields[i].out_value = malloc(DIV_ROUND_UP(field_size, 8)); @@ -1523,7 +1521,7 @@ COMMAND_HANDLER(handle_irscan_command) } /* did we have an endstate? */ - jtag_add_ir_scan(num_fields, fields, endstate); + jtag_add_ir_scan(tap, num_fields, fields, endstate); retval = jtag_execute_queue(); |