Question about combining a PCI driver with an OF driver

Bruce_Leonard at Bruce_Leonard at
Wed Jan 5 05:58:35 EST 2011

Hi all,

I'm working on a project with an MPC8347 and three ethernet ports. Because 
of end of life issues we've had to replace the part we're using for the 
third ethernet port and we decided rather than rely on a vendor who would 
pull a part out from under us every two to three years we would do our own 
MAC in an FPGA.  In order to reduce driver work it was decided that we 
would use the same hardware interface as the TSEC in the 8347 so we could 
reuse the gianfar driver.  And for speed sake it would go on the PCI bus. 
(So much for letting HW make decisions regarding SW :)   )

So now I'm stuck with hacking the gianfar driver to work on PCI.  However, 
I think it would be a lot more elegant if I could wrap the gianfar driver 
with a PCI interface.  After all the idea is sound, with a HW interface 
that looks like the TSEC I should be able to reuse the gianfar driver. But 
the gianfar driver is an open firmware driver registered with a call to 
of_register_platform_driver() and depending on the order in which the 
busses are walked the PCI bus may not be enumerated and available when the 
onboard TSECS are detected and the gianfar driver claims them.

So the question is, how can I wrap an OF driver with a PCI driver so that 
I can just do a thin layer of probing the PCI bus, registering with the 
PCI sub-system, and then calling the OF probe in the gianfar driver?

Thanks for any insight.


More information about the Linuxppc-dev mailing list