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; }