LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 12-14-2008, 01:00 PM   #1
magda
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Rep: Reputation: 1
How to write a PCI Express device driver for Xilinx Virtex-5 LXT/SXT Dev Kit?


Hello all,

I am new in the Forum and this is my first post! I would like to say that I have used this Forum in the past and that there is very useful information.
I am a software engineer with experience developing Linux device drivers (USB 2.0). I used the usb-skeleton template by Greg Kroah-Hartman, which was of great help.
I need to develop now a device driver for a PCI express board: the Xilinx Virtex-5 LXT/SXT and I am a little bit lost... I know nothing about PCIe.

So my first question is: Is there a similar template for PCIe to start with?

Any advice would be more than welcome!

Happy Christmas!

Magda
 
Old 01-14-2009, 06:10 PM   #2
unseulensemble
LQ Newbie
 
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
Writing PCI driver for Xilinx Virtex 5

Hi magda,
I'm an electrical engineer an I don't know a lot of thing about the inside of the linux kernel and how to make device drivers.
But, me too I am trying to develop a PCI express device driver for Xilinx Virtex-5 SXT. I was reading books "Linux Device Drivers" and "PCI Express system architecture" but I don't think there is enough info in these book to do that. I will firstly try to make an USB driver (If you use ML-506 evaluation board or equivalent there is already an USB device port.) If you have any more info about pci express let me know.

Thank you.

unseulensemble
 
Old 02-08-2009, 01:27 PM   #3
rashmikant
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Rep: Reputation: 1
Hi,
Did any one got any success with PCI-express driver for Xilinx Virtex-5 board? Can you guide me if there are any sources which I can go through or I can refer to? Is there a source available for the driver so that I can tweak it for custom needs?

I would really appreciate any help thats available.

Thanks,
Rk
 
Old 02-13-2009, 09:48 AM   #4
magda
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Original Poster
Rep: Reputation: 1
Hi, here you have links to pci skeletons that I've found useful, from the simplest to the most complicated:

http://www.cs.fsu.edu/~baker/devices...pci/pci_skel.c
http://true-random.com/homepage/proj...pci_template.c
http://www.gelato.unsw.edu.au/lxr/so...pci-skeleton.c

Linux Device Drivers is quite complete boot, just follow chapter 9 and edit pci_skel.c (first of the previous links) accordingly in order to get simple read and write operations.

Also you need to decide if you want your driver to be a Character or a Block device, here you have some discussions:

http://www.cab.u-szeged.hu/linux/doc/khg/node18.html
http://www.linuxhq.com/guides/LKMPG/node14.html
http://www.faqs.org/docs/kernel/x571.html

In case you go for Character Device then you will need to create it from a linux terminal. I donīt have the info on how to do that yet.

I hope this helps,

Magda
 
Old 03-03-2009, 04:12 PM   #5
gcurwen
LQ Newbie
 
Registered: May 2006
Posts: 1

Rep: Reputation: 0
Thanks for the Links!

Hi,

I am a software engineer who has been tasked with implementing a PCI device driver for a custom FPGA. I have used the USB skeliton before, and was hoping I could find a similar piece of code for PCI. I was very glad to find the links provided in this post. It will save me a lot of time.

Thanks again...

Greg
 
Old 03-03-2009, 06:31 PM   #6
rashmikant
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Rep: Reputation: 1
Thanks a ton..

Thanks a lot for the info..
I have started building driver for fpga thru PCI interface..I will post the link for the code in-case if someone else is looking for it.
Thanks once again for the help.
Rashmikant
 
Old 03-04-2009, 04:25 AM   #7
magda
LQ Newbie
 
Registered: Dec 2008
Posts: 3

Original Poster
Rep: Reputation: 1
You are welcome, I am glad the info was useful.
Let me know if you have any problem.


Magda
 
Old 04-28-2009, 05:27 AM   #8
Mahmoud_eltahawy
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Rep: Reputation: 0
How I could test my code

Quote:
Originally Posted by magda View Post
You are welcome, I am glad the info was useful.
Let me know if you have any problem.


Magda
Dear All,

First, Thank u very much for this great discussion , I am new for PCI driver development, I write a simple PCI driver and I need to test it, in other words I need to do simple read/write/ioctl operations, but I have no hardware(PCI development board) for doing this, I tried to use any of the PCI cards connected to my PC, I understand that ,to invoke the Driver probe method, the VEDNER_ID and DEVICE_ID of my driver should match one of the IDs of the cards connected to PC, so I used the lspci utility to list all vendor and device IDs . and I used one of these IDs in my code to make the kernel invoke my driver probe method,
inside the probe, I tried to get the address of BAR0 and BAR1 using pci_resource_start to allocate my data structure in BAR0 of the PCI, but It fails and returns NULL from pci_resource_start.


My question: Does anyone know how I could fix this problem ??


Appreciate your help

Thanks
Regards
Mahmoud
 
Old 04-30-2009, 12:09 PM   #9
mellob
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by rashmikant View Post
Thanks a lot for the info..
I have started building driver for fpga thru PCI interface..I will post the link for the code in-case if someone else is looking for it.
Thanks once again for the help.
Rashmikant

hi all,

no news on this way?

i'm in troble with writing a similar driver. i got to stop myself because there's something wrong in my code, if anybody of you reached in writing this driver, please tell, i've a lot of question.
 
Old 06-10-2009, 09:17 AM   #10
rashmikant
LQ Newbie
 
Registered: Dec 2008
Posts: 7

Rep: Reputation: 1
I did manage to get something running.
I can get the basic stuff up and running but am having some problems with the status bit handling in the DMA address space mapped in kernel for the fpga. will have to look more into that.

I had used the links which magda posted and got a .tar files somewhere from the forums which had driver code which implemented something similar to this. I will try to search for it and will see if i can find it..

Let me post my source file for the driver..

hope this helps.

enjoy.
rk
Attached Files
File Type: txt fpga_pcie.txt (24.6 KB, 679 views)
 
Old 07-16-2009, 02:33 PM   #11
maveric4745
LQ Newbie
 
Registered: Jul 2009
Posts: 1

Rep: Reputation: 0
all,
i have similar dev env:
V5 FPGA with 440 PPC and PCIe Endpoint <-> PPC 8548 with Linux 2.6.24.7 and PCIe RC

will post when i have something more than just PCI header info ...
 
Old 07-22-2009, 01:29 AM   #12
nsaba
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by maveric4745 View Post
all,
i have similar dev env:
V5 FPGA with 440 PPC and PCIe Endpoint <-> PPC 8548 with Linux 2.6.24.7 and PCIe RC

will post when i have something more than just PCI header info ...
Hi ,

It's an interesting work , I'm interested in your results.
 
Old 03-22-2010, 04:07 PM   #13
Restless86
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Rep: Reputation: 0
Question Any results?

Quote:
Originally Posted by magda View Post
Hi, here you have links to pci skeletons that I've found useful, from the simplest to the most complicated:

(...)

Linux Device Drivers is quite complete boot, just follow chapter 9 and edit pci_skel.c (first of the previous links) accordingly in order to get simple read and write operations.

Also you need to decide if you want your driver to be a Character or a Block device, here you have some discussions:

(...)

In case you go for Character Device then you will need to create it from a linux terminal. I donīt have the info on how to do that yet.

I hope this helps,

Magda
Hi.

I kinda need to do the same thing as you.. develop a device driver for a PCI express board: the Xilinx Virtex-5 LXT.
But I'm kind stuck on this.. I'm looking into the books referred in topics and I've now started taking a look at the example codes posted here. Even so I didn't manage to get anything running yet.

Did you manage to get this working? Any advice?

Thanks in advance.
Best regards.
 
Old 03-23-2010, 03:59 AM   #14
nsaba
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by Restless86 View Post
Hi.

I kinda need to do the same thing as you.. develop a device driver for a PCI express board: the Xilinx Virtex-5 LXT.
But I'm kind stuck on this.. I'm looking into the books referred in topics and I've now started taking a look at the example codes posted here. Even so I didn't manage to get anything running yet.

Did you manage to get this working? Any advice?

Thanks in advance.
Best regards.
I was in a similar situation as you are in, a few months ago; In general, in your driver you must enable PCI/PCI-Express device, initialize it and all its features need to be initialized for operation, provide access method/s to it and in from here comes special section that depends on your hardware internal architecture that you provide by programming FPGA.
I started with ldd3, Linux essential device drivers, and some kernel development knowledge. Now that the device is getting ready to operate, I've developed driver as well in an incremental manner in parallel with device. I've provided access to device from user space through a character device node in File System (for testing device functionality) and, access from kernel space from kernel crypto api.

Please give more description about your current status, errors you are involve and device architecture and functionality.

I'll be pleased if I could help you.
 
Old 03-30-2010, 11:10 AM   #15
Bhupal
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
Linux Terminal for PC's connected with PCI Express

Hi Friends,

I want to use Linux terminal or console in order to communicate other system which is connected with PCI Express bus. I dont know how to make this.
I have Linux PC which is connected to PowerPc

We usually use ssh in order to communicate or access power pc by which are connected with Ethernet cable.

I need to make similar stuff but both the PC's are connected with PCI Express Bus.

Do i need to make any changes in PCI Express driver in order to do this?

Can anyone please help me how to do this!!
 
  


Reply

Tags
driver, pcie


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
PCI Express Graphics Card and /dev/agpgart (AGP Support) (Gentoo) silentray Linux - Newbie 2 10-01-2008 03:10 AM
A problem with audiohd driver arised with Solaris express Dev. ed. 5/07 crisostomo_enrico Solaris / OpenSolaris 4 08-13-2007 02:58 AM
Graphics Card: PCI Express x16 Detected as PCI Express Link width: 4X deepclutch Linux - Hardware 3 06-09-2007 11:10 AM
ATI Radeon X1050 PCI Express graphics driver? Erik_FL Linux - Hardware 10 04-22-2007 03:21 PM
xilinx system ace driver for compact flash on a fpga based pci card doesnt work urwithsudheer Programming 0 03-22-2006 03:28 AM


All times are GMT -5. The time now is 01:36 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration