From 40fecfa12924f070ccf198f85d2c10dc01de309b Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Sat, 19 Apr 2008 10:53:29 +0000 Subject: [PATCH] usbblaster clock() rate improved, using byte shift mode git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1176 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 2 ++ jtag/THANKS | 2 ++ jtag/src/tap/cable/usbblaster.c | 30 +++++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index ec17588b..6d5a19ae 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,5 +1,7 @@ 2008-04-19 Kolja Waschk + * src/tap/cable/usbblaster.c: clock() at highest possible rate + using the byte shift mode for n>=8 (Thanks M. Banditt) * include/cmd.h, src/cmd/cmd.c, src/jtag.c: [ 1946331 ] command completion support (by Mike Frysinger) * configure.ac, acinclude.m4: [ 1946114 ] make AC_PROG_SED diff --git a/jtag/THANKS b/jtag/THANKS index 1a03af55..eaf26754 100644 --- a/jtag/THANKS +++ b/jtag/THANKS @@ -5,6 +5,7 @@ or someone is missing who should be listed there! Shaju Abraham Beregnyei Balazs +Michael Banditt Krzysztof Blaszkowski Eugene Boldenkov Uwe Bonnes @@ -14,6 +15,7 @@ Ian Campbell Jeff Carr Alex (d18c7db) Jerome Debard +Kris Dickie Alexander Didebulidze Rainer Dörken Andrew Dyer diff --git a/jtag/src/tap/cable/usbblaster.c b/jtag/src/tap/cable/usbblaster.c index 29e118db..8ee0d2cb 100644 --- a/jtag/src/tap/cable/usbblaster.c +++ b/jtag/src/tap/cable/usbblaster.c @@ -63,14 +63,38 @@ usbblaster_init( cable_t *cable ) static void usbblaster_clock( cable_t *cable, int tms, int tdi, int n ) { - int i; + int i, m; tms = tms ? (1<= 8) + { + unsigned char tdis = tdi ? 0xFF : 0; + + parport_set_control( cable->link.port, 0 ); // noflush + + while (m >= 8) + { + int i; + int chunkbytes = (m >> 3); + if(chunkbytes > 63) chunkbytes = 63; + + parport_set_data( cable->link.port,(1<link.port, tdis); + } + + m -= (chunkbytes << 3); + } + } + + for (i = 0; i < m; i++) { parport_set_data( cable->link.port, OTHERS | (0 << TCK) | tms | tdi ); parport_set_data( cable->link.port, OTHERS | (1 << TCK) | tms | tdi ); parport_set_control( cable->link.port, 1 ); // flush @@ -189,7 +213,7 @@ usbblaster_transfer( cable_t *cable, int len, char *in, char *out ) static void usbblaster_flush( cable_t *cable, cable_flush_amount_t how_much ) { - if( how_much == OPTIONALLY ) return; + if( how_much == OPTIONALLY ) return; while (cable->todo.num_items > 0) {