2003-02-07 Marcel Telka <marcel@telka.sk>

* src/tap/cable/mpcbmd.c: Added support for Mpcbdm JTAG Cable (Christian Pellegrin).
	* src/tap/cable.c: Ditto.
	* src/tap/Makefile.am: Ditto.


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@336 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 22 years ago
parent d32e8ba6c0
commit 630a04a509

@ -1,3 +1,9 @@
2003-02-07 Marcel Telka <marcel@telka.sk>
* src/tap/cable/mpcbmd.c: Added support for Mpcbdm JTAG Cable (Christian Pellegrin).
* src/tap/cable.c: Ditto.
* src/tap/Makefile.am: Ditto.
2003-02-04 Marcel Telka <marcel@telka.sk>
* src/help.c (help): Added missing short help description for 'set' command.

@ -2,6 +2,7 @@ $Id$
* Enhanced 'dr' command functionality.
* Added new 'set signal' command.
* Added support for Mpcbdm JTAG Cable (Christian Pellegrin).
jtag-0.2.2 (2003-02-04):

@ -3,3 +3,4 @@ $Id$
Holger Schurig
Stas Khirman
Chris Ellec
Christian Pellegrin

@ -32,6 +32,7 @@ libtap_a_SOURCES = \
cable/dlc5.c \
cable/ea253.c \
cable/ei012.c \
cable/mpcbdm.c \
cable/wiggler.c
INCLUDES = -I$(top_srcdir)/include $(OPENWINCE_INC)

@ -32,6 +32,7 @@ extern cable_driver_t byteblaster_cable_driver;
extern cable_driver_t dlc5_cable_driver;
extern cable_driver_t ea253_cable_driver;
extern cable_driver_t ei012_cable_driver;
extern cable_driver_t mpcbdm_cable_driver;
extern cable_driver_t wiggler_cable_driver;
uint32_t frequency = 0;
@ -41,6 +42,7 @@ cable_driver_t *cable_drivers[] = {
&dlc5_cable_driver,
&ea253_cable_driver,
&ei012_cable_driver,
&mpcbdm_cable_driver,
&wiggler_cable_driver,
NULL /* last must be NULL */
};

@ -0,0 +1,121 @@
/*
* $Id$
*
* Mpcbdm 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 <marcel@telka.sk>, 2002, 2003.
* Modified for Mpcbdm by Christian Pellegrin <chri@ascensit.com>, 2003.
*
* Documentation:
* [1] http://www.vas-gmbh.de/software/mpcbdm/
*
*/
#include <sys/io.h>
#include "cable.h"
#include "state.h"
/*
* data
*/
#define TDI 1
#define TCK 0
#define TMS 2
/*
* control
*/
#define TRST 1
#define TRST1 3
/*
* status
*/
#define TDO 5
static unsigned int port;
static int
mpcbdm_init( unsigned int aport )
{
tap_state_init();
port = aport;
if (((port + 3 <= 0x400) && ioperm( port, 3, 1 )) || ((port + 3 > 0x400) && iopl( 3 )))
return 0;
outb( (1 << TRST) | (1 << TRST1), port + 2 );
tap_state_set_trst( 1 );
return 1;
}
static void
mpcbdm_done( void )
{
if (port + 3 <= 0x400)
ioperm( port, 3, 0 );
else
iopl( 0 );
tap_state_done();
}
static void
mpcbdm_clock( int tms, int tdi )
{
int trst = tap_state_get_trst();
tms &= 1;
tdi &= 1;
outb( (0 << TCK) | (tms << TMS) | (tdi << TDI), port );
outb( (trst << TRST) | (trst << TRST1), port + 2 );
cable_wait();
outb( (1 << TCK) | (tms << TMS) | (tdi << TDI), port );
outb( (trst << TRST) | (trst << TRST1), port );
cable_wait();
tap_state_clock( tms );
}
static int
mpcbdm_get_tdo( void )
{
outb( (0 << TCK), port );
outb( (tap_state_get_trst() << TRST) | (tap_state_get_trst() << TRST1), port + 2 );
cable_wait();
return ((inb( port + 1 ) ^ 0x80) >> TDO) & 1; /* BUSY is inverted */
}
static void
mpcbdm_set_trst( int new_trst )
{
tap_state_set_trst( new_trst );
outb( (new_trst & 1) << TRST | (new_trst & 1) << TRST1, port + 2 );
}
cable_driver_t mpcbdm_cable_driver = {
"MPCBDM",
"Mpcbdm JTAG cable",
mpcbdm_init,
mpcbdm_done,
mpcbdm_clock,
mpcbdm_get_tdo,
mpcbdm_set_trst
};
Loading…
Cancel
Save