diff options
Diffstat (limited to 'src/jtag')
-rw-r--r-- | src/jtag/jtag.c | 19 | ||||
-rw-r--r-- | src/jtag/jtag.h | 6 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 73acb6a0..fe9d4e1d 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -625,13 +625,14 @@ int MINIDRIVER(interface_jtag_add_dr_scan)(int num_fields, scan_field_t *fields, } if (!found) { +#ifdef _DEBUG_JTAG_IO_ /* if a device isn't listed, the BYPASS register should be selected */ if (!jtag_get_device(i)->bypass) { ERROR("BUG: no scan data for a device not in BYPASS"); exit(-1); } - +#endif /* program the scan field to 1 bit length, and ignore it's value */ (*last_cmd)->cmd.scan->fields[field_count].num_bits = 1; (*last_cmd)->cmd.scan->fields[field_count].out_value = NULL; @@ -644,11 +645,13 @@ int MINIDRIVER(interface_jtag_add_dr_scan)(int num_fields, scan_field_t *fields, } else { +#ifdef _DEBUG_JTAG_IO_ /* if a device is listed, the BYPASS register must not be selected */ if (jtag_get_device(i)->bypass) { WARNING("scan data for a device in BYPASS"); } +#endif } } return ERROR_OK; @@ -860,6 +863,20 @@ int jtag_add_pathmove(int num_states, enum tap_state *path) if (cmd_queue_end_state == TAP_TLR) jtag_call_event_callbacks(JTAG_TRST_ASSERTED); + + enum tap_state cur_state=cmd_queue_cur_state; + int i; + for (i=0; i<num_states; i++) + { + if ((tap_transitions[cur_state].low != path[i])&& + (tap_transitions[cur_state].high != path[i])) + { + ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_strings[cur_state], tap_state_strings[path[i]]); + exit(-1); + } + cur_state = path[i]; + } + cmd_queue_cur_state = path[num_states - 1]; return interface_jtag_add_pathmove(num_states, path); diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index ada3b49d..fe240eb6 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -270,6 +270,9 @@ extern int interface_jtag_add_plain_dr_scan(int num_fields, scan_field_t *fields * * - Run-Test/Idle must not be entered unless requested, because R-T/I may have * side effects. + * + * NB! a jtag_add_statemove() to the current state is not + * a no-operation. */ extern int jtag_add_statemove(enum tap_state endstate); extern int interface_jtag_add_statemove(enum tap_state endstate); @@ -278,6 +281,9 @@ extern int interface_jtag_add_statemove(enum tap_state endstate); * XScale and Xilinx support * * Note! TAP_TLR must not be used in the path! + * + * Note that the first on the list must be reachable + * via a single transition from the current state. */ extern int jtag_add_pathmove(int num_states, enum tap_state *path); extern int interface_jtag_add_pathmove(int num_states, enum tap_state *path); |