From 757349d54d3ee6d050f503cc51951c238c6263f8 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Fri, 22 Aug 2003 22:42:02 +0000 Subject: [PATCH] 2003-08-22 Marcel Telka * src/tap/cable/byteblaster.c (byteblaster_init): Added additional checks for valid ByteBlaster cable connection and enabled all variants of the cable (patch 793313, Rojhalat Ibrahim). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@542 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 +++++ jtag/NEWS | 2 ++ jtag/src/tap/cable/byteblaster.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 0e5d7ba2..d68711f7 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2003-08-22 Marcel Telka + + * src/tap/cable/byteblaster.c (byteblaster_init): Added additional checks for valid ByteBlaster cable + connection and enabled all variants of the cable (patch 793313, Rojhalat Ibrahim). + 2003-08-22 Marcel Telka * MANUFACTURERS: Added Altera manufacturer (Rojhalat Ibrahim). diff --git a/jtag/NEWS b/jtag/NEWS index 2775d91c..d1f1fc29 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -5,6 +5,8 @@ See libbrux/NEWS for more news. * Added new JTAG declarations for - Altera EP1C20F400 (Rojhalat Ibrahim) - Altera EPM7128AETC100 (Rojhalat Ibrahim) + * Added additional checks for valid ByteBlaster cable connection and enabled all variants + of the cable (patch 793313, Rojhalat Ibrahim). jtag-0.5 (2003-08-19): diff --git a/jtag/src/tap/cable/byteblaster.c b/jtag/src/tap/cable/byteblaster.c index b583cd8f..04aabfcd 100644 --- a/jtag/src/tap/cable/byteblaster.c +++ b/jtag/src/tap/cable/byteblaster.c @@ -45,6 +45,7 @@ #define TDI 6 #define TCK 0 #define TMS 1 +#define BB_CHECK 5 /* * 7 - BUSY (pin 11) @@ -54,14 +55,42 @@ * 3 - ERROR (pin 15) */ #define TDO 7 +#define BB_PRESENT 6 +#define VCC_OK_N 3 + +/* + * 0 - STROBE (pin 1) + * 1 - AUTOFD (pin 14) + * 2 - INIT (pin 16) + * 3 - SELECT (pin 17) +*/ +#define BB_ENABLE 0xC static int byteblaster_init( cable_t *cable ) { + int BB_II = 0; + if (parport_open( cable->port )) return -1; PARAM_TRST(cable) = 1; + + /* check if a ByteBlaster or ByteBlasterMV is connected */ + parport_set_data( cable->port, 1 << BB_CHECK); + if ( !( ( parport_get_status( cable->port ) >> BB_PRESENT ) & 1 ) ) + BB_II = 1; + parport_set_data( cable->port, 0); + if ( ( parport_get_status( cable->port ) >> BB_PRESENT ) & 1 ) + BB_II = 1; + + /* check if the power supply is ok (only for ByteBlaster II) */ + /* if no ByteBlaster at all is connected this check will fail, too */ + if ( ( BB_II ) && ( ( parport_get_status( cable->port ) >> VCC_OK_N ) & 1 ) ) + return -1; + + /* Enable ByteBlaster */ + parport_set_control( cable->port, BB_ENABLE ); return 0; }