From: Uwe B. <bo...@el...> - 2010-01-19 10:27:14
|
(setting the xc3sprog mailing list on the CC) >>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: Wojciech> On Sat, Jan 16, 2010 at 12:12:03AM +0100, Uwe Bonnes wrote: >> >>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: >> Wojciech> Hi, I want to have FreeBSD support in xc3sprog. This is first Wojciech> patch that makes you code compile cleanly under FreeBSD: >> Wojciech> http://freebsd.czest.pl/~wkoszek/fpga/xc3sprog.0.patch Thanks for reminding! I didn't notice in the first mail. I added the errno.h in the FreeBSD conditional path. (Rev 428) A CMAKE Toolchain File is only needed for crosscompiling. Did you crosscompile? Or does CMAKE not work appropriate on FreeBSD? It's added as Rev 429. >> Wojciech> 0x03fd:0x0008 is for default iMPACT firmware for Cypress's FX2 Wojciech> chip? I run Spartan 3E-500 Starter Kit with chip reprogrammed Wojciech> with xc3sprog and there it's 0x03fd:0x000d that is detected.. >> 0x03fd:0x000d is the Xilinx FX2 CHIP-ID. You must load the >> appropriate firmware. When you install the impact cable drivers ( in >> linux, can you report what happens in BSD when installing the XILINX >> driver?) the firmware and udev rules are copied to the ppropriate >> places. You can also load the firmware by hand with fxload or maybe >> other loaders. After loading the right firmware, the chip >> reenumerated and should get listed as 0x03fd:0x0008. Can't you compile native? Only libusb/libftdi should be needed and available for BSD too. Please let me know about problems. Wojciech> OK, I didn't know that on Linux fxload stage is necessary as a Wojciech> first step. Wojciech> We have Linux emulation layer, so that you can run Linux Wojciech> binaries on FreeBSD without a lot of problems. I have Wojciech> /compat/linux directory which can be populated by binary Wojciech> packages. Each package contains Linux binaries and Wojciech> libraries. They can be executed from this directory. Wojciech> /compat/linux is basically it's where everything gets Wojciech> installed. So my ISE is under /compat/linux/opt/Xilinx/... and Wojciech> I have all the .hex files there. Wojciech> In terms of drivers... Wojciech> Layout of /dev in Linux and FreeBSD differs. But I've compiled Wojciech> FreeBSD's libusb(3) implementation on Linux machine and got Wojciech> USB to work in emulation. and I also got Impact working Wojciech> natively with it--I can right now use it to program my Spartan Wojciech> 3E-Starter Kit. Wojciech> Today I commited kernel level patch to make this Wojciech> happen. User-space patch is being reviewed. Wojciech> Delay in a response is caused by the fact that we seem to have Wojciech> no native fxload here, so I had to look around and found Wojciech> libusb-enabled Windows port of fxload, which compiled for me Wojciech> after minor tweaks. Wojciech> Does it answer your question? Wojciech> Anyway, this is what I get from your code: Wojciech> wkoszek@laptop:/media/Multimedia/fpga/xc3sprog/trunk/build# Wojciech> ./xc3sprog -c xpc Release $Rev: 426 $ Free software: If you Wojciech> contribute nothing, expect nothing! Please provide feedback Wojciech> on success/failure/enhancement requests! Check Sourceforge Wojciech> SVN for updates! DEBUG(xpcu_read_hid:196)rc = -1, errno = 5 Wojciech> usb_control_msg(0x42.1 Unknown error Did you add the DEBUG(..? It's not from the xc3sprog code. Is errno =5 #define EIO 5 /* I/O error */ on FreeBSD too? Why does it get translated to "Unknown error"? > DEBUG(xpcu_read_hid:196)rc = -1, errno = 5 > usb_control_msg(0x42.1 Unknown error The Call 0x42.1 however is only a verbatim reproduction of a reverse engineer run on the XPC. Maybe it's no needed, maybe it should be another sequence with the DLC9/10 integrated in the Spartan 3E-500 Starter Kit. Wojciech> firmware version = 0x0404 Wojciech> (1028) CPLD version = 0x0012 (18) JTAG loc.: 0 IDCODE: Wojciech> 0x41c22093 Desc: XC3S500E IR length: 6 JTAG loc.: 1 IDCODE: Wojciech> 0xf5046093 Desc: XCF04S IR length: 8 JTAG loc.: 2 IDCODE: Wojciech> 0x06e5e093 Desc: XC2C64A-VQ44 IR length: 8 Wojciech> Startan 3E Starter Kit identification. Wojciech> wkoszek@laptop:/media/Multimedia/fpga/xc3sprog/trunk/build# Wojciech> ./xc3sprog -c xpc Wojciech> /home/wkoszek/fpga/fbsd-prog/xup-0.0.2/w/wkoszek_leds/leds.bit Wojciech> Release $Rev: 426 $ Free software: If you contribute nothing, Wojciech> expect nothing! Please provide feedback on Wojciech> success/failure/enhancement requests! Check Sourceforge SVN Wojciech> for updates! DEBUG(xpcu_read_hid:196)rc = -1, errno = 5 Wojciech> usb_control_msg(0x42.1 Unknown error firmware version = 0x0404 Wojciech> (1028) CPLD version = 0x0012 (18) Wojciech> Even though I'm getting an errors, this seems to work just Wojciech> fine as well. LED ruler implemented in this bitstream appears Wojciech> after programming. -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Uwe B. <bo...@el...> - 2010-01-19 16:15:31
|
>>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: ... Wojciech> Before I prepare a port of xc3sprog for FreeBSD, I'll probably Wojciech> send you some more stuff. I want your xc3sprog to be Wojciech> identified well (Author+project URL), so that there is no Wojciech> confusion with Andrew Rogers' stuff and XUP code. Wojciech> Do they have something which your code doesn't have? I started from Rogers sources, so everything should be included. XUP uses a different firmware for the DLC9/10 dongles. No need for the a different firmware with kawk's reverse engineering the Xilinx protocoll. I didn't check if they added anythging else. >> I added the errno.h in the FreeBSD conditional path. (Rev 428) >> >> A CMAKE Toolchain File is only needed for crosscompiling. Did you >> crosscompile? Or does CMAKE not work appropriate on FreeBSD? It's >> added as Rev 429. Wojciech> I just assumed you pick one CMAKE file for one family of Wojciech> systems. Can you use this string (system name) in the xc3sprog Wojciech> output somehow? Normally you start "cmake" and it should configure for the running system. Toolchainfiles only needed for crosscompiling. As I run on Suse 64-bit, I needed the Toolchain-SUSE32.cmake to compile the 32-bit binary. ... Wojciech> At home I'll just comment it out and perform some tests with Wojciech> small/big bitfiles and see if everything is more broken. Look at the -T0 option to keep JTAG busy. Bye -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Wojciech A. K. <wk...@Fr...> - 2010-02-08 19:26:21
|
On Tue, Jan 19, 2010 at 05:15:01PM +0100, Uwe Bonnes wrote: > >>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: > > ... > Wojciech> Before I prepare a port of xc3sprog for FreeBSD, I'll probably > Wojciech> send you some more stuff. I want your xc3sprog to be > Wojciech> identified well (Author+project URL), so that there is no > Wojciech> confusion with Andrew Rogers' stuff and XUP code. > > Wojciech> Do they have something which your code doesn't have? > > I started from Rogers sources, so everything should be included. > > XUP uses a different firmware for the DLC9/10 dongles. No need for the a > different firmware with kawk's reverse engineering the Xilinx protocoll. I > didn't check if they added anythging else. > > >> I added the errno.h in the FreeBSD conditional path. (Rev 428) > >> > >> A CMAKE Toolchain File is only needed for crosscompiling. Did you > >> crosscompile? Or does CMAKE not work appropriate on FreeBSD? It's > >> added as Rev 429. > > Wojciech> I just assumed you pick one CMAKE file for one family of > Wojciech> systems. Can you use this string (system name) in the xc3sprog > Wojciech> output somehow? > > Normally you start "cmake" and it should configure for the running > system. Toolchainfiles only needed for crosscompiling. As I run on Suse > 64-bit, I needed the Toolchain-SUSE32.cmake to compile the 32-bit binary. Sorry for delay. Indeed 'cmake' works for me. I don't have a setup to try cross-compilation out.. Don't remove the file yet -- I'll keep you posted. Andrew Rogers, XUP people and your code share the same name. So if I say "xc3sprog" to someone new with those projects, we'll probably pick Andrew's code. My idea is to modify existing "hello message": Free software: If you contribute nothing, expect nothing! Please provide feedback on success/failure/enhancement requests! Check Sourceforge SVN for updates! To something more meaningful. Ideally, xc3sprog program would become 'xilprog' or similar to cut off the historical baggage, but it's probably too late. To help a bit, I propose this patch: http://freebsd.czest.pl/~wkoszek/fpga/xc3sprog.1.patch (hand-edited patch against revision 426). It generates: xc3sprog project (c) 2005-2010 Uwe Bonnes bo...@el... WWW: http://sourceforge.net/projects/xc3sprog Release: $Rev: 426 $ System: FreeBSD(i386): 9.0-CURRENT usage: xc3sprog [options] <bitfile> Possible options: -h Print this help. -c Choose programmer type [pp|ftdi|fx2|xpc]. -C Verify device against file (no programming). -e file EEPROM file. -f file File with fuse bits. -i Input file format (BIT|BIN|MCS|MCSREV|HEX). -I Work on connected SPI Flash (ISF Mode). (after 'bscan_spi' bitfile for device has been loaded). -j Detect JTAG chain, nothing else (default action). -L Program lockbits if defined in fusefile. -m <dir> Directory with XC2C mapfiles. -o Output file format (BIT|BIN|MCS|MCSREV|HEX). -p Possition in the JTAG chain. -r Read from device and write to file. -T val Test chain 'val' times (0 = forever) or 10000 times default. In ISF Mode, test the SPI connection. -v Verbose output. Programmer specific options: -d (pp only ) Parallel port device. -t (xpc only ) NONE or INT (Internal Chain , not for DLC10)) -s num (ftdi/fx only) Serial number string. -t type (ftdi/fx only) Type can be [NONE|IKDA|OLIMEX|FTDI_JTAG|AMONTEC]. -P pid (ftdi/fx only) Product ID. -S desc (ftdi/fx only) Product ID string. -V vid (ftdi/fx only) Vendor ID. Apart from that, it removes redundant ":" after 'T' and removes 'D' from getopt(), which isn't supported. I'd also stay away from falling back to parallel port and all sorts of autodetection. No -c given should be considered a mistake, IMO. > ... > Wojciech> At home I'll just comment it out and perform some tests with > Wojciech> small/big bitfiles and see if everything is more broken. > > Look at the -T0 option to keep JTAG busy. This is what I did: wkoszek@laptop:/media/Multimedia/fpga/XC3SPROG/xc3sprog/trunk/build# ./xc3sprog -T0 -c xpc /home/wkoszek/fpga/fbsd-prog/xup-0.0.2/w/wkoszek_leds/leds.bit Release $Rev: 426 $ Free software: If you contribute nothing, expect nothing! Please provide feedback on success/failure/enhancement requests! Check Sourceforge SVN for updates! usb_control_msg(0x42.1 Unknown error firmware version = 0x0404 (1028) CPLD version = 0x0012 (18) Reading ID_CODE 2147483647 times Sending 22 bits IDCODE Commands: 0x01fe09 Expecting 3 IDCODES : 0x06e5e093 0xf5046093 0x41c22093 This 'usb_control_msg(0x42.1 Unknown error' appears here as well. BTW, a friend of mine confirmed that he can program his S3ESK board under his FreeBSD 8 system without a problem with some of my random notes. -- Wojciech A. Koszek wk...@Fr... http://FreeBSD.czest.pl/~wkoszek/ |
From: Uwe B. <bo...@el...> - 2010-02-08 20:43:29
|
>>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: Wojciech> xc3sprog project (c) 2005-2010 Uwe Bonnes Wojciech> bo...@el... WWW: The work was started by Andrew, others dropped in and now most contributions are mine. But that doesn't give me the whole copyright. Wojciech> http://sourceforge.net/projects/xc3sprog Release: $Rev: 426 $ Wojciech> System: FreeBSD(i386): 9.0-CURRENT Wojciech> usage: xc3sprog [options] <bitfile> I'll consider the usage changes.... Wojciech> ./xc3sprog -T0 -c xpc Wojciech> /home/wkoszek/fpga/fbsd-prog/xup-0.0.2/w/wkoszek_leds/leds.bit Wojciech> Release $Rev: 426 $ Free software: If you contribute nothing, Wojciech> expect nothing! Please provide feedback on Wojciech> success/failure/enhancement requests! Check Sourceforge SVN Wojciech> for updates! usb_control_msg(0x42.1 Unknown error firmware Wojciech> version = 0x0404 (1028) CPLD version = 0x0012 (18) Reading Wojciech> ID_CODE 2147483647 times Sending 22 bits IDCODE Commands: Wojciech> 0x01fe09 Expecting 3 IDCODES : 0x06e5e093 0xf5046093 Wojciech> 0x41c22093 Give the verbose option and you will see lots of dots printed for lots aof successfill JTAG queue queries. Wojciech> This 'usb_control_msg(0x42.1 Unknown error' appears here as Wojciech> well. BTW, a friend of mine confirmed that he can program his Wojciech> S3ESK board under his FreeBSD 8 system without a problem with Wojciech> some of my random notes. I'll look again at the 0x42.1 message again. What Xilinx dobgle is that, what firmware file loaded? Bye -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Wojciech A. K. <wk...@Fr...> - 2010-02-09 02:17:32
|
On Mon, Feb 08, 2010 at 09:43:19PM +0100, Uwe Bonnes wrote: > >>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: > > Wojciech> xc3sprog project (c) 2005-2010 Uwe Bonnes > Wojciech> bo...@el... WWW: > > The work was started by Andrew, others dropped in and now most contributions > are mine. But that doesn't give me the whole copyright. I haven't had a chance to exactly track the version history and because of not being a copyright expert. Maybe: XC3SPROG (c) 2005-2010 xc3sprog project $Rev$ <OS> Or whatever else. As long as I can easily distinguish that a user calls the right program, it's ok. > > Wojciech> http://sourceforge.net/projects/xc3sprog Release: $Rev: 426 $ > Wojciech> System: FreeBSD(i386): 9.0-CURRENT > > Wojciech> usage: xc3sprog [options] <bitfile> > > I'll consider the usage changes.... How about turning off autodetection? Current situation is that in ~90% cases user gets an error after running xc3sprog without being guilty. Instead of: Could not access parallel device '/dev/parport0': No such file or directory Could not open parallel port (null) It could be: No cable selected. You must use -c option. See xc3sprog -h for more help. > Wojciech> This 'usb_control_msg(0x42.1 Unknown error' appears here as > Wojciech> well. BTW, a friend of mine confirmed that he can program his > Wojciech> S3ESK board under his FreeBSD 8 system without a problem with > Wojciech> some of my random notes. > > I'll look again at the 0x42.1 message again. What Xilinx dobgle is that, > what firmware file loaded? I have S3ESK board so far. I use its embedded USB JTAG cable with this firmware: http://freebsd.czest.pl/~wkoszek/fpga/xusb_emb.hex -- Wojciech A. Koszek wk...@Fr... http://FreeBSD.czest.pl/~wkoszek/ |
From: Uwe B. <bo...@el...> - 2010-02-09 11:49:45
|
>>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: Wojciech> On Mon, Feb 08, 2010 at 09:43:19PM +0100, Uwe Bonnes wrote: >> >>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: >> Wojciech> xc3sprog project (c) 2005-2010 Uwe Bonnes Wojciech> bo...@el... WWW: >> The work was started by Andrew, others dropped in and now most >> contributions are mine. But that doesn't give me the whole copyright. Wojciech> I haven't had a chance to exactly track the version history Wojciech> and because of not being a copyright expert. Maybe: Wojciech> XC3SPROG (c) 2005-2010 xc3sprog project $Rev$ <OS> Wojciech> Or whatever else. As long as I can easily distinguish that a Wojciech> user calls the right program, it's ok. Do you have a suggestion for the <OS> printout logic. Otherwise I tried to implement your suggestions from this mail in rev 434. I tried to be as explicit as with the error mess Wojciech> This 'usb_control_msg(0x42.1 Unknown error' appears here as Wojciech> well. BTW, a friend of mine confirmed that he can program his Wojciech> S3ESK board under his FreeBSD 8 system without a problem with Wojciech> some of my random notes. >> I'll look again at the 0x42.1 message again. What Xilinx dobgle is >> that, what firmware file loaded? Wojciech> I have S3ESK board so far. I use its embedded USB JTAG cable Wojciech> with this firmware: I disabled the code so long. It doesn't get work for me and causes problems for you. Bye -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Wojciech A. K. <wk...@Fr...> - 2010-02-09 16:05:32
|
On Tue, Feb 09, 2010 at 12:49:34PM +0100, Uwe Bonnes wrote: > >>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: > > Wojciech> On Mon, Feb 08, 2010 at 09:43:19PM +0100, Uwe Bonnes wrote: > >> >>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: > >> > Wojciech> xc3sprog project (c) 2005-2010 Uwe Bonnes > Wojciech> bo...@el... WWW: > >> The work was started by Andrew, others dropped in and now most > >> contributions are mine. But that doesn't give me the whole copyright. > > Wojciech> I haven't had a chance to exactly track the version history > Wojciech> and because of not being a copyright expert. Maybe: > > Wojciech> XC3SPROG (c) 2005-2010 xc3sprog project $Rev$ <OS> > > Wojciech> Or whatever else. As long as I can easily distinguish that a > Wojciech> user calls the right program, it's ok. > > Do you have a suggestion for the <OS> printout logic. Otherwise I tried to > implement your suggestions from this mail in rev 434. I tried to be as > explicit as with the error mess Uwe, Was something wrong with the patch? You may want to obtain rev 432 for which my patch was addressed and simply apply it and change printf's. I use uname(3) there and I think it can be used here as well. "FreeBSD" and "Linux" should be enough. Ideally (as I mentioned earlier), your cmake-magic knowledge could be deployed, so that, except pure OS specific string returned from uname(3), you'll also have specific information about cross compilation. Usage is much clearer in my patch. Moreover, it lists -c option, which is missing right now. The reason why I removed verbose notifications as I think they're uncessary, and exceed 80 lines. From r435: ------------------------------------------------------------------------------- "Feedback on success/failure/enhancement requests: http://sourceforge.net/mail/?group_id=170565" "Check Sourceforge for updates: http://sourceforge.net/projects/xc3sprog/develop for updates" Maybe: "In case of problems: http://sf.net/mail/?group_id=170565" And probably only with -v... I think logic present after your patch isn't yet right -- parallel port constructor is always called, which means that my logic circuit for the CNC machine I build here may suddenly, by accident, respond correctly to the "probe" sequence.. My opinion is that under no condition xc3sprog should touch anything, unless stated otherwise. So, IMO (ideal case) the right logic would be: if XC3SPROG_CABLE set Use $XC3SPROG_CABLE. else if -c had some hints Yes, use cable passed from -c. else Inform what to do. Where: - $XC3SPROG_CABLE == "pp:/path/to/dev" -> parallel port backend with /path/to/dev device. - $XC3SPROG_CABLE == "ftdi:vid=<VID>,pid=<PID>,option=..." -> FTDI options Or similar. This would let you to stay away from getenv()s in IOParport.. > Wojciech> This 'usb_control_msg(0x42.1 Unknown error' appears here as > Wojciech> well. BTW, a friend of mine confirmed that he can program his > Wojciech> S3ESK board under his FreeBSD 8 system without a problem with > Wojciech> some of my random notes. > >> I'll look again at the 0x42.1 message again. What Xilinx dobgle is > >> that, what firmware file loaded? > > Wojciech> I have S3ESK board so far. I use its embedded USB JTAG cable > Wojciech> with this firmware: > > I disabled the code so long. It doesn't get work for me and causes problems > for you. Thanks! -- Wojciech A. Koszek wk...@Fr... http://FreeBSD.czest.pl/~wkoszek/ |
From: Uwe B. <bo...@el...> - 2010-02-09 18:47:58
|
>>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: Wojciech> Was something wrong with the patch? Probably lost in work and mail overflow. Can you redo against recent SVN. Roger started xc3sprog 2004, so start copyright there. Also please check crosscompiling on Win32, at least with mingw. I don't see uname() in any mingw header ... Thanks -- Uwe Bonnes bo...@el... Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- |
From: Wojciech A. K. <wk...@Fr...> - 2010-02-09 22:46:07
|
On Tue, Feb 09, 2010 at 07:47:45PM +0100, Uwe Bonnes wrote: > >>>>> "Wojciech" == Wojciech A Koszek <wk...@Fr...> writes: > > Wojciech> Was something wrong with the patch? > > > Probably lost in work and mail overflow. Can you redo against recent > SVN. Roger started xc3sprog 2004, so start copyright there. Also please > check crosscompiling on Win32, at least with mingw. I don't see uname() in > any mingw header ... I've redone the patch. http://freebsd.czest.pl/~wkoszek/fpga/xc3sprog.2.patch Pick stuff that you accept. I don't work too much with Windows, however here's the patch that should address your problem with ifdef. FreeBSD: wkoszek@laptop:/media/Multimedia/fpga/XC3SPROG/d/xc3sprog/trunk/build$ ./xc3sprog XC3SPROG (c) 2004-2010 xc3sprog project $Rev$ OS: FreeBSD Free software: If you contribute nothing, expect nothing! Feedback on success/failure/enhancement requests: http://sourceforge.net/mail/?group_id=170565 Check Sourceforge for updates: http://sourceforge.net/projects/xc3sprog/develop for updates! Could not access parallel device '/dev/parport0': No such file or directory No cable selected. You must use -c option. See xc3sprog -h for more help Qemu (Linux): debian:~/xc3sprog/trunk/build# ./xc3sprog XC3SPROG (c) 2004-2010 xc3sprog project $Rev$ OS: Linux Free software: If you contribute nothing, expect nothing! Feedback on success/failure/enhancement requests: http://sourceforge.net/mail/?g roup_id=170565 Check Sourceforge for updates: http://sourceforge.net/projects/xc3sprog/develop for updates! Could not access parallel device '/dev/parport0': No such file or directory No cable selected. You must use -c option. See xc3sprog -h for more help debian:~/xc3sprog/trunk/build# -- Wojciech A. Koszek wk...@Fr... http://FreeBSD.czest.pl/~wkoszek/ |