cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
5,184 Views
Registered: ‎06-06-2012

PCI Express driver for ML507

Jump to solution
We are developing a product with a PCI Express interface, the h/w guys are putting an FPGA in the box that I'll need to talk to.

We plan to place a prototype card (ML507) in a PC running Ubuntu so as to debug the FPGA and the host driver.

I've set up a PC with Ubuntu 12.04 and I've read about the PCI Express design in the Documentation folder and in blogs on the web. My task is to develope an API on the PC side to support a GUI that for now, just performs read/write to the FPGA registers. I started with example code for a PCI Express service and got compile errors that don't make sense.

According to the HOWTO in the Documentation folder (something I found on the web), the source code should contain the following struct:

static struct pcie_port_service_id service_id[] = { {
.vendor = VENDOR_ID,
.device = DEVICE_ID,
.port_type = PCIE_RC_PORT,
.service_type = PCIE_PORT_SERVICE_AER,
}, { /* end: all zeroes */ }
};

The compiler complains about the struct name. I checked the header file, pcieport_if.h, and it does not contain the struct that I'm supposed to use. I looked around and apparently, this struct was removed in a patch.

So now, I'm not sure how to code the service because my tutorial may have been based on an old design and I cannot seem to find a tutorial for the new design approach.

Any ideas would be welcome.

Sincerely,
More confused than ever
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor
Visitor
6,437 Views
Registered: ‎06-06-2012

Re: PCI Express driver for ML507 - SOLVED

Jump to solution

SOLVED

 

According to our part-time Linux consultant, I was led astray by the info that I read at http://www.kernel.org/doc/ols/2005/ols2005v2-pages-9-18.pdf.

 

I can write a driver just like I've done in the past but register it as a pci driver whereas in the past, I registered as a platform driver.

 

I was pointed towards /drivers/net/3c59x.c for an example of how to write a driver.

 

Thx, Bill.  

View solution in original post

5 Replies
Highlighted
Scholar
Scholar
5,183 Views
Registered: ‎02-27-2008

Re: PCI Express driver for ML507

Jump to solution

http://www.xilinx.com/products/boards/ml507/ml507_12.1/pcie.htm

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Highlighted
Visitor
Visitor
5,179 Views
Registered: ‎06-06-2012

Re: PCI Express driver for ML507

Jump to solution

Thanks for the reply Austin.

 

I had already read thru that link hoping to find the info I needed but had no luck. Here is the whole picture of our design approach.

 

We have a h/w guy doing the FPGA code for the ML507. He will use the Xilinx tools to verify his design in a Windows PC. He will verify that his FPGA design responds to reads/writes via PCI Express bus.

 

Our target OS is Embedded Linux running on a P2020 but that design is not ready to use yet. So, in the interim, I was going to place the ML507 card in a PC and develope my Linux drivers on the PC based on Ubuntu (version 12.04).

 

I've read numerous blogs and tutorials that describe how to write the PCI Express service so that it registers itself with the PCI Express driver that comes with the Linux kernel. I've generated src code but when I compiled the code, the compiler complains that the "pcie_port_service_id" structure does not exist in the "pcieport_if.h" file. I checked the header file and it does not have this struct defined. I've looked all over the web for sample code for a PCI Express service and could not find any free source code examples...wierd!

 

I was hoping that somebody out there might have some sample PCI Express source code for Linux 2.6.32 that registers a service, provides read/write capability, and the steps to set it up and test it. Thats a  lot to ask for so even just a link to a tutorial would help. And yes, I did check the HOWTO documentation folder that comes with the Linux release and it still calls up the aforementioned struct so that was no big help.

 

0 Kudos
Highlighted
Scholar
Scholar
5,174 Views
Registered: ‎02-27-2008

Re: PCI Express driver for ML507

Jump to solution

bb,

 

OK.  You have certainly performed your due diligence.  I would expect that someone out there is able to help you with your driver.

 

So, anyone out there have any suggestions for bb?  They seem to have looked in all the right places.

 

 

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Highlighted
Teacher
Teacher
5,162 Views
Registered: ‎09-09-2010

Re: PCI Express driver for ML507

Jump to solution
Posting in the IP/PCI Express forum might have been better...

------------------------------------------
"If it don't work in simulation, it won't work on the board."
0 Kudos
Highlighted
Visitor
Visitor
6,438 Views
Registered: ‎06-06-2012

Re: PCI Express driver for ML507 - SOLVED

Jump to solution

SOLVED

 

According to our part-time Linux consultant, I was led astray by the info that I read at http://www.kernel.org/doc/ols/2005/ols2005v2-pages-9-18.pdf.

 

I can write a driver just like I've done in the past but register it as a pci driver whereas in the past, I registered as a platform driver.

 

I was pointed towards /drivers/net/3c59x.c for an example of how to write a driver.

 

Thx, Bill.  

View solution in original post