|
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 ----------
|