[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openocd-development
Subject:    [OpenOCD-devel] [PATCH]: 4d9d342 cortex_a: Handle SRST_PULLS_TRST in cortex_a_assert_reset
From:       gerrit () openocd ! org (gerrit)
Date:       2016-03-03 13:55:26
Message-ID: 20160303135526.71E44198109F () mail ! openocd ! org
[Download RAW message or body]

This is an automated email from Gerrit.

Dryvenn (dryvenn@gmail.com) just uploaded a new patch set to Gerrit, which you can \
find at http://openocd.zylin.com/3379

-- gerrit

commit 4d9d34282d4dcca53d48a3af84c59f771efa90d9
Author: dryvenn <dryvenn@gmail.com>
Date:   Wed Mar 2 17:57:05 2016 +0100

    cortex_a: Handle SRST_PULLS_TRST in cortex_a_assert_reset
    
    cortex_a_assert_reset shouldn't assert SRST alone if SRST pulls TRST.
    
    Change-Id: I0aedab5d9212e1ee370ed1393830d28a853eabbb
    Signed-off-by: dryvenn <dryvenn@gmail.com>

diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index b8304c4..d0a0a68 100644
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -1899,18 +1899,21 @@ static int cortex_a_assert_reset(struct target *target)
 {
 	struct armv7a_common *armv7a = target_to_armv7a(target);
 
-	LOG_DEBUG(" ");
+	LOG_DEBUG("target->state: %s",
+			target_state_name(target));
+
+	enum reset_types jtag_reset_config = jtag_get_reset_config();
 
 	/* FIXME when halt is requested, make it work somehow... */
 
 	/* Issue some kind of warm reset. */
-	if (target_has_event_action(target, TARGET_EVENT_RESET_ASSERT))
+	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.
-		 */
-		jtag_add_reset(0, 1);
+	} else if (jtag_reset_config & RESET_HAS_SRST) {
+		if (jtag_reset_config & RESET_SRST_PULLS_TRST)
+			jtag_add_reset(1, 1);
+		else
+			jtag_add_reset(0, 1);
 	} else {
 		LOG_ERROR("%s: how to reset?", target_name(target));
 		return ERROR_FAIL;

-- 

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic