This is an automated email from Gerrit. Peter Henn ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/941
-- gerrit commit a5c818d2577b62273f8863df7e2e510006d49c9a Author: Peter Henn <[email protected]> Date: Sun Oct 28 22:20:04 2012 +0100 ft2232 flush before read Currently the dumb ft2232 driver starts an USB read transaction just after every jtag scan transmit. Using USB High Speed FT2232H chips this result into long latencies, because the default 2 ms read latency timer needs first to be expired before the chip will acknowledge the USB in bulk transfer AKA USB read transaction. Waiting for expiring the timer can be simple omitted by adding a MSSE flush command behind the last Jtag read transaction. So the next USB read transaction from the USB host controller will only be delayed by the Jtag command execution time with Jtag TCK speed and no longer be the latency timer, which shall result in shorter Jtag write/read round trip delays. However using somehow a read command combining and queuing would naturally more efficient and shall be used for optimizing memory block read/write operations. That exactly is already done by the OpenOCD ftdi driver. Change-Id: Icdcbcc4d5cbe9f71802a851c41a718d2df8209e0 Signed-off-by: Peter Henn <[email protected]> diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index 6758dc7..9d4bd50 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -805,6 +805,11 @@ static int ft2232_send_and_recv(struct jtag_command *first, struct jtag_command uint32_t bytes_written = 0; uint32_t bytes_read = 0; + if (ft2232_expect_read) { + buffer_write(0x87); + LOG_DEBUG("Send Immediate buffer to PC"); + } + #ifdef _DEBUG_USB_IO_ struct timeval start, inter, inter2, end; struct timeval d_inter, d_inter2, d_end; @@ -1156,6 +1161,10 @@ static int ft2232_large_scan(struct scan_command *cmd, } } else /* (type == SCAN_IN) */ bits_left -= 8 * (thisrun_bytes); + if (type != SCAN_OUT) { + buffer_write(0x87); + /* LOG_DEBUG("Send Immediate buffer to PC"); */ + } retval = ft2232_write(ft2232_buffer, ft2232_buffer_size, &bytes_written); if (retval != ERROR_OK) { @@ -1247,8 +1256,11 @@ static int ft2232_large_scan(struct scan_command *cmd, clock_tms(mpsse_cmd, tms_bits, tms_count, last_bit); } - if (type != SCAN_OUT) + if (type != SCAN_OUT) { thisrun_read += 1; + buffer_write(0x87); + /* LOG_DEBUG("Send Immediate buffer to PC"); */ + } retval = ft2232_write(ft2232_buffer, ft2232_buffer_size, &bytes_written); if (retval != ERROR_OK) { -- ------------------------------------------------------------------------------ WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/ _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
