All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kumar Gala <kumar.gala@freescale.com>
To: Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: platform device / driver model ?
Date: Wed, 1 Dec 2004 09:59:39 -0600	[thread overview]
Message-ID: <01D8FD1F-43B2-11D9-9FBC-000393DBC2E8@freescale.com> (raw)

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


                 reply	other threads:[~2004-12-01 15:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01D8FD1F-43B2-11D9-9FBC-000393DBC2E8@freescale.com \
    --to=kumar.gala@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.