diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 9dc848c1..63fd5cc1 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,13 @@ +2003-09-14 Marcel Telka + + * src/tap/cable/triton.c: New file (patch 805103, Andreas Mohr). + * src/tap/Makefile.am (libtap_a_SOURCES): Added cable/triton.c (patch 805103, Andreas Mohr). + * src/tap/cable.c (cable_drivers): Added triton_cable_driver member (patch 805103, Andreas Mohr). + * src/tap/cable/generic.h (PARAM_SRESET): New macro (patch 805103, Andreas Mohr). + (generic_params_t): New structure member 'sreset' (patch 805103, Andreas Mohr). + + * configure.ac: Changed description for --with-include parameter (thanks to Andreas Mohr). + 2003-09-12 Marcel Telka * configure.ac (AC_CHECK_FUNCS): Added swprintf. diff --git a/jtag/NEWS b/jtag/NEWS index 0eb9ebd0..abbaeed7 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -15,6 +15,7 @@ jtag-0.5.1: * Added BOOT_DEF register emulation for PXA2x0 bus driver. * Fixed inverted TRST signal for Macraigor Wiggler JTAG Cable see patch 799377 for more info, thanks to Mike Tesch for reporting). + * Added Ka-Ro TRITON (PXA255/250) JTAG Cable driver (patch 805103, Andreas Mohr). * Fixed minor bugs. jtag-0.5 (2003-08-19): diff --git a/jtag/README b/jtag/README index f3be119d..24c358ed 100644 --- a/jtag/README +++ b/jtag/README @@ -37,6 +37,7 @@ JTAG adapters/cables (see 'help cable' command for more info): - ETC EI012 JTAG Cable - Keith & Koep JTAG Cable - Mpcbdm JTAG Cable +- Ka-Ro TRITON (PXA255/250) JTAG Cable - Macraigor Wiggler JTAG Cable JTAG-aware parts (chips): diff --git a/jtag/THANKS b/jtag/THANKS index d23aa151..f73feba9 100644 --- a/jtag/THANKS +++ b/jtag/THANKS @@ -13,6 +13,7 @@ August Hörandl Rojhalat Ibrahim Stas Khirman Guennadi Liakhovetski +Andreas Mohr Brad Parker Christian Pellegrin Ramses VI diff --git a/jtag/configure.ac b/jtag/configure.ac index 209c7a42..1e31a0b3 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -60,7 +60,7 @@ AC_PROG_RANLIB AC_CONFIG_SUBDIRS(libbrux) AC_ARG_WITH(include, - AC_HELP_STRING([--with-include=PATH], [Path to the openwince includes]), + AC_HELP_STRING([--with-include=PATH], [Absolute path to the openwince includes]), openwince_inc="$withval") AC_CACHE_CHECK([for the openwince includes], openwince_includes_path, [ diff --git a/jtag/src/tap/Makefile.am b/jtag/src/tap/Makefile.am index fd66c6f7..4672e924 100644 --- a/jtag/src/tap/Makefile.am +++ b/jtag/src/tap/Makefile.am @@ -43,4 +43,5 @@ libtap_a_SOURCES = \ cable/ei012.c \ cable/keithkoep.c \ cable/mpcbdm.c \ + cable/triton.c \ cable/wiggler.c diff --git a/jtag/src/tap/cable.c b/jtag/src/tap/cable.c index 521c3f8c..c121fa02 100644 --- a/jtag/src/tap/cable.c +++ b/jtag/src/tap/cable.c @@ -38,6 +38,7 @@ extern cable_driver_t ea253_cable_driver; extern cable_driver_t ei012_cable_driver; extern cable_driver_t keithkoep_cable_driver; extern cable_driver_t mpcbdm_cable_driver; +extern cable_driver_t triton_cable_driver; extern cable_driver_t wiggler_cable_driver; uint32_t frequency = 0; @@ -50,6 +51,7 @@ cable_driver_t *cable_drivers[] = { &ei012_cable_driver, &keithkoep_cable_driver, &mpcbdm_cable_driver, + &triton_cable_driver, &wiggler_cable_driver, NULL /* last must be NULL */ }; diff --git a/jtag/src/tap/cable/generic.h b/jtag/src/tap/cable/generic.h index 7b2d3d03..cd4bedb6 100644 --- a/jtag/src/tap/cable/generic.h +++ b/jtag/src/tap/cable/generic.h @@ -30,9 +30,11 @@ typedef struct { int trst; + int sreset; } generic_params_t; #define PARAM_TRST(cable) ((generic_params_t *) cable->params)->trst +#define PARAM_SRESET(cable) ((generic_params_t *) cable->params)->sreset cable_t *generic_connect( cable_driver_t *cable_driver, parport_t *port ); void generic_disconnect( cable_t *cable ); diff --git a/jtag/src/tap/cable/triton.c b/jtag/src/tap/cable/triton.c new file mode 100644 index 00000000..cc0fd59c --- /dev/null +++ b/jtag/src/tap/cable/triton.c @@ -0,0 +1,123 @@ +/* + * $Id$ + * + * Ka-Ro TRITON Starterkit II (PXA255/250) JTAG Cable + * 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. + * Modified for TRITON by Andreas Mohr , 2003 + * + */ + +/* + * Ka-Ro electronics GmbH (http://www.karo-electronics.de) + * TRITON Starterkit II (PXA255/250) JTAG Parallel Cable Driver + * (boards probably produced by www.mite.cz) + * Other vendors: www.strategic-test.com, www.fsforth.de (www.es-usa.com), + * www.directinsight.co.uk, www.quantum.com.pl, + * + * This code has been verified to work with a Starterkit II, + * but a Starterkit I might also work (however it has a differing JTAG cable + * interface circuit, so all bets are off). + */ + +#include "sysdep.h" + +#include "cable.h" +#include "parport.h" +#include "chain.h" + +#include "generic.h" + +/* + * data D[7:0] (pins 9:2) + */ +#define TDI 1 +#define TCK 0 +#define TMS 2 +#define TRST 3 +#define SRESET 4 +#define ENAB 5 /* not programmed, since it's always 0 */ + +/* + * status + * + * 7 - BUSY (pin 11) + * 6 - ACK (pin 10) + * 5 - PE (pin 12) + * 4 - SEL (pin 13) + * 3 - ERROR (pin 15) + */ +#define TDO 7 + +static int +triton_init( cable_t *cable ) +{ + int data; + + if (parport_open( cable->port )) + return -1; + + PARAM_TRST(cable) = 1; + PARAM_SRESET(cable) = 1; + + return 0; +} + +static void +triton_clock( cable_t *cable, int tms, int tdi ) +{ + tms = tms ? 1 : 0; + tdi = tdi ? 1 : 0; + + parport_set_data( cable->port, (PARAM_TRST(cable) << TRST) | (PARAM_SRESET(cable) << SRESET) | (0 << TCK) | (tms << TMS) | (tdi << TDI) ); + cable_wait(); + parport_set_data( cable->port, (PARAM_TRST(cable) << TRST) | (PARAM_SRESET(cable) << SRESET) | (1 << TCK) | (tms << TMS) | (tdi << TDI) ); + cable_wait(); +} + +static int +triton_get_tdo( cable_t *cable ) +{ + parport_set_data( cable->port, (PARAM_TRST(cable) << TRST) | (PARAM_SRESET(cable) << SRESET) | (0 << TCK) ); + cable_wait(); + return (parport_get_status( cable->port ) >> TDO) & 1; +} + +static int +triton_set_trst( cable_t *cable, int trst ) +{ + PARAM_TRST(cable) = trst ? 1 : 0; + + parport_set_data( cable->port, (PARAM_TRST(cable) << TRST) | (PARAM_SRESET(cable) << SRESET) ); + return PARAM_TRST(cable); +} + +cable_driver_t triton_cable_driver = { + "TRITON", + N_("Ka-Ro TRITON Starterkit II (PXA255/250) JTAG Cable"), + generic_connect, + generic_disconnect, + generic_cable_free, + triton_init, + generic_done, + triton_clock, + triton_get_tdo, + triton_set_trst, + generic_get_trst +};