debug feature: jtagtcpip, improved performance

only check error flag when rclk is actually enabled.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe 2010-07-16 10:51:14 +02:00
parent 0672a6497e
commit bb588bdaec
1 changed files with 22 additions and 9 deletions

View File

@ -72,6 +72,10 @@
#endif #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) static int zy1000_khz(int khz, int *jtag_speed)
{ {
if (khz == 0) if (khz == 0)
@ -222,11 +226,13 @@ int zy1000_speed(int speed)
/* flush JTAG master FIFO before setting speed */ /* flush JTAG master FIFO before setting speed */
waitIdle(); waitIdle();
zy1000_rclk = false;
if (speed == 0) if (speed == 0)
{ {
/*0 means RCLK*/ /*0 means RCLK*/
speed = 0;
ZY1000_POKE(ZY1000_JTAG_BASE + 0x10, 0x100); ZY1000_POKE(ZY1000_JTAG_BASE + 0x10, 0x100);
zy1000_rclk = true;
LOG_DEBUG("jtag_speed using RCLK"); LOG_DEBUG("jtag_speed using RCLK");
} }
else else
@ -456,6 +462,12 @@ int interface_jtag_execute_queue(void)
uint32_t empty; uint32_t empty;
waitIdle(); waitIdle();
if (zy1000_rclk)
{
/* Only check for errors when using RCLK to speed up
* jtag over TCP/IP
*/
ZY1000_PEEK(ZY1000_JTAG_BASE + 0x10, empty); ZY1000_PEEK(ZY1000_JTAG_BASE + 0x10, empty);
/* clear JTAG error register */ /* clear JTAG error register */
ZY1000_POKE(ZY1000_JTAG_BASE + 0x14, 0x400); ZY1000_POKE(ZY1000_JTAG_BASE + 0x14, 0x400);
@ -468,6 +480,7 @@ int interface_jtag_execute_queue(void)
*/ */
// return ERROR_FAIL; // return ERROR_FAIL;
} }
}
return ERROR_OK; return ERROR_OK;
} }