LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 09-24-2009, 10:30 AM   #1
intermilan
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Rep: Reputation: 0
Problem found in Xilinx icap driver for kernel 2.6


I'm porting linux 2.6 kernel to a ML 410 board using Xilinx's kernel
tree. Particularly, I would like to use Xilinx's icap driver (as in
driver/char/xilinx_hwicap.

I do not have problems in using it to write a partial bitstream to
ICAP; but I have a problem when performing read back.

I'm trying to read from a device from a user application using:

int* frame = (int*) malloc( 83 * sizeof(int));
FILE *ICAP;
ICAP = fopen("/dev/icap0", "r+b"
fwrite(word, sizeof(*word), 18, ICAP);
fread(frame, sizeof(int), 83, ICAP);

The device is opened OK. And the 18 words written to icap is the same
as those in hwicap v1_01_a driver's xhwicap_device_read_frame.c:
1. Dummy 2. Sync 3. Noop 4. Noop
5. CMD 6. RCRC 7. Noop 8. Noop
9. CMD 10. RCFG 11. Noop 12. Noop
13. Noop 14. W FAR 15. frame addr 16. FRDO 83 words
17. Noop 18. Noop

The problem is, in icap read function,
static int buffer_icap_device_read(struct hwicap_drvdata *drvdata,u32
offset, u32 count)
"count" is not the same value as I requested with fread.
Instead of 0x53 (words), it gets 0x1000 (bytes). This value seems to
causes a device read failure (it is not associated with frame
boundary, and it is not the same value as previous command written to
icap requests)- the icap status register after read is 0, not the
normal value 0x7ffc; and data copied to user buffer is not the desired
frame data.

Actually, I am able to work around with this problem by forcing count
to 83 in hwicap_read. This is OK since I mostly only needs to read one
frame. By doing so, icap status register is the correct value of
0x7ffc after read. And in user space, *frame get the desired frame
data.

How can I fix the driver function so that hwicap_read gets the same
"count" as fread passes to it?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write a PCI Express device driver for Xilinx Virtex-5 LXT/SXT Dev Kit? magda Linux - Embedded & Single-board computer 22 10-12-2011 09:02 PM
squid c-icap download file problem xxx_anuj_xxx Linux - Server 0 03-04-2009 01:03 PM
xilinx system ace driver for compact flash on a fpga based pci card doesnt work urwithsudheer Programming 0 03-22-2006 02:28 AM
Mar 25 11:19:48 my-proxy kernel: ne2k-pci.c: No useable cards found, driver NOT bishal Linux - Networking 0 03-25-2004 11:52 PM
Squid + ICAP server = ? dimm_coder Linux - Software 0 12-09-2003 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 10:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration