diff options
author | drochner <drochner@pkgsrc.org> | 2010-07-30 16:02:45 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2010-07-30 16:02:45 +0000 |
commit | 3650b9bd14415a82f3e062050b97b5a2987586fd (patch) | |
tree | ef1ae7b1b49c73a305f2e8a3206c269cd2dba5e4 /misc | |
parent | 3540c870b64c31d67f86e7c7883ac857f705ebb3 (diff) | |
download | pkgsrc-3650b9bd14415a82f3e062050b97b5a2987586fd.tar.gz |
add urjtag-0.10, a command-line tool for JTAG testing, successor
of the openwince-jtagtools (added features are ejtag support,
bsdl file import and svf player, probably more)
I've added a minimal driver for the "usbprog" adapter. It needs the
"usbprogJTAG" firmware which is not distributed in binary
by the developers but can be easily built with pkgsrc/cross/avr-gcc.
(There is some "openocd" firmware which looks similar, it might be
possible to make this work.)
Caution: The usbprog adapter does no Vref sampling but drives always 5V.
Make sure your taget device tolerates that. (I've tested with a PIC32
eval board.)
Diffstat (limited to 'misc')
-rw-r--r-- | misc/urjtag/DESCR | 5 | ||||
-rw-r--r-- | misc/urjtag/Makefile | 25 | ||||
-rw-r--r-- | misc/urjtag/PLIST | 246 | ||||
-rw-r--r-- | misc/urjtag/distinfo | 8 | ||||
-rw-r--r-- | misc/urjtag/files/usbprog.c | 188 | ||||
-rw-r--r-- | misc/urjtag/patches/patch-aa | 32 | ||||
-rw-r--r-- | misc/urjtag/patches/patch-ab | 20 | ||||
-rw-r--r-- | misc/urjtag/patches/patch-ac | 20 |
8 files changed, 544 insertions, 0 deletions
diff --git a/misc/urjtag/DESCR b/misc/urjtag/DESCR new file mode 100644 index 00000000000..8f3c8781a72 --- /dev/null +++ b/misc/urjtag/DESCR @@ -0,0 +1,5 @@ +UrJTAG is a software package which enables working with JTAG-aware (IEEE +1149.1) hardware devices (parts) and boards through a JTAG adapter. +This package has an open and modular architecture with the ability to write +miscellaneous extensions (like board testers, flash memory programmers, and so +on). diff --git a/misc/urjtag/Makefile b/misc/urjtag/Makefile new file mode 100644 index 00000000000..11f2515a907 --- /dev/null +++ b/misc/urjtag/Makefile @@ -0,0 +1,25 @@ +# $NetBSD: Makefile,v 1.1.1.1 2010/07/30 16:02:45 drochner Exp $ +# + +DISTNAME= urjtag-0.10 +CATEGORIES= misc +MASTER_SITES= http://downloads.sourceforge.net/project/urjtag/urjtag/0.10/ + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= http://downloads.sourceforge.net/project/urjtag/urjtag/0.10/ +COMMENT= JTAG tool +#LICENSE= # TODO: (see mk/license.mk) + +PKG_DESTDIR_SUPPORT= user-destdir + +GNU_CONFIGURE= yes +USE_PKGLOCALEDIR= yes +USE_TOOLS+= gmake bash:run +REPLACE_BASH= src/bsdl2jtag + +post-extract: + ${CP} ${FILESDIR}/usbprog.c ${WRKSRC}/src/tap/cable + +.include "../../devel/readline/buildlink3.mk" +.include "../../devel/libusb/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/misc/urjtag/PLIST b/misc/urjtag/PLIST new file mode 100644 index 00000000000..ceb815e2b10 --- /dev/null +++ b/misc/urjtag/PLIST @@ -0,0 +1,246 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2010/07/30 16:02:45 drochner Exp $ +bin/bsdl2jtag +bin/jtag +man/man1/bsdl2jtag.1 +man/man1/jtag.1 +share/urjtag/MANUFACTURERS +share/urjtag/admtek/adm5120/adm5120 +share/urjtag/altera/PARTS +share/urjtag/altera/ep1c12/STEPPINGS +share/urjtag/altera/ep1c12/ep1c12 +share/urjtag/altera/ep1c12/f256 +share/urjtag/altera/ep1c12/f324 +share/urjtag/altera/ep1c12/q240 +share/urjtag/altera/ep1c20f400/STEPPINGS +share/urjtag/altera/ep1c20f400/ep1c20f400 +share/urjtag/altera/ep1c6q240/STEPPINGS +share/urjtag/altera/ep1c6q240/ep1c6q240 +share/urjtag/altera/ep2c8/STEPPINGS +share/urjtag/altera/ep2c8/ep2c8 +share/urjtag/altera/ep2c8/f256 +share/urjtag/altera/ep2c8/q208 +share/urjtag/altera/ep2c8/t144 +share/urjtag/altera/epm3064a/STEPPINGS +share/urjtag/altera/epm3064a/epm3064a +share/urjtag/altera/epm3064a/l44 +share/urjtag/altera/epm3064a/t100 +share/urjtag/altera/epm3064a/t44 +share/urjtag/altera/epm7128aetc100/STEPPINGS +share/urjtag/altera/epm7128aetc100/epm7128aetc100 +share/urjtag/analog/PARTS +share/urjtag/analog/bf518/STEPPINGS +share/urjtag/analog/bf518/bf518 +share/urjtag/analog/bf527/STEPPINGS +share/urjtag/analog/bf527/bf527 +share/urjtag/analog/bf533/STEPPINGS +share/urjtag/analog/bf533/bf533 +share/urjtag/analog/bf537/STEPPINGS +share/urjtag/analog/bf537/bf537 +share/urjtag/analog/bf538/STEPPINGS +share/urjtag/analog/bf538/bf538 +share/urjtag/analog/bf548/STEPPINGS +share/urjtag/analog/bf548/bf548 +share/urjtag/analog/bf561/STEPPINGS +share/urjtag/analog/bf561/bf561 +share/urjtag/analog/sharc21065l/STEPPINGS +share/urjtag/analog/sharc21065l/sharc21065l +share/urjtag/atheros/ar2312/ar2312 +share/urjtag/atmel/PARTS +share/urjtag/atmel/at32ap7000/STEPPINGS +share/urjtag/atmel/at32ap7000/at32ap7000 +share/urjtag/atmel/at91sam7s256/STEPPINGS +share/urjtag/atmel/at91sam7s256/at91sam7s_tq48v0 +share/urjtag/atmel/at91sam7s256/at91sam7s_tq64v0 +share/urjtag/atmel/atf15xx/STEPPINGS +share/urjtag/atmel/atf15xx/atf1504asv +share/urjtag/atmel/atmega128/STEPPINGS +share/urjtag/atmel/atmega128/atmega128 +share/urjtag/brecis/PARTS +share/urjtag/brecis/msp2006/STEPPINGS +share/urjtag/brecis/msp2006/msp2006 +share/urjtag/broadcom/PARTS +share/urjtag/broadcom/bcm1250/STEPPINGS +share/urjtag/broadcom/bcm1250/bcm1250 +share/urjtag/broadcom/bcm3310/STEPPINGS +share/urjtag/broadcom/bcm3310/bcm3310 +share/urjtag/broadcom/bcm4712/STEPPINGS +share/urjtag/broadcom/bcm4712/bcm4712 +share/urjtag/broadcom/bcm5421s/STEPPINGS +share/urjtag/broadcom/bcm5421s/bcm5421s +share/urjtag/broadcom/bcm6358/STEPPINGS +share/urjtag/broadcom/bcm6358/bcm6358 +share/urjtag/bsdl/STD_1149_1_1990 +share/urjtag/bsdl/STD_1149_1_1994 +share/urjtag/bsdl/STD_1149_1_2001 +share/urjtag/bsdl/STD_1532_2001 +share/urjtag/bsdl/STD_1532_2002 +share/urjtag/dec/PARTS +share/urjtag/dec/sa1100/STEPPINGS +share/urjtag/dec/sa1100/sa1100 +share/urjtag/freescale/PARTS +share/urjtag/freescale/mpc5200/STEPPINGS +share/urjtag/freescale/mpc5200/mpc5200 +share/urjtag/hitachi/PARTS +share/urjtag/hitachi/ar7300/STEPPINGS +share/urjtag/hitachi/ar7300/ar7300 +share/urjtag/hitachi/hd64465/hd64465 +share/urjtag/hitachi/sh7727/STEPPINGS +share/urjtag/hitachi/sh7727/sh7727 +share/urjtag/hitachi/sh7729/STEPPINGS +share/urjtag/hitachi/sh7729/sh7729 +share/urjtag/ibm/PARTS +share/urjtag/ibm/ppc405ep/STEPPINGS +share/urjtag/ibm/ppc405ep/ppc405ep +share/urjtag/ibm/ppc440gx/STEPPINGS +share/urjtag/ibm/ppc440gx/ppc440gx +share/urjtag/intel/PARTS +share/urjtag/intel/ixp425/STEPPINGS +share/urjtag/intel/ixp425/ixp425 +share/urjtag/intel/pxa250/STEPPINGS +share/urjtag/intel/pxa250/pxa250 +share/urjtag/intel/pxa250/pxa250c0 +share/urjtag/intel/pxa270/STEPPINGS +share/urjtag/intel/pxa270/pxa270 +share/urjtag/intel/sa1110/STEPPINGS +share/urjtag/intel/sa1110/sa1110 +share/urjtag/lattice/PARTS +share/urjtag/lattice/lc4032v-tqfp48/STEPPINGS +share/urjtag/lattice/lc4032v-tqfp48/lc4032v-tqfp48 +share/urjtag/lattice/lc4064zc/STEPPINGS +share/urjtag/lattice/lc4064zc/lc4064zc +share/urjtag/lattice/lc4128c-tqfp100/STEPPINGS +share/urjtag/lattice/lc4128c-tqfp100/lc4128c-tqfp100 +share/urjtag/lattice/lfec2-12e/STEPPINGS +share/urjtag/lattice/lfec2-12e/lfec2-12e +share/urjtag/lattice/m4a3-256.192-fpbga256/STEPPINGS +share/urjtag/lattice/m4a3-256.192-fpbga256/m4a3-256.192-fpbga256 +share/urjtag/lattice/m4a3-64.32-tqfp48/STEPPINGS +share/urjtag/lattice/m4a3-64.32-tqfp48/m4a3-64.32-tqfp48 +share/urjtag/lexra/PARTS +share/urjtag/lexra/lx5280/STEPPINGS +share/urjtag/lexra/lx5280/lx5280 +share/urjtag/marvell/88e1118/88e1118 +share/urjtag/marvell/88e1118/STEPPINGS +share/urjtag/marvell/88f5182/88f5182-a2 +share/urjtag/marvell/88f5182/STEPPINGS +share/urjtag/marvell/PARTS +share/urjtag/motorola/mpc8241/1.2 +share/urjtag/motorola/mpc8245/1.2 +share/urjtag/philips/PARTS +share/urjtag/philips/xcr3128xl-cs144/STEPPINGS +share/urjtag/philips/xcr3128xl-cs144/xcr3128xl-cs144 +share/urjtag/philips/xcr3128xl-vq100/STEPPINGS +share/urjtag/philips/xcr3128xl-vq100/xcr3128xl-vq100 +share/urjtag/samsung/s3c4510b/s3c4510b +share/urjtag/sharp/PARTS +share/urjtag/sharp/lh7a400/STEPPINGS +share/urjtag/sharp/lh7a400/lh7a400 +share/urjtag/sigma/PARTS +share/urjtag/sigma/smp8634/STEPPINGS +share/urjtag/sigma/smp8634/smp8634 +share/urjtag/ti/PARTS +share/urjtag/ti/tnetv1060/STEPPINGS +share/urjtag/ti/tnetv1060/tnetv1060 +share/urjtag/ti/tnetv1061/STEPPINGS +share/urjtag/ti/tnetv1061/tnetv1061 +share/urjtag/toshiba/PARTS +share/urjtag/toshiba/tx4925/STEPPINGS +share/urjtag/toshiba/tx4925/tx4925 +share/urjtag/toshiba/tx4926/STEPPINGS +share/urjtag/toshiba/tx4926/tx4926 +share/urjtag/xilinx/PARTS +share/urjtag/xilinx/xc18v04pc44/STEPPINGS +share/urjtag/xilinx/xc18v04pc44/xc18v04pc44 +share/urjtag/xilinx/xc2c256-tq144/STEPPINGS +share/urjtag/xilinx/xc2c256-tq144/xc2c256-tq144 +share/urjtag/xilinx/xc2c256-vq100/STEPPINGS +share/urjtag/xilinx/xc2c256-vq100/xc2c256-vq100 +share/urjtag/xilinx/xc2c64a-vq44/STEPPINGS +share/urjtag/xilinx/xc2c64a-vq44/xc2c64a-vq44 +share/urjtag/xilinx/xc2s200e-pq208/STEPPINGS +share/urjtag/xilinx/xc2s200e-pq208/xc2s200e-pq208 +share/urjtag/xilinx/xc2s300e/STEPPINGS +share/urjtag/xilinx/xc2s300e/fg456 +share/urjtag/xilinx/xc2s300e/ft256 +share/urjtag/xilinx/xc2s300e/pq208 +share/urjtag/xilinx/xc2s300e/xc2s300e +share/urjtag/xilinx/xc2v1000-fg256/STEPPINGS +share/urjtag/xilinx/xc2v1000-fg256/xc2v1000-fg256 +share/urjtag/xilinx/xc2v250-fg256/STEPPINGS +share/urjtag/xilinx/xc2v250-fg256/xc2v250-fg256 +share/urjtag/xilinx/xc2v80-fg256/STEPPINGS +share/urjtag/xilinx/xc2v80-fg256/xc2v80-fg256 +share/urjtag/xilinx/xc3s1000/STEPPINGS +share/urjtag/xilinx/xc3s1000/fg320 +share/urjtag/xilinx/xc3s1000/fg456 +share/urjtag/xilinx/xc3s1000/fg676 +share/urjtag/xilinx/xc3s1000/ft256 +share/urjtag/xilinx/xc3s1000/xc3s1000 +share/urjtag/xilinx/xc3s100e_die/STEPPINGS +share/urjtag/xilinx/xc3s100e_die/xc3s100e_die +share/urjtag/xilinx/xc3s100e_die/xc3s100e_pq208 +share/urjtag/xilinx/xc3s100e_die/xc3s100e_tq144 +share/urjtag/xilinx/xc3s100e_die/xc3s100e_vq100 +share/urjtag/xilinx/xc3s1500/STEPPINGS +share/urjtag/xilinx/xc3s1500/xc3s1500 +share/urjtag/xilinx/xc3s1500/xc3s1500_fg320 +share/urjtag/xilinx/xc3s1500/xc3s1500_fg456 +share/urjtag/xilinx/xc3s1500/xc3s1500_fg676 +share/urjtag/xilinx/xc3s1500/xc3s1500l +share/urjtag/xilinx/xc3s1500/xc3s1500l_fg320 +share/urjtag/xilinx/xc3s1500/xc3s1500l_fg456 +share/urjtag/xilinx/xc3s1500/xc3s1500l_fg676 +share/urjtag/xilinx/xc3s200/STEPPINGS +share/urjtag/xilinx/xc3s200/xc3s200 +share/urjtag/xilinx/xc3s200/xc3s200_ft256 +share/urjtag/xilinx/xc3s200/xc3s200_pq208 +share/urjtag/xilinx/xc3s200/xc3s200_tq144 +share/urjtag/xilinx/xc3s200/xc3s200_vq100 +share/urjtag/xilinx/xc3s2000/STEPPINGS +share/urjtag/xilinx/xc3s2000/xc3s2000 +share/urjtag/xilinx/xc3s2000/xc3s2000_fg456 +share/urjtag/xilinx/xc3s2000/xc3s2000_fg676 +share/urjtag/xilinx/xc3s2000/xc3s2000_fg900 +share/urjtag/xilinx/xc3s2000/xc3s2000l +share/urjtag/xilinx/xc3s2000/xc3s2000l_fg676 +share/urjtag/xilinx/xc3s2000/xc3s2000l_fg900 +share/urjtag/xilinx/xc3s400/STEPPINGS +share/urjtag/xilinx/xc3s400/xc3s400 +share/urjtag/xilinx/xc3s400/xc3s400_fg320 +share/urjtag/xilinx/xc3s400/xc3s400_fg456 +share/urjtag/xilinx/xc3s400/xc3s400_ft256 +share/urjtag/xilinx/xc3s400/xc3s400_pq208 +share/urjtag/xilinx/xc3s400/xc3s400_tq144 +share/urjtag/xilinx/xc3s4000/STEPPINGS +share/urjtag/xilinx/xc3s4000/xc3s4000 +share/urjtag/xilinx/xc3s4000/xc3s4000_fg1156 +share/urjtag/xilinx/xc3s4000/xc3s4000_fg676 +share/urjtag/xilinx/xc3s4000/xc3s4000_fg900 +share/urjtag/xilinx/xc3s4000/xc3s4000l +share/urjtag/xilinx/xc3s4000/xc3s4000l_fg1156 +share/urjtag/xilinx/xc3s4000/xc3s4000l_fg900 +share/urjtag/xilinx/xc3s50/STEPPINGS +share/urjtag/xilinx/xc3s50/xc3s50 +share/urjtag/xilinx/xc3s50/xc3s50_cp132 +share/urjtag/xilinx/xc3s50/xc3s50_pq208 +share/urjtag/xilinx/xc3s50/xc3s50_tq144 +share/urjtag/xilinx/xc3s50/xc3s50_vq100 +share/urjtag/xilinx/xc3s5000/STEPPINGS +share/urjtag/xilinx/xc3s5000/xc3s5000 +share/urjtag/xilinx/xc3s5000/xc3s5000_fg1156 +share/urjtag/xilinx/xc3s5000/xc3s5000_fg900 +share/urjtag/xilinx/xc3s500e_fg320/STEPPINGS +share/urjtag/xilinx/xc3s500e_fg320/xc3s500e_fg320 +share/urjtag/xilinx/xc3s500e_fg320/xc3s500e_ft256 +share/urjtag/xilinx/xc3s500e_fg320/xc3s500e_pq208 +share/urjtag/xilinx/xc9572xl_vq44/STEPPINGS +share/urjtag/xilinx/xc9572xl_vq44/xc9572xl_vq44 +share/urjtag/xilinx/xcf04s/STEPPINGS +share/urjtag/xilinx/xcf04s/xcf04s +share/urjtag/xilinx/xcr3032xl-vq44/STEPPINGS +share/urjtag/xilinx/xcr3032xl-vq44/xcr3032xl-vq44 +share/urjtag/xilinx/xcr3128xl-cs144/STEPPINGS +share/urjtag/xilinx/xcr3128xl-cs144/xcr3128xl-cs144 +share/urjtag/xilinx/xcr3128xl-vq100/xcr3128xl-vq100 +share/urjtag/xilinx/xcr3256xl-ft256/STEPPINGS +share/urjtag/xilinx/xcr3256xl-ft256/xcr3256xl-ft256 diff --git a/misc/urjtag/distinfo b/misc/urjtag/distinfo new file mode 100644 index 00000000000..560fc70f380 --- /dev/null +++ b/misc/urjtag/distinfo @@ -0,0 +1,8 @@ +$NetBSD: distinfo,v 1.1.1.1 2010/07/30 16:02:45 drochner Exp $ + +SHA1 (urjtag-0.10.tar.gz) = 1e21f07d758e9e151d932e95c0b3b11fd178eace +RMD160 (urjtag-0.10.tar.gz) = d22dcaf8447e594f5fbb25836df141e2a451760a +Size (urjtag-0.10.tar.gz) = 1391759 bytes +SHA1 (patch-aa) = 0c5128a37f763eb5f436f7682cbb1172f1c8fe40 +SHA1 (patch-ab) = 1187447787012901d59f8967ae08c1047e23f38e +SHA1 (patch-ac) = 1d241fb503e45a57f63f87eeada6804dbb278502 diff --git a/misc/urjtag/files/usbprog.c b/misc/urjtag/files/usbprog.c new file mode 100644 index 00000000000..f28aad5734c --- /dev/null +++ b/misc/urjtag/files/usbprog.c @@ -0,0 +1,188 @@ +/* $NetBSD: usbprog.c,v 1.1.1.1 2010/07/30 16:02:45 drochner Exp $ */ + +/* Written by Matthias Drochner. Public domain. */ + +#include "sysdep.h" + +#include "cable.h" +#include "chain.h" + +#include "generic.h" +#include "generic_usbconn.h" + +#include "usbconn.h" +#include "usbconn/libusb.h" + +#include <errno.h> +#include <string.h> + +/* for use with the "usbprogJTAG" firmware */ +#define PIN_TDI 7 +#define PIN_SRST 6 +#define PIN_TRST 5 +#define PIN_TMS 4 +#define PIN_TCK 2 +#define PIN_TDO 0 + +static int +usbprog_xfer(usb_dev_handle *h, char *d, int len, int rd) +{ + int res; + unsigned char buf[2]; + + res = usb_bulk_write(h, 3, d, len, 100); + if (res != len) { + fprintf(stderr, "xfer wr: %d\n", res); + return (-1); + } + if (!rd) + return 0; + res = usb_bulk_read(h, 2, buf, 2, 100); + if (res <= 0) { + fprintf(stderr, "xfer rd: %d\n", res); + return (-1); + } + return (buf[1]); +} + +static int +usbprog_init(cable_t *cable) +{ + int res; + struct usb_dev_handle *h; + unsigned char cmd[2]; + + res = usbconn_open(cable->link.usb); + if (res) + return (-1); + h = ((libusb_param_t*)(cable->link.usb->params))->handle; + + cmd[0] = 0x01; /* PORT_DIRECTION */ + cmd[1] = (1 << PIN_TDI) | (1 << PIN_TMS) | (1 << PIN_TCK) + | (1 << PIN_SRST) | (1 << PIN_TRST); + res = usbprog_xfer(h, cmd, 2, 0); + if (res) + fprintf(stderr, "usbprog_init: error %d\n", res); + return 0; +} + +static void +usbprog_setport(cable_t *cable, unsigned char val) +{ + struct usb_dev_handle *h; + unsigned char cmd[2]; + int res; + + h = ((libusb_param_t*)(cable->link.usb->params))->handle; + cmd[0] = 2; /* PORT_SET */ + cmd[1] = val; + res = usbprog_xfer(h, cmd, 2, 0); + if (res) + fprintf(stderr, "usbprog_setport: error %d\n", res); +} + +static void +usbprog_clock(cable_t *cable, int tms, int tdi, int n) +{ + int i; + + for (i = 0; i < n; i++) { + usbprog_setport(cable, (0 << PIN_TCK) | (tms << PIN_TMS) + | (tdi << PIN_TDI)); + cable_wait(cable); + usbprog_setport(cable, (1 << PIN_TCK) | (tms << PIN_TMS) + | (tdi << PIN_TDI)); + cable_wait(cable); + } +} + +static int +usbprog_get_tdo(cable_t *cable) +{ + struct usb_dev_handle *h; + unsigned char cmd[2]; + int res; + + h = ((libusb_param_t*)(cable->link.usb->params))->handle; + + usbprog_setport(cable, 0); + cable_wait(cable); + + cmd[0] = 3; /* PORT_GET */ + cmd[1] = 0; + res = usbprog_xfer(h, cmd, 2, 1); + if (res < 0) + fprintf(stderr, "usbprog_get_tdo: error %d\n", res); + return ((res >> PIN_TDO) & 1); +} + +static int +usbprog_set_signal(cable_t *cable, int mask, int val) +{ + + fprintf(stderr, "usbprog_set_signal called(%x, %x)\n", mask, val); + return 1; +} + +static int +usbprog_transfer(cable_t *cable, int len, char *in, char *out ) +{ + struct usb_dev_handle *h; + unsigned char cmd[64]; /* ??? */ + unsigned char ans[64]; /* ??? */ + int blen, i, res; + + if (len < 3) + return (generic_transfer(cable, len, in, out)); + + h = ((libusb_param_t*)(cable->link.usb->params))->handle; + + memset(cmd, 0, sizeof(cmd)); + cmd[0] = 0x08; /* WRITE_AND_READ */ + cmd[1] = len / 256; + cmd[2] = len % 256; + blen = (len + 7) / 8; + for (i = 0; i < len; i++) + cmd[3 + i / 8] |= in[i] << (i % 8); + + res = usb_bulk_write(h, 3, cmd, blen + 3, 100); + if (res != blen + 3) + fprintf(stderr, "usbprog_transfer: write error\n"); + res = usb_bulk_read(h, 2, ans, 64, 500); + if (res != 64) + fprintf(stderr, "usbprog_transfer: read %d\n", res); + if (!out) + return len; + for (i = 0; i < len; i++) + if (ans[3 + i / 8] & (1 << (i % 8))) + out[i] = 1; + else + out[i] = 0; + return len; +} + +cable_driver_t usbprog_cable_driver = { + "usbprog", + "usbprog with usbprogJTAG firmware", + generic_usbconn_connect, + generic_disconnect, + generic_usbconn_free, + usbprog_init, + generic_usbconn_done, + generic_set_frequency, + usbprog_clock, + usbprog_get_tdo, + usbprog_transfer, + usbprog_set_signal, + generic_get_signal, + generic_flush_using_transfer, + generic_usbconn_help +}; + +usbconn_cable_t usbconn_cable_usbprog = { + "usbprog", /* cable name */ + NULL, /* string pattern, not used */ + "libusb", /* usbconn driver */ + 0x1781, /* VID (MetaGeek?) */ + 0x0c62 /* PID (usbprog) */ +}; diff --git a/misc/urjtag/patches/patch-aa b/misc/urjtag/patches/patch-aa new file mode 100644 index 00000000000..ef566edc9c0 --- /dev/null +++ b/misc/urjtag/patches/patch-aa @@ -0,0 +1,32 @@ +$NetBSD: patch-aa,v 1.1.1.1 2010/07/30 16:02:45 drochner Exp $ + +--- src/tap/Makefile.in.orig 2009-04-17 20:25:38.000000000 +0000 ++++ src/tap/Makefile.in +@@ -217,7 +217,7 @@ am_libtap_a_OBJECTS = tap.$(OBJEXT) regi + $(am__objects_14) $(am__objects_15) $(am__objects_16) \ + $(am__objects_17) $(am__objects_18) $(am__objects_19) \ + $(am__objects_20) $(am__objects_21) $(am__objects_22) \ +- $(am__objects_23) ++ $(am__objects_23) usbprog.$(OBJEXT) + libtap_a_OBJECTS = $(am_libtap_a_OBJECTS) + DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) + depcomp = $(SHELL) $(top_srcdir)/tools/depcomp +@@ -360,7 +360,7 @@ libtap_a_SOURCES = tap.c register.c stat + $(am__append_13) $(am__append_14) $(am__append_15) \ + $(am__append_16) $(am__append_17) $(am__append_18) \ + $(am__append_19) $(am__append_20) $(am__append_21) \ +- $(am__append_22) $(am__append_23) ++ $(am__append_22) $(am__append_23) usbprog.c + all: all-am + + .SUFFIXES: +@@ -853,6 +853,9 @@ vision_ep9307.obj: cable/vision_ep9307.c + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vision_ep9307.obj `if test -f 'cable/vision_ep9307.c'; then $(CYGPATH_W) 'cable/vision_ep9307.c'; else $(CYGPATH_W) '$(srcdir)/cable/vision_ep9307.c'; fi` + ++usbprog.o: cable/usbprog.c ++ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o usbprog.o cable/usbprog.c ++ + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ diff --git a/misc/urjtag/patches/patch-ab b/misc/urjtag/patches/patch-ab new file mode 100644 index 00000000000..712bb6e85f9 --- /dev/null +++ b/misc/urjtag/patches/patch-ab @@ -0,0 +1,20 @@ +$NetBSD: patch-ab,v 1.1.1.1 2010/07/30 16:02:45 drochner Exp $ + +--- src/tap/cable.c.orig 2009-04-17 20:24:10.000000000 +0000 ++++ src/tap/cable.c +@@ -69,6 +69,7 @@ extern cable_driver_t xpc_ext_cable_driv + extern cable_driver_t jlink_cable_driver; + extern cable_driver_t ep9307_cable_driver; + extern cable_driver_t ts7800_cable_driver; ++extern cable_driver_t usbprog_cable_driver; + + cable_driver_t *cable_drivers[] = { + #ifdef ENABLE_CABLE_ARCOM +@@ -143,6 +144,7 @@ cable_driver_t *cable_drivers[] = { + #ifdef ENABLE_CABLE_TS7800 + &ts7800_cable_driver, + #endif ++ &usbprog_cable_driver, + NULL /* last must be NULL */ + }; + diff --git a/misc/urjtag/patches/patch-ac b/misc/urjtag/patches/patch-ac new file mode 100644 index 00000000000..efcf2d8ddba --- /dev/null +++ b/misc/urjtag/patches/patch-ac @@ -0,0 +1,20 @@ +$NetBSD: patch-ac,v 1.1.1.1 2010/07/30 16:02:45 drochner Exp $ + +--- src/tap/cable/generic_usbconn.c.orig 2009-04-17 20:24:10.000000000 +0000 ++++ src/tap/cable/generic_usbconn.c +@@ -86,6 +86,7 @@ extern usbconn_cable_t usbconn_cable_nio + extern usbconn_cable_t usbconn_cable_usb_jtag_ftdi; + #endif + #endif ++extern usbconn_cable_t usbconn_cable_usbprog; + + usbconn_cable_t *usbconn_cables[] = + { +@@ -138,6 +139,7 @@ usbconn_cable_t *usbconn_cables[] = + &usbconn_cable_usb_jtag_ftdi, + #endif + #endif ++ &usbconn_cable_usbprog, + NULL + }; + |