From efe4e647e0a2f78591e4ed5eddf625e6fb768431 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Wed, 18 Jun 2003 11:30:50 +0000 Subject: [PATCH] 2003-06-18 Marcel Telka * src/discovery.c (discovery): Removed explicit JTAG chain length detection. Changed starting of the DR size detection from all 1 instead all 0 for IR (patch 753298, Matan Ziv-Av). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@488 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 ++++ jtag/NEWS | 2 ++ jtag/src/discovery.c | 57 ++------------------------------------------ 3 files changed, 9 insertions(+), 55 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 35d3c1bc..3f5bf15f 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2003-06-18 Marcel Telka + + * src/discovery.c (discovery): Removed explicit JTAG chain length detection. Changed starting of the DR + size detection from all 1 instead all 0 for IR (patch 753298, Matan Ziv-Av). + 2003-06-18 Marcel Telka * /src/flash.c (flash_drivers): Added 1 x 8 bit Intel Flash driver (patch 753295, Matan Ziv-Av). diff --git a/jtag/NEWS b/jtag/NEWS index f50f7a14..4a835c76 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -7,6 +7,8 @@ See libbrux/NEWS for more news. * Fixed bugs in SH7727 bus driver (thanks to Rainer Dörken). * Added bus width detection using MD3 and MD4 signals in SH7727 bus driver (thanks to Rainer Dörken). + * Removed explicit JTAG chain length detection for 'discovery' command + (patch 753298, Matan Ziv-Av). * Minor bugs fixed. jtag-0.4 (2003-05-29): diff --git a/jtag/src/discovery.c b/jtag/src/discovery.c index e49a1033..6b48fc9d 100644 --- a/jtag/src/discovery.c +++ b/jtag/src/discovery.c @@ -107,68 +107,14 @@ jtag_reset( chain_t *chain ) tap_reset( chain ); } -#define MAX_CHAIN_LENGTH 128 - void discovery( chain_t *chain, const char *filename ) { - int i; int irlen; tap_register *ir; tap_register *irz; FILE *f = NULL; - tap_register *id = register_alloc( 32 ); - tap_register *zeros = register_fill( register_alloc( 32 ), 0 ); - tap_register *ones = register_fill( register_alloc( 32 ), 1 ); - - if (id && zeros && ones) { - f = fopen( filename, "w" ); - if (!f) - printf( _("Error: Unable to create file '%s'.\n"), filename ); - } else - printf( _("Error: Out of memory!\n") ); - - if (!id || !zeros || !ones || !f) { - register_free( id ); - register_free( zeros ); - register_free( ones ); - return; - } - - printf( _("Detecting JTAG chain length:\n") ); - fprintf( f, _("Detecting JTAG chain length:\n") ); - - jtag_reset( chain ); - - tap_capture_dr( chain ); - for (i = 0; i < MAX_CHAIN_LENGTH; i++) { - tap_shift_register( chain, zeros, id, 0 ); - if (!register_compare( id, zeros )) - break; /* end of chain */ - - if (!register_compare( ones, id )) { - printf( _("bad JTAG connection (TDO is 1)\n") ); - fprintf( f, _("bad JTAG connection (TDO is 1)\n") ); - break; - } - - printf( _("ID[%d]: %s\n"), i, register_get_string( id ) ); - fprintf( f, _("ID[%d]: %s\n"), i, register_get_string( id ) ); - } - - register_free( id ); - register_free( zeros ); - register_free( ones ); - - if (i == MAX_CHAIN_LENGTH) { - printf( _("Warning: Maximum internal JTAG chain length exceeded!\n") ); - fprintf( f, _("Warning: Maximum internal JTAG chain length exceeded!\n") ); - } else { - printf( _("JTAG chain length is %d\n"), i ); - fprintf( f, _("JTAG chain length is %d\n"), i ); - } - /* detecting IR size */ jtag_reset( chain ); @@ -187,7 +133,8 @@ discovery( chain_t *chain, const char *filename ) return; } - ir = register_fill( register_alloc( irlen ), 0 ); + /* all 1 is BYPASS in all parts, so DR length gives number of parts */ + ir = register_fill( register_alloc( irlen ), 1 ); irz = register_duplicate( ir ); if (!ir || !irz) {