linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Matt Porter <mporter@kernel.crashing.org>
To: Dale Farnsworth <dale@farnsworth.org>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: 2.6 networking support for Redwood[56]
Date: Wed, 23 Jun 2004 09:28:09 -0700	[thread overview]
Message-ID: <20040623092809.A25264@home.com> (raw)
In-Reply-To: <20040623125835.GA15700@zenos.farnsworth.org>; from dale@farnsworth.org on Wed, Jun 23, 2004 at 05:58:35AM -0700


On Wed, Jun 23, 2004 at 05:58:35AM -0700, Dale Farnsworth wrote:
>
> On Tue, Jun 22, 2004 at 12:41:11AM +0000, Dale Farnsworth wrote:
> > On Mon, Jun 21, 2004 at 11:12:14PM +0000, Matt Porter wrote:
> > > On Mon, Jun 21, 2004 at 02:39:48PM -0700, Dale Farnsworth wrote:
> > > >
> > > > I'm adding network support for the IBM Redwood5 and Redwood6 in 2.6.
> > > >
> > > > It looks like the best supported driver for the smc91111 chip
> > > > is used by the ARM folks and is found in drivers/net/arm/smc91x.[ch]
> > > > This driver recently went into the linux-2.5 tree.
> > > >
> > > > I moved these two files into drivers/net so they are available for
> > > > PPC as well as ARM and added some Redwood-specific support.  That
> > > > was straightforward.  This driver calls a couple of ARM-specific
> > > > functions platform_get_resource() and platform_get_irq().  ARM
> > > > implements these functions in arch/arm/common/platform.c.  I
> > > > copied arch/arm/common/platform.c into arch/ppc/syslib/platform.c
> > > > which works fine, but I don't care for duplicated code.  Maybe a
> > > > better approach would be to add these functions to drivers/base/platform.c
> > >
> > > How about wrapping each arch-specific call up in something more abstract
> > > and then using OCP to get the PPC info?
> > >
> > > roughly...
> > >
> > > #ifdef CONFIG_PPC_OCP
> > > TO_SMC_DEV		to_ocp_device()
> > > SMC_GET_BASE_ADDR	dev->def->paddr
> > > ...
> > > #else /* ARM */
> > > TO_SMC_DEV		to_platform_device()
> > > SMC_GET_BASE_ADDR	platform_get_resource(dev, IORESOURCE_MEM, 1)
> > > ...
> > > #endif
> > >
> > > There's only about 4 places in the probe/remove calls to do this.
> > > Add an ocp_add_one_device in your redwood*.c to enable the smc9111
> > > device with the board-specific attributes.
> > >
> > > You may have to play a bit with the prove/remove calls since they
> > > want to deal with a resource struct, but it might be worth looking
> > > at.
> >
> > Sounds like a better approach.  I'll modify the driver to present
> > either the ARM interface or the PPC_OCP interface.  Muddles the
> > driver a bit, but should keep both archs happy.
>
> FYI, platform_get_resource() and platform_get_irq() just went into
> linux-2.5/drivers/base/platform.c so this issue is now moot.

Yep, I agree with that.

-Matt

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

      reply	other threads:[~2004-06-23 16:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-21 21:39 2.6 networking support for Redwood[56] Dale Farnsworth
2004-06-21 23:12 ` Matt Porter
2004-06-22  0:41   ` Dale Farnsworth
2004-06-23 12:58     ` Dale Farnsworth
2004-06-23 16:28       ` Matt Porter [this message]

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=20040623092809.A25264@home.com \
    --to=mporter@kernel.crashing.org \
    --cc=dale@farnsworth.org \
    --cc=linuxppc-embedded@lists.linuxppc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).