All of lore.kernel.org
 help / color / mirror / Atom feed
* platform device / driver model ?
@ 2004-12-01 15:59 Kumar Gala
  0 siblings, 0 replies; only message in thread
From: Kumar Gala @ 2004-12-01 15:59 UTC (permalink / raw)
  To: Linux Kernel Development

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-01 15:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-01 15:59 platform device / driver model ? Kumar Gala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.