On December 22, 2009 11:11:30 am David Wooff wrote:
> It's slightly complicated because my FPGA is effectively a bridge to a
> number of hot-pluggable
> backplane I/O cards.  It seems to me that I should probably attempt to
> structure it (the FPGA and backplane)
> as a bus with I/O card devices hanging off it.  The FPGA also performs
> other functions.

It sounds like ioctls are the way to talk to the FPGA, and your driver should 
take on the appearance of a platform or multifunction device driver (most 
likely the latter). I've written drivers like this in the past and it sounds 
like that's the way you're going to want to head if you want to minimize the 
amount of code you will be writing.

If I were you I think I'd take a look at a few of the MFD drivers 
(drivers/mfd/*) in the kernel already to get a feel for how things are pieced 
together, get the FPGA part working and then start building on from there.

Basically, as the FPGA detects new card insertions or card removals, the FPGA 
(base driver) would then use the standard kernel notification system and the 
kernel would handle all the probing/initialization and/or cleanup of the 
appropriate sub-driver. These sub-drivers could be either part of the same 
FPGA driver or even entirely different kernel modules. Each one of them would 
have its own char device and thus its own ioctls or other interfaces 
(whichever seems the best fit). udev would take care of userspace notification 
and the whole system would be pretty flexible and maintainable.

-A.
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to