diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 03c596ce..40a427cf 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,10 @@ +2003-02-07 Marcel Telka + + * src/tap/cable/arcom.c: Added support for Arcom JTAG Cable (patch 682310, + Ian Campbell). + * src/tap/cable.c: Ditto. + * src/tap/Makefile.am: Ditto. + 2003-02-07 Marcel Telka * src/tap/cable/mpcbdm.c (mpcbdm_clock): Fixed port address for TRST & TRST1. diff --git a/jtag/NEWS b/jtag/NEWS index a4555229..5376c08d 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -3,6 +3,7 @@ $Id$ * Enhanced 'dr' command functionality. * Added new 'set signal' command. * Added support for Mpcbdm JTAG Cable (Christian Pellegrin). + * Added support for Arcom JTAG Cable (patch 682310, Ian Campbell). jtag-0.2.2 (2003-02-04): diff --git a/jtag/README b/jtag/README index 423be46a..0f00949b 100644 --- a/jtag/README +++ b/jtag/README @@ -35,10 +35,12 @@ Supported hardware ------------------ JTAG adapters/cables (see 'help cable' command for more info): +- Arcom JTAG Cable - Altera ByteBlaster/ByteBlaster II/ByteBlasterMV Parallel Port Download Cable - Xilinx DLC5 JTAG Parallel Cable III - ETC EA253 JTAG Cable - ETC EI012 JTAG Cable +- Mpcbdm JTAG Cable - Macraigor Wiggler JTAG Cable JTAG-aware parts (chips): diff --git a/jtag/THANKS b/jtag/THANKS index a5baa479..d998f68d 100644 --- a/jtag/THANKS +++ b/jtag/THANKS @@ -4,3 +4,4 @@ Holger Schurig Stas Khirman Chris Ellec Christian Pellegrin +Ian Campbell diff --git a/jtag/src/tap/Makefile.am b/jtag/src/tap/Makefile.am index 85b86712..8304840a 100644 --- a/jtag/src/tap/Makefile.am +++ b/jtag/src/tap/Makefile.am @@ -28,6 +28,7 @@ libtap_a_SOURCES = \ register.c \ state.c \ cable.c \ + cable/arcom.c \ cable/byteblaster.c \ cable/dlc5.c \ cable/ea253.c \ diff --git a/jtag/src/tap/cable.c b/jtag/src/tap/cable.c index 774520c8..ddd34151 100644 --- a/jtag/src/tap/cable.c +++ b/jtag/src/tap/cable.c @@ -28,6 +28,7 @@ #include "cable.h" +extern cable_driver_t arcom_cable_driver; extern cable_driver_t byteblaster_cable_driver; extern cable_driver_t dlc5_cable_driver; extern cable_driver_t ea253_cable_driver; @@ -38,6 +39,7 @@ extern cable_driver_t wiggler_cable_driver; uint32_t frequency = 0; cable_driver_t *cable_drivers[] = { + &arcom_cable_driver, &byteblaster_cable_driver, &dlc5_cable_driver, &ea253_cable_driver, diff --git a/jtag/src/tap/cable/arcom.c b/jtag/src/tap/cable/arcom.c new file mode 100644 index 00000000..19794b76 --- /dev/null +++ b/jtag/src/tap/cable/arcom.c @@ -0,0 +1,112 @@ +/* + * $Id$ + * + * Arcom JTAG Cable Driver + * Copyright (C) 2002, 2003 ETC s.r.o. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Written by Marcel Telka , 2002, 2003. + * + */ + +#include + +#include "cable.h" +#include "state.h" + +/* + * data D[7:0] (pins 9:2) + */ +#define TDI 1 +#define TCK 0 +#define TMS 2 +#define TRST 3 + +/* + * 7 - BUSY (pin 11) + * 6 - ACK (pin 10) + * 5 - PE (pin 12) + * 4 - SEL (pin 13) + * 3 - ERROR (pin 15) + */ +#define TDO 7 + +static unsigned int port; + +static int +arcom_init( unsigned int aport ) +{ + tap_state_init(); + port = aport; + if (((port + 2 <= 0x400) && ioperm( port, 2, 1 )) || ((port + 2 > 0x400) && iopl( 3 ))) + return 0; + tap_state_set_trst( (inb( port ) >> TRST) & 1 ); + + return 1; +} + +static void +arcom_done( void ) +{ + if (port + 2 <= 0x400) + ioperm( port, 2, 0 ); + else + iopl( 0 ); + + tap_state_done(); +} + +static void +arcom_clock( int tms, int tdi ) +{ + int trst = tap_state_get_trst(); + + tms &= 1; + tdi &= 1; + + outb( (trst << TRST) | (0 << TCK) | (tms << TMS) | (tdi << TDI), port ); + cable_wait(); + outb( (trst << TRST) | (1 << TCK) | (tms << TMS) | (tdi << TDI), port ); + cable_wait(); + + tap_state_clock( tms ); +} + +static int +arcom_get_tdo( void ) +{ + outb( (tap_state_get_trst() << TRST) | (0 << TCK), port ); + cable_wait(); + return ((inb( port + 1 ) ^ 0x80) >> TDO) & 1; /* BUSY is inverted */ +} + +static void +arcom_set_trst( int new_trst ) +{ + tap_state_set_trst( new_trst ); + outb( (new_trst & 1) << TRST, port ); +} + +cable_driver_t arcom_cable_driver = { + "ARCOM", + "Arcom JTAG Cable", + arcom_init, + arcom_done, + arcom_clock, + arcom_get_tdo, + arcom_set_trst +};