]> git.sur5r.net Git - openocd/commitdiff
jtag_add_statemove() always uses TLR to get to RESET
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 20 Oct 2009 05:50:51 +0000 (22:50 -0700)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 20 Oct 2009 05:50:51 +0000 (22:50 -0700)
As decided a while back, this isn't a transition we want to chance.
Whenever someone wants to got to RESET, force it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/jtag/core.c

index 415d1e8244beada363949af8c214ef323f86e13d..7c85839b0ae4fe4576145c3ebdfd8a2ff700e2b3 100644 (file)
@@ -567,12 +567,14 @@ int jtag_add_statemove(tap_state_t goal_state)
                tap_state_name(goal_state));
 
 
-       if (goal_state == cur_state)
-               ;       /* nothing to do */
-       else if (goal_state == TAP_RESET)
-       {
+       /* If goal is RESET, be paranoid and force that that transition
+        * (e.g. five TCK cycles, TMS high).  Else trust "cur_state".
+        */
+       if (goal_state == TAP_RESET)
                jtag_add_tlr();
-       }
+       else if (goal_state == cur_state)
+               /* nothing to do */ ;
+
        else if (tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state))
        {
                unsigned tms_bits  = tap_get_tms_path(cur_state, goal_state);