platform device / driver model ?
From: Kumar Gala
Date: Wed Dec 01 2004 - 11:03:11 EST
I'm working on moving the PPC 85xx port to use the new driver model.
The 85xx family is a PowerPC SoC (core + various peripherals on a
single chip). An example of a chip would be the MPC8540. The MPC8540
has an e500 PPC core and uarts, ethernet, pci, etc. For ethernet it
has two Gig-E and one 10/100 interface. The gig-e vs 10/100 interface
use the same driver however, the 10/100 interface has some limited
functionality.
In making the changes I've got two questions on how to handle things:
1. I was planning on having platform_data point at a structure which
contained device flags and a board_data pointer. The device flag would
be used to pass on information to the driver to distinguish minor
feature devices. For example, between the gig-e interface would have
the following flags set HAS_RMON | HAS_GIGABIT, where the 10/100 would
not set either. Additionally, there is some information which is more
board specific. For example, why ethernet PHY was used, does it
support an external interrupt for status, etc. This information would
be in the board_data pointer.
struct foobar {
u32 flags;
void *board_data;
}
My question is where to put the definition of the structure or is there
a better way to do what I'm doing that already exists in the driver
model? I'm concerned about putting it in an include/asm-ppc since its
feasible that the same ethernet block could be used on a non-powerpc
device and the driver would still be valid. Actually, I think we have
this case coming up with a USB block being on both an ARM and PPC based
CPUs from Freescale.
2. Since board_data would be defined by the driver what is the best
place to put its structure definition. It seems rather evil to have
arch/ppc/platforms/foo.c including a header from drivers/net/.
thanks
- Kumar
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/