|
From: openocd-gerrit <ope...@us...> - 2026-05-17 20:53:56
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via eeacc589af6062e38658e19dfb6f315f9e5db26c (commit)
from 0e901c561f238fff70ab1423600af6d706fd603c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit eeacc589af6062e38658e19dfb6f315f9e5db26c
Author: Tomas Vanek <va...@fb...>
Date: Wed Apr 29 11:07:21 2026 +0200
jtag/core: fix is_jtag_poll_safe() logic
RESET_SRST_NO_GATING reset config option is used also for
other transports, mainly for SWD.
Disable polling implicitly while SRST is gating the debug
HW regardless the selected transport.
While on it, add FIXME comment to mark similar issue with
sensed SRST signal. Currently there is no support for
SRST sensing in drivers so no way to test eventual change.
Change-Id: I88a7cbd5141b4343db9877d386f9ff37630b5fca
Signed-off-by: Tomas Vanek <va...@fb...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9605
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/jtag/core.c b/src/jtag/core.c
index 941d9f3b4..9c438a01b 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -146,18 +146,15 @@ static bool jtag_poll_en = true;
bool is_jtag_poll_safe(void)
{
/* Polling can be disabled explicitly with set_enabled(false).
- * It can also be masked with mask().
- * It is also implicitly disabled while TRST is active and
- * while SRST is gating the JTAG clock.
- */
- if (!jtag_poll_en)
+ * It can also be masked with mask(). */
+ if (!jtag_poll_en || !jtag_poll)
return false;
- if (!transport_is_jtag())
- return jtag_poll;
-
- if (!jtag_poll || jtag_trst != 0)
+ /* On JTAG transport it is also implicitly disabled while TRST is active */
+ if (transport_is_jtag() && jtag_trst)
return false;
+
+ /* On any transport while SRST is gating the JTAG clock or other debug HW */
return jtag_srst == 0 || (jtag_reset_config & RESET_SRST_NO_GATING);
}
diff --git a/src/target/target.c b/src/target/target.c
index f8cb7e483..154891d0f 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -2937,6 +2937,8 @@ static int handle_target(void *priv)
recursive = 0;
}
+ /* FIXME: sensed SRST state should be treated similarly as
+ * active SRST control and honour reset config RESET_SRST_NO_GATING */
if (sensed_power_dropout || sensed_srst_asserted)
return ERROR_OK;
-----------------------------------------------------------------------
Summary of changes:
src/jtag/core.c | 15 ++++++---------
src/target/target.c | 2 ++
2 files changed, 8 insertions(+), 9 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|