diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-07-16 10:57:28 +0200 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-07-16 12:18:59 +0200 |
commit | 01b2a3091a4ef5df1a18d1142d6c63477cf9d08f (patch) | |
tree | 106d7a3f927822ee69db48dfa4bc3c5197ac20fd /src/jtag/zy1000/zy1000.c | |
parent | bb588bdaec2acb6898c1f86f674b829ee2098642 (diff) |
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 <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/jtag/zy1000/zy1000.c')
-rw-r--r-- | src/jtag/zy1000/zy1000.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index a1104ef4..97c94f7c 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; } |