From aed36bb341eaa4344cb548a6e78c5ac94b03a6cd Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Thu, 27 Nov 2008 15:11:07 +0100
Subject: [PATCH 01/16] Let usb-driver work with a no-module kernel by Gyorgy
'nog' Jeney
---
usb-driver.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/usb-driver.c b/usb-driver.c
index e2f275f..264366b 100644
--- a/usb-driver.c
+++ b/usb-driver.c
@@ -559,6 +559,12 @@ FILE *fopen(const char *path, const char *mode) {
if (!strcmp(path, "/proc/modules")) {
DPRINTF("opening /proc/modules\n");
+ if (!ret && errno == ENOENT) {
+ /* Hmm.. there appears to be no /proc/modules file
+ * fake it then */
+ ret = (*func)("/dev/null", mode);
+ DPRINTF("No /proc/modules -- faking\n");
+ }
#ifdef NO_WINDRVR
modulesfp = ret;
modules_read = 0;
--
2.39.5
From 06f5f9d0373c1578065956072625e2398a88b29a Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 31 May 2009 18:22:41 +0200
Subject: [PATCH 02/16] ISE 11.1 notes
---
index.html | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/index.html b/index.html
index d005e9b..4a4369c 100644
--- a/index.html
+++ b/index.html
@@ -30,18 +30,28 @@
The library is called libusb-driver as it was developed to support the USB cable, but later
extended to also support parallel cables.
- News (2008-03-26): Xilinx has released their own drivers based on libusb with ISE Design Suite 10.1.
- To use them, you need to set the environment-variable XIL_IMPACT_USE_LIBUSB to 1
- before running the tools. The driver on this page no longer needs to be preloaded if you only used
- it to access USB cables. Parallel port support still seems to rely on windrvr, which can be
- emulated by libusb-driver.
- Using 32-bit ISE 10.1 on a 64-bit platform: When using the 32-bit JTAG tools from ISE Design
- Suite 10.1 on a 64-bit machine, the tools will not connect to the cable but output the following
- error: Cable operation is not supported when running the 32-bit version of the application on a
- 64-bit platform.
- To fix this, run the tools with linux32 or preload the newest 32-bit version of
- libusb-driver. This will lead the tools to believe that they are running on a 32-bit
- platform and allows them to connect to the cable.
+
News
+
+ - 2008-03-26: Xilinx has released their own drivers based on libusb with ISE Design Suite 10.1.
+ To use them, you need to set the environment-variable XIL_IMPACT_USE_LIBUSB to 1
+ before running the tools. The driver on this page no longer needs to be preloaded if you only used
+ it to access USB cables. Parallel port support still seems to rely on windrvr, which can be
+ emulated by libusb-driver.
+
Using 32-bit ISE 10.1 on a 64-bit platform: When using the 32-bit JTAG tools from ISE Design
+ Suite 10.1 on a 64-bit machine, the tools will not connect to the cable but output the following
+ error: Cable operation is not supported when running the 32-bit version of the application on a
+ 64-bit platform.
+ To fix this, run the tools with linux32 or preload the newest 32-bit version of
+ libusb-driver. This will lead the tools to believe that they are running on a 32-bit
+ platform and allows them to connect to the cable.
+
+ - 2009-05-31: ISE Design Suite 11.1 now uses their libusb based drivers as default, without
+ the need to set XIL_IMPACT_USE_LIBUSB. If you want to use this driver with ISE 11.1 for USB
+ cables and disable the builtin support for libusb, you now have to set XIL_IMPACT_USE_LIBUSB
+ to 0 (export XIL_IMPACT_USE_LIBUSB=0 or setenv XIL_IMPACT_USE_LIBUSB 0).
+ For parallel cables Xilinx still relies on windrvr. This library works fine with parallel cables and
+ ISE 11.1 with no need for windrvr.
+
Supported Cables
The following cables are reported to work with this driver:
@@ -67,6 +77,7 @@
Supported Software
The following software is reported to work with this driver:
+ - ISE Webpack 11.1
- ISE Webpack 10.1
- ISE Webpack 9.2 SP1, SP2, SP3 and SP4
- ISE Webpack 9.1 SP1, SP2 and SP3
--
2.39.5
From 740b45f5cad8371f2e43c37ab1f3fb9d4d64c3cc Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 31 May 2009 18:23:05 +0200
Subject: [PATCH 03/16] ISE 11.1 is supported
---
README | 1 +
1 file changed, 1 insertion(+)
diff --git a/README b/README
index a148bf3..265dd39 100644
--- a/README
+++ b/README
@@ -9,6 +9,7 @@ should work on every kernel version which is supported by libusb and supports
ppdev. It was written against impact from ISE Webpack 9.1SP1 and tested with
the following software:
+ * ISE Webpack 11.1
* ISE Webpack 10.1
* ISE Webpack 9.2SP1, SP2, SP3, SP4
* ISE Webpack 9.1SP1, SP2, SP3
--
2.39.5
From f10305a8cbc14729ce6f610b966522e7d35020c1 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 31 May 2009 18:26:14 +0200
Subject: [PATCH 04/16] XILINX Platform Cable USB II works
Tested and confirmed by David Epping (Uni Ulm)
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 4a4369c..14a3f9a 100644
--- a/index.html
+++ b/index.html
@@ -56,6 +56,7 @@
Supported Cables
The following cables are reported to work with this driver:
These cables should work but have not yet been tested:
- - XILINX Platform Cable USB II
- Integrated Platform Cable USB on other development boards
- other Parallel Cable III clones
- other FTDI2232 based devices which use the chips standard JTAG pinout (experimental)
--
2.39.5
From 7b219d308d74d4ab41643207b0ee37fb2dbbe632 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 28 Feb 2010 21:09:32 +0100
Subject: [PATCH 05/16] information for newer udev versions
---
README | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/README b/README
index 265dd39..055780f 100644
--- a/README
+++ b/README
@@ -57,7 +57,7 @@ Notes for the USB cable
To use the device as an ordinary user, put the following line in a new
file "libusb-driver.rules" in /etc/udev/rules.d/ and restart udev:
-ACTION=="add", BUS=="usb", SYSFS{idVendor}=="03fd", MODE="666"
+ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03fd", MODE="666"
If your cable does not have the ID 03fd:0008 in the output of lsusb,
@@ -68,12 +68,16 @@ these steps:
1. If you have no /etc/udev/rules.d/xusbdfwu.rules file, copy it from
/path/to/ISE/bin/lin/xusbdfwu.rules to /etc/udev/rules.d/xusbdfwu.rules
-2. Install the package containing /sbin/fxload from your linux distribution.
+2. If you are running a newer version of udev (as in Debian Squeeze and
+ Ubuntu 9.10), you need to adapt the rules-file to the new udev-version:
+ sed -i -e 's/TEMPNODE/tempnode/' -e 's/SYSFS/ATTRS/g' -e 's/BUS/SUBSYSTEMS/' /etc/udev/rules.d/xusbdfwu.rules
+
+3. Install the package containing /sbin/fxload from your linux distribution.
It is usually called "fxload"
-3. copy the files /path/to/ISE/bin/lin/xusb*.hex to /usr/share/
+4. copy the files /path/to/ISE/bin/lin/xusb*.hex to /usr/share/
-4. restart udev and re-plug the cable
+5. restart udev and re-plug the cable
If you have multiple cables connected, you can specify the cable to use
@@ -140,7 +144,7 @@ To set-up the device:
3. To use the device as an ordinary user, put the following line in a new file
in /etc/udev/rules.d/ and restart udev:
- ACTION=="add", BUS=="usb", SYSFS{idVendor}=="0403", SYSFS{idProduct}=="cff8", MODE="666"
+ ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="666"
(replace the vendor and product id with your values)
The support for FTDI 2232 based devices is experimental and they are currently
--
2.39.5
From cc424c9bea54daee69205227bea3974572ad9b25 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Mon, 15 Mar 2010 14:43:02 +0100
Subject: [PATCH 06/16] Add note about newer udev versions and how to get it
working again
---
index.html | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/index.html b/index.html
index 14a3f9a..a9fd6af 100644
--- a/index.html
+++ b/index.html
@@ -32,7 +32,7 @@
News
- - 2008-03-26: Xilinx has released their own drivers based on libusb with ISE Design Suite 10.1.
+
2008-03-26: Xilinx has released their own drivers based on libusb with ISE Design Suite 10.1.
To use them, you need to set the environment-variable XIL_IMPACT_USE_LIBUSB to 1
before running the tools. The driver on this page no longer needs to be preloaded if you only used
it to access USB cables. Parallel port support still seems to rely on windrvr, which can be
@@ -43,14 +43,21 @@
64-bit platform.
To fix this, run the tools with linux32 or preload the newest 32-bit version of
libusb-driver. This will lead the tools to believe that they are running on a 32-bit
- platform and allows them to connect to the cable.
+ platform and allows them to connect to the cable.
- - 2009-05-31: ISE Design Suite 11.1 now uses their libusb based drivers as default, without
+
2009-05-31: ISE Design Suite 11.1 now uses their libusb based drivers as default, without
the need to set XIL_IMPACT_USE_LIBUSB. If you want to use this driver with ISE 11.1 for USB
cables and disable the builtin support for libusb, you now have to set XIL_IMPACT_USE_LIBUSB
to 0 (export XIL_IMPACT_USE_LIBUSB=0 or setenv XIL_IMPACT_USE_LIBUSB 0).
For parallel cables Xilinx still relies on windrvr. This library works fine with parallel cables and
- ISE 11.1 with no need for windrvr.
+ ISE 11.1 with no need for windrvr.
+
+ 2010-03-15: If you are using newer udev-versions (like the version included in Debian Squeeze
+ and Ubuntu 9.10), then the file /etc/udev/rules.d/xusbdfwu.rules is incompatible with this udev
+ version. The effect of this is that the cable-firmware gets never loaded and the cable led never lights up.
+ To fix this, run the following command as root:
+ sed -i -e 's/TEMPNODE/tempnode/' -e 's/SYSFS/ATTRS/g' -e 's/BUS/SUBSYSTEMS/' /etc/udev/rules.d/xusbdfwu.rules
+ You may have to reboot for this change to take effect.
Supported Cables
--
2.39.5
From 4d5f52f3c64d117466aebe293dbdc6411803f87b Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Mon, 15 Mar 2010 18:06:36 +0100
Subject: [PATCH 07/16] ISE 11
---
index.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index a9fd6af..8861ba6 100644
--- a/index.html
+++ b/index.html
@@ -45,7 +45,7 @@
libusb-driver. This will lead the tools to believe that they are running on a 32-bit
platform and allows them to connect to the cable.
- 2009-05-31: ISE Design Suite 11.1 now uses their libusb based drivers as default, without
+
2009-05-31: ISE Design Suite 11.1 now uses Xilinx's libusb-based drivers as default, without
the need to set XIL_IMPACT_USE_LIBUSB. If you want to use this driver with ISE 11.1 for USB
cables and disable the builtin support for libusb, you now have to set XIL_IMPACT_USE_LIBUSB
to 0 (export XIL_IMPACT_USE_LIBUSB=0 or setenv XIL_IMPACT_USE_LIBUSB 0).
@@ -84,7 +84,7 @@
Supported Software
The following software is reported to work with this driver:
+
+ 2010-05-22: Support for ISE 12 is now available in the driver, the presence of "windrvr6"
+ is recognized again.
Supported Cables
diff --git a/usb-driver.c b/usb-driver.c
index 264366b..504a278 100644
--- a/usb-driver.c
+++ b/usb-driver.c
@@ -672,3 +672,11 @@ int uname (struct utsname *__name) {
return ret;
}
#endif
+
+/* Ugly hack for ISE 12. They don't seem to open /proc/modules with
+ * open() anymore... */
+int _Z14isModuleLoadedPci(void) {
+ DPRINTF("Faking _Z14isModuleLoadedPci\n");
+
+ return 1;
+}
--
2.39.5
From b316fb2f6fab6acf253eb4fbe67213ebb9baf202 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sat, 22 May 2010 13:30:47 +0200
Subject: [PATCH 09/16] add ISE 12 to the list of supported software
---
README | 1 +
index.html | 1 +
2 files changed, 2 insertions(+)
diff --git a/README b/README
index 055780f..6bf1097 100644
--- a/README
+++ b/README
@@ -9,6 +9,7 @@ should work on every kernel version which is supported by libusb and supports
ppdev. It was written against impact from ISE Webpack 9.1SP1 and tested with
the following software:
+ * ISE 12.1
* ISE Webpack 11.1
* ISE Webpack 10.1
* ISE Webpack 9.2SP1, SP2, SP3, SP4
diff --git a/index.html b/index.html
index ae82464..a36ae5c 100644
--- a/index.html
+++ b/index.html
@@ -87,6 +87,7 @@
Supported Software
The following software is reported to work with this driver:
+ - ISE 12 (all editions)
- ISE 11 (all editions)
- ISE Webpack 10.1
- ISE Webpack 9.2 SP1, SP2, SP3 and SP4
--
2.39.5
From 9f78065e213deae9b29c035ac6ea6dc767139aca Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 23 May 2010 00:11:02 +0200
Subject: [PATCH 10/16] fix prototype for _Z14isModuleLoadedPci
---
usb-driver.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/usb-driver.c b/usb-driver.c
index 504a278..6a7df90 100644
--- a/usb-driver.c
+++ b/usb-driver.c
@@ -673,10 +673,13 @@ int uname (struct utsname *__name) {
}
#endif
-/* Ugly hack for ISE 12. They don't seem to open /proc/modules with
- * open() anymore... */
-int _Z14isModuleLoadedPci(void) {
- DPRINTF("Faking _Z14isModuleLoadedPci\n");
+/*
+ * Ugly hack for ISE 12. They don't seem to open /proc/modules with
+ * open() anymore...
+ * echo '_Z14isModuleLoadedPci' | c++filt
+ */
+int _Z14isModuleLoadedPci(char *module_name, int i) {
+ DPRINTF("_Z14isModuleLoadedPci: Checking for module %s (%d)\n", module_name, i);
return 1;
}
--
2.39.5
From daa4fc041d1e4fdc5fb2834851a6d371ee573c02 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 23 May 2010 01:18:13 +0200
Subject: [PATCH 11/16] Don't overload uname but set personality in library
constructor
This fixes planAhead crashing on startup
---
usb-driver.c | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/usb-driver.c b/usb-driver.c
index 6a7df90..44a280b 100644
--- a/usb-driver.c
+++ b/usb-driver.c
@@ -41,6 +41,8 @@
#include
#include
#include
+#include
+#include
#include "usb-driver.h"
#include "config.h"
#include "xpcu.h"
@@ -655,24 +657,6 @@ int semop (int __semid, struct sembuf *__sops, size_t __nsops) {
}
#endif
-#if __WORDSIZE == 32
-int uname (struct utsname *__name) {
- static int (*func) (struct utsname*);
- int ret;
-
- if (!func)
- func = (int (*) (struct utsname*)) dlsym(RTLD_NEXT, "uname");
-
- ret = (*func)(__name);
-
- if (ret == 0 && (!strcmp(__name->machine, "x86_64"))) {
- strcpy(__name->machine, "i686");
- }
-
- return ret;
-}
-#endif
-
/*
* Ugly hack for ISE 12. They don't seem to open /proc/modules with
* open() anymore...
@@ -683,3 +667,17 @@ int _Z14isModuleLoadedPci(char *module_name, int i) {
return 1;
}
+
+static void __attribute__ ((constructor)) libusbdriver_init(void) {
+ #if __WORDSIZE == 32
+ struct utsname un;
+ int ret;
+
+ ret = uname(&un);
+
+ if (ret == 0 && (!strcmp(un.machine, "x86_64"))) {
+ DPRINTF("setting 32bit personality\n");
+ (long)syscall(SYS_personality, PER_LINUX32);
+ }
+ #endif
+}
--
2.39.5
From 80a14787b97779d86558f414d23f7058b8654c94 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 23 May 2010 17:01:17 +0200
Subject: [PATCH 12/16] fix ISE 12 support on 64bit
---
usb-driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usb-driver.c b/usb-driver.c
index 44a280b..55a7463 100644
--- a/usb-driver.c
+++ b/usb-driver.c
@@ -662,7 +662,7 @@ int semop (int __semid, struct sembuf *__sops, size_t __nsops) {
* open() anymore...
* echo '_Z14isModuleLoadedPci' | c++filt
*/
-int _Z14isModuleLoadedPci(char *module_name, int i) {
+long int _Z14isModuleLoadedPci(char *module_name, int i) {
DPRINTF("_Z14isModuleLoadedPci: Checking for module %s (%d)\n", module_name, i);
return 1;
--
2.39.5
From 4c90fa3933cc179d7818fb1a94f7e5a40ffcc29d Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 23 May 2010 17:40:11 +0200
Subject: [PATCH 13/16] Always set return value for parallel ports
This fixes a crash in ISE 12 but does not lead to working parallel
port suppoet
---
usb-driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/usb-driver.c b/usb-driver.c
index 55a7463..3bfeee5 100644
--- a/usb-driver.c
+++ b/usb-driver.c
@@ -115,6 +115,7 @@ static int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
#ifndef NO_WINDRVR
ret = (*ioctl_func) (fd, request, wdioctl);
#else
+ cr->hCard = 0;
pport = config_get((unsigned long)cr->Card.Item[0].I.IO.dwAddr / 0x10);
if (!pport)
--
2.39.5
From b05f6dfed563db7c6d89e60d0fcf4d5bf8c03867 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 23 May 2010 23:10:41 +0200
Subject: [PATCH 14/16] Add initial parallel port support for ISE 12.
Only ports existing on the local system can be used for real
or ftdi-emulated cables. So you can't attach a ftdi-cable
to your non-existant LPT4 currently.
---
usb-driver.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/usb-driver.c b/usb-driver.c
index 3bfeee5..ff47ae3 100644
--- a/usb-driver.c
+++ b/usb-driver.c
@@ -659,8 +659,10 @@ int semop (int __semid, struct sembuf *__sops, size_t __nsops) {
#endif
/*
- * Ugly hack for ISE 12. They don't seem to open /proc/modules with
- * open() anymore...
+ * Ugly hack for ISE 12. Preload doesn't seem to work correctly for
+ * libImpactComm.so. Even though the file is still read with fopen(),
+ * the version from libc is used and not the one from this file.
+ * Replace the function calling fopen() instead...
* echo '_Z14isModuleLoadedPci' | c++filt
*/
long int _Z14isModuleLoadedPci(char *module_name, int i) {
@@ -670,6 +672,22 @@ long int _Z14isModuleLoadedPci(char *module_name, int i) {
}
static void __attribute__ ((constructor)) libusbdriver_init(void) {
+ int i;
+ char buf[256];
+ char buf2[256];
+
+ for (i = 0; i < 4; i++) {
+ snprintf(buf, sizeof(buf), "XIL_IMPACT_ENV_LPT%d_BASE_ADDRESS", i+1);
+ snprintf(buf2, sizeof(buf2), "%x", 0x10*i);
+ setenv(buf, buf2, 1);
+ snprintf(buf, sizeof(buf), "XIL_IMPACT_ENV_LPT%d_ECP_ADDRESS", i+1);
+ snprintf(buf2, sizeof(buf2), "%x", (0x10*i)+0x400);
+ setenv(buf, buf2, 1);
+ }
+
+ setenv("XIL_IMPACT_USE_LIBUSB", "0", 1);
+ setenv("XIL_IMPACT_USE_WINDRIVER", "1", 1);
+
#if __WORDSIZE == 32
struct utsname un;
int ret;
--
2.39.5
From 0915c0b59cf76f9c83d35931bc2613eadf0c9bb7 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 23 May 2010 23:23:13 +0200
Subject: [PATCH 15/16] Describe problems with parallel cables
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index a36ae5c..6c46327 100644
--- a/index.html
+++ b/index.html
@@ -60,7 +60,7 @@
You may have to reboot for this change to take effect.
2010-05-22: Support for ISE 12 is now available in the driver, the presence of "windrvr6"
- is recognized again.
+ is recognized again. Support for parallel/ftdi-cables is currently limited to existing parallel ports only. So you can't use an ftdi-emulated cable on a non-existing parallel port. Using it on a physically preent port still works.
Supported Cables
--
2.39.5
From 277c47548adc78a33f7744dc11d86e961ffe31b5 Mon Sep 17 00:00:00 2001
From: Michael Gernoth
Date: Sun, 23 May 2010 23:24:00 +0200
Subject: [PATCH 16/16] typo
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 6c46327..b4600d8 100644
--- a/index.html
+++ b/index.html
@@ -60,7 +60,7 @@
You may have to reboot for this change to take effect.
2010-05-22: Support for ISE 12 is now available in the driver, the presence of "windrvr6"
- is recognized again. Support for parallel/ftdi-cables is currently limited to existing parallel ports only. So you can't use an ftdi-emulated cable on a non-existing parallel port. Using it on a physically preent port still works.
+ is recognized again. Support for parallel/ftdi-cables is currently limited to existing parallel ports only. So you can't use an ftdi-emulated cable on a non-existing parallel port. Using it on a physically present port still works.
Supported Cables
--
2.39.5