From 3a79e715987fe8368842cd7e332f0356553a7cbc Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Fri, 30 May 2003 07:13:20 +0000 Subject: [PATCH] 2003-05-30 Marcel Telka * src/tap/parport/direct.c (direct_set_control): Inverted SELECT, AUTOFD, and STROBE signals (bug 745824). * src/tap/parport/ppdev.c (ppdev_set_control): Ditto. * src/tap/cable/mpcbdm.c (mpcbdm_init, mpcbdm_set_trst): Changed (inverted) TRST handling. (mpcbdm_clock, mpcbdm_get_tdo): Removed TRST setting. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@451 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 8 ++++++++ jtag/NEWS | 2 ++ jtag/src/tap/cable/mpcbdm.c | 12 +++++------- jtag/src/tap/parport/direct.c | 2 +- jtag/src/tap/parport/ppdev.c | 2 ++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 58dbd05c..39649749 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,11 @@ +2003-05-30 Marcel Telka + + * src/tap/parport/direct.c (direct_set_control): Inverted SELECT, AUTOFD, and STROBE + signals (bug 745824). + * src/tap/parport/ppdev.c (ppdev_set_control): Ditto. + * src/tap/cable/mpcbdm.c (mpcbdm_init, mpcbdm_set_trst): Changed (inverted) TRST handling. + (mpcbdm_clock, mpcbdm_get_tdo): Removed TRST setting. + 2003-05-29 Marcel Telka Version 0.4 released. diff --git a/jtag/NEWS b/jtag/NEWS index f7dc521c..b8ab2331 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -1,5 +1,7 @@ $Id$ + * Fixed bug with SELECT, AUTOFD, and STROBE signals handling (bug 745824). + jtag-0.4 (2003-05-29): * Added support for executing scripts directly from stdin (parameter '-'). diff --git a/jtag/src/tap/cable/mpcbdm.c b/jtag/src/tap/cable/mpcbdm.c index 12295ccf..433e4edd 100644 --- a/jtag/src/tap/cable/mpcbdm.c +++ b/jtag/src/tap/cable/mpcbdm.c @@ -45,8 +45,9 @@ /* * control */ -#define TRST 1 -#define TRST1 3 +#define HRESET 3 /* the signal is inverted by cable hardware */ +#define SRESET 1 /* the signal is inverted by cable hardware */ +#define TRST 0 /* the signal is inverted by cable hardware */ /* * status @@ -59,7 +60,7 @@ mpcbdm_init( cable_t *cable ) if (parport_open( cable->port )) return -1; - parport_set_control( cable->port, (1 << TRST) | (1 << TRST1) ); + parport_set_control( cable->port, 0 << TRST ); PARAM_TRST(cable) = 1; return 0; @@ -72,10 +73,8 @@ mpcbdm_clock( cable_t *cable, int tms, int tdi ) tdi = tdi ? 1 : 0; parport_set_data( cable->port, (0 << TCK) | (tms << TMS) | (tdi << TDI) ); - parport_set_control( cable->port, (PARAM_TRST(cable) << TRST) | (PARAM_TRST(cable) << TRST1) ); cable_wait(); parport_set_data( cable->port, (1 << TCK) | (tms << TMS) | (tdi << TDI) ); - parport_set_control( cable->port, (PARAM_TRST(cable) << TRST) | (PARAM_TRST(cable) << TRST1) ); cable_wait(); } @@ -83,7 +82,6 @@ static int mpcbdm_get_tdo( cable_t *cable ) { parport_set_data( cable->port, 0 << TCK ); - parport_set_control( cable->port, (PARAM_TRST(cable) << TRST) | (PARAM_TRST(cable) << TRST1) ); cable_wait(); return (parport_get_status( cable->port ) >> TDO) & 1; } @@ -93,7 +91,7 @@ mpcbdm_set_trst( cable_t *cable, int trst ) { PARAM_TRST(cable) = trst ? 1 : 0; - parport_set_control( cable->port, (PARAM_TRST(cable) << TRST) | (PARAM_TRST(cable) << TRST1) ); + parport_set_control( cable->port, (PARAM_TRST(cable) ^ 1) << TRST ); return PARAM_TRST(cable); } diff --git a/jtag/src/tap/parport/direct.c b/jtag/src/tap/parport/direct.c index 4d6121b1..8dcd8553 100644 --- a/jtag/src/tap/parport/direct.c +++ b/jtag/src/tap/parport/direct.c @@ -248,7 +248,7 @@ static int direct_set_control( parport_t *parport, uint8_t data ) { unsigned int port = ((direct_params_t *) parport->params)->port; - outb( data, port + 2 ); + outb( data ^ 0x0B, port + 2 ); /* SELECT, AUTOFD, and STROBE are inverted */ return 0; } diff --git a/jtag/src/tap/parport/ppdev.c b/jtag/src/tap/parport/ppdev.c index 310cc30d..9f7acb5c 100644 --- a/jtag/src/tap/parport/ppdev.c +++ b/jtag/src/tap/parport/ppdev.c @@ -229,6 +229,8 @@ ppdev_set_control( parport_t *parport, uint8_t data ) { ppdev_params_t *p = parport->params; + data ^= 0x0B; /* SELECT, AUTOFD, and STROBE are inverted */ + if (ioctl( p->fd, PPWCONTROL, &data ) == -1) return -1;