This is an automated email from Gerrit.

Matthias Welwarsky ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/4690

-- gerrit

commit e33eba30e51f64ed1644f8b752989065b26e8225
Author: Matthias Welwarsky <[email protected]>
Date:   Mon Oct 8 10:25:19 2018 +0200

    cortex_a: adapt reset assert/deassert to new reset framework code
    
    reset is no longer handled inside targets assert/deassert code but
    instead through the framework.
    
    Change-Id: I8c276de2892819980fb4fbbaffb4d023bbf6b76e
    Signed-off-by: Matthias Welwarsky <[email protected]>

diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index bc4aa33..3c8649c 100644
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -1918,23 +1918,6 @@ static int cortex_a_assert_reset(struct target *target)
        /* Issue some kind of warm reset. */
        if (target_has_event_action(target, TARGET_EVENT_RESET_ASSERT))
                target_handle_event(target, TARGET_EVENT_RESET_ASSERT);
-       else if (jtag_get_reset_config() & RESET_HAS_SRST) {
-               /* REVISIT handle "pulls" cases, if there's
-                * hardware that needs them to work.
-                */
-
-               /*
-                * FIXME: fix reset when transport is SWD. This is a temporary
-                * work-around for release v0.10 that is not intended to stay!
-                */
-               if (transport_is_swd() ||
-                               (target->reset_halt && (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;
-       }
 
        /* registers are now invalid */
        if (target_was_examined(target))
@@ -1949,27 +1932,22 @@ static int cortex_a_deassert_reset(struct target 
*target)
 {
        int retval;
 
-       LOG_DEBUG(" ");
+       LOG_DEBUG("%s", target_name(target));
 
-       /* be certain SRST is off */
-       jtag_add_reset(0, 0);
+       if (!target_was_examined(target))
+               return ERROR_OK;
 
-       if (target_was_examined(target)) {
-               retval = cortex_a_poll(target);
-               if (retval != ERROR_OK)
-                       return retval;
-       }
+       retval = cortex_a_poll(target);
+       if (retval != ERROR_OK)
+               return retval;
 
        if (target->reset_halt) {
                if (target->state != TARGET_HALTED) {
                        LOG_WARNING("%s: ran after reset and before halt ...",
                                target_name(target));
-                       if (target_was_examined(target)) {
-                               retval = target_halt(target);
-                               if (retval != ERROR_OK)
-                                       return retval;
-                       } else
-                               target->state = TARGET_UNKNOWN;
+                       retval = target_halt(target);
+                       if (retval != ERROR_OK)
+                               return retval;
                }
        }
 

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to