How to write a PCI Express device driver for Xilinx Virtex-5 LXT/SXT Dev Kit?
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!
Writing PCI driver for Xilinx Virtex 5
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.
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.
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,
Thanks for the Links!
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 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.
You are welcome, I am glad the info was useful.
Let me know if you have any problem.
How I could test my code
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
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..
Let me post my source file for the driver..
hope this helps.
i have similar dev env:
V5 FPGA with 440 PPC and PCIe Endpoint <-> PPC 8548 with Linux 22.214.171.124 and PCIe RC
will post when i have something more than just PCI header info ...
It's an interesting work , I'm interested in your results.
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.
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.
Linux Terminal for PC's connected with PCI Express
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!!
|All times are GMT -5. The time now is 08:19 PM.|