The XScale target uses JTAG_PATHMOVE to get the TAP to the DRSHIFT state.
This patch fixes subsequent scans on the USBprog and J-Link adapters, so
that they don't try to make another transition (7 clocks) to DRSHIFT.
It also fixes the USBprog adapter to flush any pending TAP moves before
doing 'manual' state stepping during usbprog_path_move().Index: src/jtag/jlink.c
===================================================================
--- src/jtag/jlink.c (revision 1383)
+++ src/jtag/jlink.c (working copy)
@@ -424,7 +424,10 @@
/* Move to appropriate scan state */
jlink_end_state(ir_scan ? TAP_IRSHIFT : TAP_DRSHIFT);
- jlink_state_move();
+ /* Only move if we're not already there */
+ if (tap_get_state() != tap_get_end_state())
+ jlink_state_move();
+
jlink_end_state(saved_end_state);
/* Scan */
Index: src/jtag/usbprog.c
===================================================================
--- src/jtag/usbprog.c (revision 1383)
+++ src/jtag/usbprog.c (working copy)
@@ -265,6 +265,10 @@
int num_states = cmd->num_states;
int state_count;
+ /* There may be queued transitions, and before following a specified
+ path, we must flush those queued transitions */
+ usbprog_jtag_tms_send(usbprog_jtag_handle);
+
state_count = 0;
while (num_states)
{
@@ -323,6 +327,10 @@
usbprog_write(0, 0, 0);
}
+#ifdef _DEBUG_JTAG_IO_
+ LOG_DEBUG("runtest: cur_state %s end_state %s",
tap_state_name(tap_get_state()), tap_state_name(tap_get_end_state()));
+#endif
+
/* finish in end_state */
/*
usbprog_end_state(saved_end_state);
@@ -340,9 +348,10 @@
else
usbprog_end_state(TAP_DRSHIFT);
- /* usbprog_jtag_tms_send(usbprog_jtag_handle); */
+ /* Only move if we're not already there */
+ if (tap_get_state() != tap_get_end_state())
+ usbprog_state_move();
- usbprog_state_move();
usbprog_end_state(saved_end_state);
usbprog_jtag_tms_send(usbprog_jtag_handle);
@@ -360,6 +369,7 @@
usbprog_jtag_write_and_read(usbprog_jtag_handle,buffer,
scan_size);
}
+ /* The adapter does the transition to PAUSE internally */
if (ir_scan)
tap_set_state(TAP_IRPAUSE);
else
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development