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: Mon, 21 Jun 2004 16:12:14 -0700	[thread overview]
Message-ID: <20040621161214.A5851@home.com> (raw)
In-Reply-To: <20040621213948.GA8849@zenos.farnsworth.org>; from dale@farnsworth.org on Mon, Jun 21, 2004 at 02:39:48PM -0700


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.

> Comments?  Suggestions on how to go about getting this into linux-2.5?

Send a two part patch, 1/2 (file moves) 2/2 PPC changes to Nicolas
and cc jgarzik

-Matt

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

  reply	other threads:[~2004-06-21 23:12 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 [this message]
2004-06-22  0:41   ` Dale Farnsworth
2004-06-23 12:58     ` Dale Farnsworth
2004-06-23 16:28       ` Matt Porter

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=20040621161214.A5851@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).