From: Øyvind H. <go...@us...> - 2010-07-16 12:20:50
|
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 01b2a3091a4ef5df1a18d1142d6c63477cf9d08f (commit) via bb588bdaec2acb6898c1f86f674b829ee2098642 (commit) from 0672a6497ec1ea59905487c01a65ffad79449538 (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 01b2a3091a4ef5df1a18d1142d6c63477cf9d08f Author: Ãyvind Harboe <oyv...@zy...> Date: Fri Jul 16 10:57:28 2010 +0200 debug feature: jtagtcpip, improve performance waiting for ZY1000 fifo to idle is now queued as an asynchronous command. This radically improves performance when waitIdle() is interspersed with writes as no readback is required over TCP/IP. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/zy1000/jtag_minidriver.h b/src/jtag/zy1000/jtag_minidriver.h index d556699..f3fe5a6 100644 --- a/src/jtag/zy1000/jtag_minidriver.h +++ b/src/jtag/zy1000/jtag_minidriver.h @@ -48,6 +48,7 @@ extern uint32_t zy1000_tcpin(uint32_t address); +#if BUILD_ECOSBOARD // FIFO empty? static __inline__ void waitIdle(void) { @@ -57,6 +58,9 @@ static __inline__ void waitIdle(void) ZY1000_PEEK(ZY1000_JTAG_BASE + 0x10, empty); } while ((empty & 0x100) == 0); } +#else +extern void waitIdle(void); +#endif static __inline__ void waitQueue(void) { diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index a1104ef..97c94f7 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -1107,6 +1107,7 @@ enum ZY1000_CMD ZY1000_CMD_POKE = 0x0, ZY1000_CMD_PEEK = 0x8, ZY1000_CMD_SLEEP = 0x1, + ZY1000_CMD_WAITIDLE = 2 }; @@ -1167,6 +1168,22 @@ void zy1000_tcpout(uint32_t address, uint32_t data) } } +/* By sending the wait to the server, we avoid a readback + * of status. Radically improves performance for this operation + * with long ping times. + */ +void waitIdle(void) +{ + tcpip_open(); + if (!writeLong((ZY1000_CMD_WAITIDLE << 24))) + { + fprintf(stderr, "Could not write to zy1000 server\n"); + exit(-1); + } +} + + + uint32_t zy1000_tcpin(uint32_t address) { tcpip_open(); @@ -1241,6 +1258,11 @@ static void tcpipserver(void) jtag_sleep(data); break; } + case ZY1000_CMD_WAITIDLE: + { + waitIdle(); + break; + } default: return; } commit bb588bdaec2acb6898c1f86f674b829ee2098642 Author: Ãyvind Harboe <oyv...@zy...> Date: Fri Jul 16 10:51:14 2010 +0200 debug feature: jtagtcpip, improved performance only check error flag when rclk is actually enabled. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 013d865..a1104ef 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -72,6 +72,10 @@ #endif + +/* The software needs to check if it's in RCLK mode or not */ +static bool zy1000_rclk = false; + static int zy1000_khz(int khz, int *jtag_speed) { if (khz == 0) @@ -222,11 +226,13 @@ int zy1000_speed(int speed) /* flush JTAG master FIFO before setting speed */ waitIdle(); + zy1000_rclk = false; + if (speed == 0) { /*0 means RCLK*/ - speed = 0; ZY1000_POKE(ZY1000_JTAG_BASE + 0x10, 0x100); + zy1000_rclk = true; LOG_DEBUG("jtag_speed using RCLK"); } else @@ -456,17 +462,24 @@ int interface_jtag_execute_queue(void) uint32_t empty; waitIdle(); - ZY1000_PEEK(ZY1000_JTAG_BASE + 0x10, empty); - /* clear JTAG error register */ - ZY1000_POKE(ZY1000_JTAG_BASE + 0x14, 0x400); - if ((empty&0x400) != 0) + if (zy1000_rclk) { - LOG_WARNING("RCLK timeout"); - /* the error is informative only as we don't want to break the firmware if there - * is a false positive. + /* Only check for errors when using RCLK to speed up + * jtag over TCP/IP */ -// return ERROR_FAIL; + ZY1000_PEEK(ZY1000_JTAG_BASE + 0x10, empty); + /* clear JTAG error register */ + ZY1000_POKE(ZY1000_JTAG_BASE + 0x14, 0x400); + + if ((empty&0x400) != 0) + { + LOG_WARNING("RCLK timeout"); + /* the error is informative only as we don't want to break the firmware if there + * is a false positive. + */ + // return ERROR_FAIL; + } } return ERROR_OK; } ----------------------------------------------------------------------- Summary of changes: src/jtag/zy1000/jtag_minidriver.h | 4 +++ src/jtag/zy1000/zy1000.c | 53 ++++++++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |