How to write a PCI Express device driver for Xilinx Virtex-5 LXT/SXT Dev Kit?
Linux - Embedded & Single-board computerThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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:
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 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
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 ??
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.
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..
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.