]> git.sur5r.net Git - openocd/commitdiff
cortex_a: fix cortex_a_assert_reset() if srst_gates_jtag
authorMatthias Welwarsky <matthias.welwarsky@sysgo.com>
Tue, 9 Feb 2016 13:49:20 +0000 (14:49 +0100)
committerFreddie Chopin <freddie.chopin@gmail.com>
Sun, 8 May 2016 08:22:09 +0000 (09:22 +0100)
The cortex_a specific assert_reset function must only apply nSRST if
the reset configuration states that JTAG can be used while nSRST is
asserted.

Change-Id: If604a65fdea5bcb46ec723ada547a4e8d6fa8c59
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3356
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/target/cortex_a.c

index 4c0d163fbc9f603c5543972b2be7f8690774ddad..f9ffccd08a4144bd0fb45b2feb6653aa6730632d 100644 (file)
@@ -1912,7 +1912,9 @@ static int cortex_a_assert_reset(struct target *target)
                /* REVISIT handle "pulls" cases, if there's
                 * hardware that needs them to work.
                 */
-               jtag_add_reset(0, 1);
+               if (target->reset_halt)
+                       if (jtag_get_reset_config() & RESET_SRST_NO_GATING)
+                               jtag_add_reset(0, 1);
        } else {
                LOG_ERROR("%s: how to reset?", target_name(target));
                return ERROR_FAIL;