|
From: openocd-gerrit <ope...@us...> - 2024-02-11 23:11:02
|
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 7295ddc15c0516a64c9996d2b351accb50175803 (commit)
from 81a50d3e9050eed8f4d95622f2b326054a200b93 (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 7295ddc15c0516a64c9996d2b351accb50175803
Author: N S <nl...@ya...>
Date: Sun Jan 22 21:34:16 2023 -0800
jtag/drivers: OpenJTAG standard variant perf improvement
Calculate exact size of response expected from OpenJTAG device so that
openjtag_buf_read_standard doesn't spend 5 retry cycles waiting for
data that isn't coming.
Change-Id: Icd010d1fa4453d6592a1f9aed93fb1f01e0a19da
Signed-off-by: N S <nl...@ya...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8101
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c
index 45064fe6a..1c79a2c9b 100644
--- a/src/jtag/drivers/openjtag.c
+++ b/src/jtag/drivers/openjtag.c
@@ -530,9 +530,20 @@ static int openjtag_quit(void)
static void openjtag_write_tap_buffer(void)
{
uint32_t written;
+ uint32_t rx_expected = 0;
+
+ /* calculate expected number of return bytes */
+ for (int tx_offs = 0; tx_offs < usb_tx_buf_offs; tx_offs++) {
+ if ((usb_tx_buf[tx_offs] & 0x0F) == 6) {
+ rx_expected++;
+ tx_offs++;
+ } else if ((usb_tx_buf[tx_offs] & 0x0F) == 2) {
+ rx_expected++;
+ }
+ }
openjtag_buf_write(usb_tx_buf, usb_tx_buf_offs, &written);
- openjtag_buf_read(usb_rx_buf, usb_tx_buf_offs, &usb_rx_buf_len);
+ openjtag_buf_read(usb_rx_buf, rx_expected, &usb_rx_buf_len);
usb_tx_buf_offs = 0;
}
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/openjtag.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|