linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: Manuel Lauss <manuel.lauss@googlemail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH 1/4] alchemy: register au1000_eth as a platform driver  part one
Date: Thu, 30 Jul 2009 22:50:20 +0200	[thread overview]
Message-ID: <200907302250.21044.florian@openwrt.org> (raw)
In-Reply-To: <f861ec6f0907290727q3955d0fave0fb0a18bb035284@mail.gmail.com>

Hi Manuel, Sergei,

Le Wednesday 29 July 2009 16:27:02 Manuel Lauss, vous avez écrit :
> Hi Sergei,
>
> >> Yes I know ;) I was just wanting to get this out quickly before you kill
> >> platform.c
> >
> >   I'd NAK such patch (and have already done so, AFAIR).
>
> I've already surrendered myself to the fact that I'll never be able to get
> rid of this file in my lifetime.  However I've set a timer on my mail
> machine to send a patch (which I'll keep rebasing to latest sources) trying
> that again in 80 years or so ;-)
>
> >> I will make the au1000-eth devices be registered on a per-board basis.
> >
> >   Please don't. You can register them in platform.c, and yet leave
> > actually board specific platform data in the board files. There's no
> > reason to duplicate the platfrom device itself.
>
> Let's say I have 2 pieces of hardware, indentical in all things,
> except one has an Au1100, and the other Au1500 (different MAC mmio
> address and unit counts).  I want to build a kernel which runs on both.
> This can certainly be done, but the existence of common/platform.c and
> your insistence on maintaining the status-quo limits me to one board
> per kernel (theoretical example currently, i know).

I am still a big fan of a single kernel approach for a SoC whenever runtime 
identification is possible.

>
> I also dislike having to #ifdef around this file when a new platform
> is introduced which doesn't need/use all devices registered in there!
> (for example au1200 mmc platform data. Suppose I have a platform
> which doesn't use mmc; I can either add a #ifdef for my new board or
> provide empty platform data stubs in my board code.  Both solutions
> suck IMO; the former because then when I (and others) submit new
> board code upstream common/platform.c will develop into a mess of
> random #ifdefs (just look at common/reset.c!) and the latter because
> platform data and -device registration are in different places in the
> source tree.

Well, right now, the au1000_eth driver has been converted in a way that even 
passing no platform_data to it makes it pick the right defaults (searching 
for PHY1 on MAC0) so this is not a big problem here, this might not be the 
case with other drivers.

Even though it duplicates quite a lot of code, it's still cleaner when you 
either have to pick up the eval board which is the closest to your design, or 
have to add a new board.

I am going to respin the patches with the Ethernet driver registered in a 
per-board platform.c file, which lets room for other platform devices to be 
registered there too. Everyone can then make up his mid about which approach 
he prefers ;)
-- 
Best regards, Florian Fainelli
Email: florian@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
-------------------------------

      parent reply	other threads:[~2009-07-30 20:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 21:00 [PATCH 1/4] alchemy: register au1000_eth as a platform driver part one Florian Fainelli
2009-07-29  7:15 ` Manuel Lauss
2009-07-29  7:15   ` Manuel Lauss
2009-07-29  8:10   ` Florian Fainelli
2009-07-29 13:41     ` Sergei Shtylyov
2009-07-29 14:27       ` Manuel Lauss
2009-07-29 14:27         ` Manuel Lauss
2009-07-30 20:50         ` Florian Fainelli [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=200907302250.21044.florian@openwrt.org \
    --to=florian@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=manuel.lauss@googlemail.com \
    --cc=ralf@linux-mips.org \
    --cc=sshtylyov@ru.mvista.com \
    /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).