|
From: openocd-gerrit <ope...@us...> - 2023-12-30 13:10:39
|
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 8df529fa663cef2004a6a26e8f147b8c96e03de9 (commit)
from 65fc586d6ee18813937ec0fdb264b9e0d4bc1c76 (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 8df529fa663cef2004a6a26e8f147b8c96e03de9
Author: Aleksey Shargalin <myo...@gm...>
Date: Tue Oct 31 17:23:40 2017 +0300
bitbang: Add flush before sleep
Some bitbang interfaces have no speed regulation and work as fast as
they can. Only the sequence of execuded commands is guaranteed but
not the timing. It works most of time with one exception: when the
JTAG_SLEEP command is executed, we expect that all previous commands
already finished so that the sleep interval is guaranteed.
For now there may be situations when the sleep time has passed but
previous commands are not actually executed.
This patch adds a flush command to the bitbang interface, connects it
to the existing implementation for remote_bitbang, and runs it when
the JTAG_SLEEP command is executed.
Change-Id: If40894a63d29a260a4ded134b008df6dd1e89c46
Signed-off-by: Aleksey Shargalin <myo...@gm...>
Signed-off-by: David Ryskalczyk <dav...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/4284
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/jtag/drivers/bitbang.c b/src/jtag/drivers/bitbang.c
index 6e97d1584..186d2098a 100644
--- a/src/jtag/drivers/bitbang.c
+++ b/src/jtag/drivers/bitbang.c
@@ -360,6 +360,8 @@ int bitbang_execute_queue(void)
break;
case JTAG_SLEEP:
LOG_DEBUG_IO("sleep %" PRIu32, cmd->cmd.sleep->us);
+ if (bitbang_interface->flush && (bitbang_interface->flush() != ERROR_OK))
+ return ERROR_FAIL;
bitbang_sleep(cmd->cmd.sleep->us);
break;
case JTAG_TMS:
diff --git a/src/jtag/drivers/bitbang.h b/src/jtag/drivers/bitbang.h
index e3714df9c..097a5c0d1 100644
--- a/src/jtag/drivers/bitbang.h
+++ b/src/jtag/drivers/bitbang.h
@@ -57,6 +57,9 @@ struct bitbang_interface {
/** Sleep for some number of microseconds. **/
int (*sleep)(unsigned int microseconds);
+
+ /** Force a flush. */
+ int (*flush)(void);
};
extern const struct swd_driver bitbang_swd;
diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c
index c488f8334..6d0fba2e4 100644
--- a/src/jtag/drivers/remote_bitbang.c
+++ b/src/jtag/drivers/remote_bitbang.c
@@ -281,6 +281,7 @@ static struct bitbang_interface remote_bitbang_bitbang = {
.swd_write = &remote_bitbang_swd_write,
.blink = &remote_bitbang_blink,
.sleep = &remote_bitbang_sleep,
+ .flush = &remote_bitbang_flush,
};
static int remote_bitbang_init_tcp(void)
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/bitbang.c | 2 ++
src/jtag/drivers/bitbang.h | 3 +++
src/jtag/drivers/remote_bitbang.c | 1 +
3 files changed, 6 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|