diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 560a8486..4fcbc6a6 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,4 +1,9 @@ -2003-09-10 Marcel Telka +2003-09-11 Marcel Telka + + * src/tap/cable/wiggler.c (wiggler_init, wiggler_clock, wiggler_get_tdo, wiggler_set_trst): Fixed + inverted TRST signal (see patch 799377 for more info, thanks to Mike Tesch for reporting). + +2003-09-11 Marcel Telka * src/cmd/dr.c (cmd_dr_run): Added test for missing active instruction and data register (thanks to Mike Tesch for reporting). diff --git a/jtag/NEWS b/jtag/NEWS index 97010e19..1a9e6f9f 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -11,6 +11,8 @@ See libbrux/NEWS for more news. (based on patch 792591, thanks to Guennadi Liakhovetski). * Added 'initbus' command to allow dynamic bus driver loading. * 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). * Fixed minor bugs. jtag-0.5 (2003-08-19): diff --git a/jtag/src/tap/cable/wiggler.c b/jtag/src/tap/cable/wiggler.c index 4e03c597..0b5b9602 100644 --- a/jtag/src/tap/cable/wiggler.c +++ b/jtag/src/tap/cable/wiggler.c @@ -41,7 +41,7 @@ #define TDI 3 #define TCK 2 #define TMS 1 -#define TRST 0 +#define nTRST 0 /* * 7 - BUSY (pin 11) @@ -61,11 +61,11 @@ wiggler_init( cable_t *cable ) return -1; if ((data = parport_get_data( cable->port )) < 0) { - if (parport_set_data( cable->port, 1 << TRST )) + if (parport_set_data( cable->port, 0 << nTRST )) return -1; PARAM_TRST(cable) = 1; } else - PARAM_TRST(cable) = (data >> TRST) & 1; + PARAM_TRST(cable) = ((data >> nTRST) ^ 1) & 1; return 0; } @@ -76,16 +76,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) << TRST) | (0 << TCK) | (tms << TMS) | (tdi << TDI) ); + parport_set_data( cable->port, ((PARAM_TRST(cable) ^ 1) << nTRST) | (0 << TCK) | (tms << TMS) | (tdi << TDI) ); cable_wait(); - parport_set_data( cable->port, (PARAM_TRST(cable) << TRST) | (1 << TCK) | (tms << TMS) | (tdi << TDI) ); + parport_set_data( cable->port, ((PARAM_TRST(cable) ^ 1) << 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) << TRST) | (0 << TCK) ); + parport_set_data( cable->port, ((PARAM_TRST(cable) ^ 1) << nTRST) | (0 << TCK) ); cable_wait(); return (parport_get_status( cable->port ) >> TDO) & 1; } @@ -95,7 +95,7 @@ wiggler_set_trst( cable_t *cable, int trst ) { PARAM_TRST(cable) = trst ? 1 : 0; - parport_set_data( cable->port, PARAM_TRST(cable) << TRST ); + parport_set_data( cable->port, (PARAM_TRST(cable) ^ 1) << nTRST ); return PARAM_TRST(cable); }