From cbceb9abfde38a0036ef1392123cb192c03b5827 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Sun, 17 Oct 2004 15:15:59 +0000 Subject: [PATCH] 2004-10-17 Marcel Telka * src/tap/cable/wiggler.c (nTRST): Changed pin value (patch 1040199, Andrew Dyer). (nSRESET): New pin value (patch 1040199, Andrew Dyer). (wiggler_init, wiggler_clock, wiggler_get_tdo, wiggler_set_trst): Changed nTRST to not inverted signal (patch 1040199, Andrew Dyer). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@613 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 7 +++++++ jtag/NEWS | 1 + jtag/src/tap/cable/wiggler.c | 15 ++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index fb65e255..1971824c 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,10 @@ +2004-10-17 Marcel Telka + + * src/tap/cable/wiggler.c (nTRST): Changed pin value (patch 1040199, Andrew Dyer). + (nSRESET): New pin value (patch 1040199, Andrew Dyer). + (wiggler_init, wiggler_clock, wiggler_get_tdo, wiggler_set_trst): Changed nTRST to not inverted + signal (patch 1040199, Andrew Dyer). + 2004-09-21 Marcel Telka * data/intel/PARTS: Added support for different IXP425 frequency variants (patch 1030647, Trevor Man). diff --git a/jtag/NEWS b/jtag/NEWS index 4bdf417a..035e1da3 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -16,6 +16,7 @@ See libbrux/NEWS for more news. - Toshiba TX4925 (patch 972625, Andrew Dyer) - IBM PowerPC 440GX (patch 1012154, Jerome Debard) * Added support for Lattice Parallel Port JTAG Cable (patch 1012138, Jerome Debard). + * Fixed pin assignment for Macraigor Wiggler JTAG Cable (patch 1040199, Andrew Dyer). * Added new command 'salias'. * Explicit 'detectflash' command call is required before 'flashmem' command. * Fixed minor bugs (including bug 857039). diff --git a/jtag/src/tap/cable/wiggler.c b/jtag/src/tap/cable/wiggler.c index 0b5b9602..e2731100 100644 --- a/jtag/src/tap/cable/wiggler.c +++ b/jtag/src/tap/cable/wiggler.c @@ -38,10 +38,11 @@ /* * data D[7:0] (pins 9:2) */ +#define nTRST 4 /* nTRST is not inverted in the cable */ #define TDI 3 #define TCK 2 #define TMS 1 -#define nTRST 0 +#define nSRESET 0 /* sRESET is inverted in the cable */ /* * 7 - BUSY (pin 11) @@ -61,11 +62,11 @@ wiggler_init( cable_t *cable ) return -1; if ((data = parport_get_data( cable->port )) < 0) { - if (parport_set_data( cable->port, 0 << nTRST )) + if (parport_set_data( cable->port, 1 << nTRST )) return -1; PARAM_TRST(cable) = 1; } else - PARAM_TRST(cable) = ((data >> nTRST) ^ 1) & 1; + PARAM_TRST(cable) = (data >> nTRST) & 1; return 0; } @@ -76,16 +77,16 @@ wiggler_clock( cable_t *cable, int tms, int tdi ) tms = tms ? 1 : 0; tdi = tdi ? 1 : 0; - parport_set_data( cable->port, ((PARAM_TRST(cable) ^ 1) << nTRST) | (0 << TCK) | (tms << TMS) | (tdi << TDI) ); + parport_set_data( cable->port, (PARAM_TRST(cable) << nTRST) | (0 << TCK) | (tms << TMS) | (tdi << TDI) ); cable_wait(); - parport_set_data( cable->port, ((PARAM_TRST(cable) ^ 1) << nTRST) | (1 << TCK) | (tms << TMS) | (tdi << TDI) ); + parport_set_data( cable->port, (PARAM_TRST(cable) << nTRST) | (1 << TCK) | (tms << TMS) | (tdi << TDI) ); cable_wait(); } static int wiggler_get_tdo( cable_t *cable ) { - parport_set_data( cable->port, ((PARAM_TRST(cable) ^ 1) << nTRST) | (0 << TCK) ); + parport_set_data( cable->port, (PARAM_TRST(cable) << nTRST) | (0 << TCK) ); cable_wait(); return (parport_get_status( cable->port ) >> TDO) & 1; } @@ -95,7 +96,7 @@ wiggler_set_trst( cable_t *cable, int trst ) { PARAM_TRST(cable) = trst ? 1 : 0; - parport_set_data( cable->port, (PARAM_TRST(cable) ^ 1) << nTRST ); + parport_set_data( cable->port, PARAM_TRST(cable) << nTRST ); return PARAM_TRST(cable); }