Xilinx JTAG

来源:百度文库 编辑:神马文学网 时间:2024/04/27 21:38:11
Xilinx官方给出一个驱动,在kernel层实现。但是只能在redhat上安装,其他linux发行版不能使用。只能通过用户层实现。
下面是原作者的描述,总结如下:
1. 下载驱动源码包
2. 安装相关开发包:libusb-dev build-essential libc6-dev-i386 fxload
3. 编译生成so文件
4. ./setup_pcusb /opt/Xilinx/13.2/ISE_DS/ISE/
经过以上步骤之后,在impact, edk, chipscope,xps都能使用JTAG
http://www.george-smart.co.uk/wiki/Xilinx_JTAG_Linux#Issues.2C_Problems_.26_Troubleshooting
=======================================================
There's your problem: Debian. The windrvr proprietary driver onlysupports certain versions of RHEL's kernel. If you're not running a RHELkernel version it supports, its not going to be installed.
Thishas been discussed MANY times before, especially on the newsgroups(comp.arch.fpga). The best way around it is to switch to the open-sourceuser-space driver:  http://rmdir.de/~michael/xilinx/. If you are using10.1, you can use the Xilinx provided driver for libusb by using theenvironment variable XIL_IMPACT_USE_LIBUSB=1. I don't know if this worksfor XMD as well.
---------------------------------------------------
When usingXILINX JTAG software like Impact, Chipscope and XMDon Linux, the proprietary kernel module windrvr fromJungois needed to access the parallel- or usb-cable.As this module does not work with current linux kernel versions (> 2.6.18) a library was developed,which emulates the module in userspace and allows the tools to access the JTAG cable without the needfor a proprietary kernel module.
The library useslibusb to access USB devices and theppdev interface to communicatewith parallel cables. The parallel part currently only supports Parallel Cable III mode (and PCIV inPCIII compatibility mode) as the faster PCIV modes use another kernel module which is not emulated bythis library. So you are limited to a 200kHz JTAG clock when using Parallel Cable IV with this software.The USB cable is supported at full speed.
Experimental support for FTDI 2232 based devices has been added. They are seen by Impact as a ParallelCable III. These devices are currently significantly slower than every other supported cable.
The library is called libusb-driver as it was developed to support the USB cable, but laterextended to also support parallel cables.
=============================================readme
This library emulates Jungo Windrvr USB and parallel port functions in
userspace which are required by XILINX impact to access the Platform cable USB
and Parallel Cable III.
With this library it is possible to access the cables without loading a
proprietary kernel module which breaks with every new kernel release. It uses
the functionality provided by the libusb userspace library for USB access and
the kernel interface at /dev/parport0 for parallel port access instead and
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
* ISE Webpack 9.1SP1, SP2, SP3
* ISE Webpack 8.2SP3
* ISE Webpack 8.1SP3
* ChipScope 10.1
* ChipScope 9.2.01i, 9.2.02i, 9.2.03i, 9.2.04i
* ChipScope 9.1.02i, 9.1.03i
* ChipScope 8.2.04i
* EDK 10.1
* EDK 9.2.01i, 9.2.02i
* EDK 9.1.01i, 9.1.02i
* EDK 8.2.02i
* EDK 8.1.02i
* Synplicity Identify
In addition to the XILINX USB and parallel cables, devices based on the FTDI
2232 serial converter chip are also experimentally supported. This includes
devices like the Amontec JTAGkey(-Tiny).
Build the library by calling `make'. If you are on a 64 bit system but want
to build a 32 bit library, run `make lib32' instead. Be sure to have the 32
bit versions of libusb-devel and libftdi-devel installed!
To use this library you have to preload the library before starting impact:
$ LD_PRELOAD=/path/to/libusb-driver.so impact
or
$ export LD_PRELOAD=/path/to/libusb-driver.so (for sh shells)
$ setenv LD_PRELOAD /path/to/libusb-driver.so (for csh shells)
$ impact
The source for this library can be found at:
http://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver
The main website is located at:
http://www.rmdir.de/~michael/xilinx/
The Git repository can be cloned with:
git clone git://git.zerfleddert.de/usb-driver
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", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03fd", MODE="666"
If your cable does not have the ID 03fd:0008 in the output of lsusb,
the initial firmware has not been loaded (loading it changes the
product-ID from another value to 8). To load the firmware follow
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. 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"
4. copy the files /path/to/ISE/bin/lin/xusb*.hex to /usr/share/
5. restart udev and re-plug the cable
If you have multiple cables connected, you can specify the cable to use
in the XILINX_USB_DEV environment-variable as "bus:device".
These identifiers are available in the output of lsusb:
Bus 001 Device 004: ID 03fd:0008 Xilinx, Inc.
^^^ ^^^
To use this cable, set the XILINX_USB_DEV variable to "001:004".
Notes for the parallel cable
============================
To access the parallel port from userspace, the kernel needs to be built with
the features "Parallel port support" (CONFIG_PARPORT), "PC-style hardware"
(CONFIG_PARPORT_PC) and "Support for user-space parallel port device drivers"
(CONFIG_PPDEV) builtin or as modules. If these features are built as modules,
they need to be loaded before using this library.
These modules are called:
parport
parport_pc
ppdev
To use the device as an ordinary user, put the user in the group 'lp'
If you have an almost compatible cable which works with other software but not
with Impact, try adding -DFORCE_PC3_IDENT to the CFLAGS line in the Makefile.
This enables a hack by Stefan Ziegenbalg to force detection of a parallel cable.
Parallel Cable IV is currently only supported in 'compatibility mode', as no
attempt to configure the ECP registers is done by this library.
If you get "Programming failed" or "DONE did not go high" when programming
through the parallel cable with Impact 9.1, make sure to have the option "Use
HIGHZ instead of BYPASS" enabled in Edit -> Preferences -> iMPACT Configuration
Preferences.
If you are using batch mode, add the following line to your cmd file:
setPreference -pref UseHighz:TRUE
(This problem also occurs on windows and when using the real windrvr in linux
and is solved with the same workaround. Impact 8.2 is working fine with the same
boards and designs)
Notes for FTDI 2232 based cables
================================
To build the driver with FTDI 2232 support, you need to have libftdi and
the libftdi development package installed. On debian, you can install both
by installing 'libftdi-dev'.
To set-up the device:
1. Find out the vendor and product id of your cable using lsusb:
Bus 003 Device 005: ID 0403:cff8 Future Technology Devices ...
~~~~~~~~~
2. Copy the sample libusb-driverrc to ~/.libusb-driverrc, edit it and replace
the vendor and product-id in the example file with the values provided in
the lsusb-output. You can also change the 'parallel port' which is mapped to
this cable. Impact sees the device at that port as a Parallel Cable III.
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", 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
significantly slower than the other supported cables.
Locked cables
=============
If you get the message 'The cable is being used by another application.' from
impact, try running the following command:
echo -e 'cleancablelock\nexit' | impact -batch