mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Scott Wood <scottwood@freescale.com>,
	devicetree-discuss <devicetree-discuss@ozlabs.org>,
	linux-kernel@vger.kernel.org, Timur Tabi <timur@freescale.com>,
	Janboe Ye <yuan-bo.ye@motorola.com>,
	linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [RFC] [PATCH] Device Tree on ARM platform
Date: Thu, 28 May 2009 10:15:13 +0100	[thread overview]
Message-ID: <20090528091513.GA14789@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1243496236.3171.140.camel@pasglop>

On Thu, May 28, 2009 at 05:37:16PM +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2009-05-27 at 18:56 +0100, Russell King wrote:
> > 
> > smc91x is a prime example of the kind of information drivers need - base
> > address and irq are very much insufficient to describe how this device is
> > connected.  There's much more information required to specify this device
> > fully, and throwing it into the driver doesn't work.  We've been there
> > and proven that point.
> 
> The device-tree is a very nice and convenient way to convey all the
> informations the driver need straight to the driver without any platform
> code in the middle :-)

I'm still uncertain whether that's actually a true statement.  For some
cases, of course it's true, but I have a nasty suspicion that we have
corner cases where OF won't cope well with.

As I see it, if we were to convert to OF, we're boxing ourselves in to
a corner that would be extremely difficult to get out of.  We would
never be able to step back from OF.  Lets take an example.  If we were
to convert PXA to OF including all the PXA SoC drivers, and a board
configuration came along which required hacks to a driver.  Later on
we find that most platform authors are applying similar hacks because
their hardware is subtly different but those differences can't be
expressed via OF.  At this point, what do we do?  We can't say "well,
OF doesn't work well on this platform, we want to get rid of it" that
would be extremely difficult to impossible to do.


For example, how would an IrDA transceiver be expressed in OF?

Obviously it would have to start off with some sort of UART definition
for SIR, with a separate (and sometimes unrelated in terms of register
space and SoC pin configuration) FIR unit.  Whether FIR is used or not
is platform specific.  So far so good, I don't see a problem yet.

We then have one or two GPIOs doing some function - eg, one GPIO might
be a simple power on/off while the other controls FIR or SIR mode in
the transceiver itself.  Or the two lines might be a bit combination
which selects 'off', 'on + sir', 'on + fir' modes depending on the
transceiver used.  In the case of one GPIO it might be the mode select
or it might be the power control.

I suspect this can be expressed by having some sort of OF table specifying
several gpios & their value for each combination of power & mode...
except some platforms have special control registers in FPGAs which do
not appear as GPIOs... so how are those expressed?  We have function
pointers back into platform code to cope with this at present.


Another example - LCD displays.  Some platforms need a certain sequence
of GPIO activations with delays between when powering up and down the
LCD display.  Currently we express this in the platform support file and
pass a function pointer into the LCD Driver.  Can this be expressed with
OF?


Another example - backlights.  Some platforms need to twiddle a GPIO
at a certain point in the brightness scale and reset the PWM, and they
currently do this via an (optional) function pointer in the generic PWM
backlight driver.  Can this be expressed with OF?


That's just a few examples of areas where we haven't been able to describe
platforms using pure data-based descriptions, and they're all things that
we don't want to stuff into the individual drivers (doing so involves lots
of ifdefs and namespace pollution - we saw that in 2.4 kernels.)

In order for me to be convinced that OF is not going to cause us grief,
I'd like to see a range of platforms converted to OF to check that we're
not going to find any unexpected problems - eg, a load of PXA platforms,
particularly those with the above kinds of problems.

And no, Dave Miller saying "I've been using this for 15 years on Sparc"
"Three architectures are using it" isn't going to convince me.  The proof
is in the code, not the waffle.

  reply	other threads:[~2009-05-28  9:22 UTC|newest]

Thread overview: 151+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27  7:08 Janboe Ye
2009-05-27 14:27 ` Grant Likely
2009-05-27 14:39   ` Timur Tabi
2009-05-27 15:05     ` Robert Schwebel
2009-05-27 15:39       ` Grant Likely
2009-05-27 16:20         ` Robert Schwebel
2009-05-27 20:35           ` Grant Likely
2009-05-27 23:48             ` Robert Schwebel
2009-05-27 23:52               ` David Miller
2009-05-27 23:58               ` Scott Wood
2009-05-28  0:02                 ` David Miller
2009-05-28  0:07                 ` Robert Schwebel
2009-05-28  0:15                   ` David Miller
2009-05-28 10:37                     ` Mark Brown
2009-05-28 22:32                       ` Grant Likely
2009-05-29 12:34                         ` Mark Brown
2009-05-30  9:52                           ` Benjamin Herrenschmidt
2009-05-30 10:21                             ` Russell King - ARM Linux
2009-05-30 17:56                               ` Mark Brown
2009-06-02  7:57                               ` Holger Schurig
2009-06-02  9:48                                 ` Mark Brown
2009-05-28  2:57                   ` David Gibson
2009-05-28  3:36                     ` Grant Likely
2009-05-28  3:29                   ` Grant Likely
2009-05-28  9:51                     ` Wolfgang Denk
2009-05-28  9:59                       ` David Miller
2009-05-28 10:13                       ` Robert Schwebel
2009-05-28 13:33                         ` Jon Smirl
2009-05-28 13:42                           ` Robert Schwebel
2009-05-28  9:38                   ` Wolfgang Denk
2009-05-28  3:21                 ` Grant Likely
2009-05-28  3:16               ` Grant Likely
2009-05-28  0:55           ` Stephen Neuendorffer
2009-05-27 18:56         ` Alexander Clouter
2009-05-27 20:46           ` Grant Likely
2009-05-27 21:32             ` Alexander Clouter
2009-05-27 15:41       ` Peter Korsgaard
2009-05-27 16:23         ` Scott Wood
2009-05-27 17:56           ` Russell King
2009-05-27 19:08             ` Scott Wood
2009-05-27 19:13               ` Jon Smirl
2009-05-27 19:21                 ` Russell King - ARM Linux
2009-05-27 19:39                   ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-27 20:22                     ` Grant Likely
2009-05-27 20:19                       ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-27 20:54                         ` Grant Likely
2009-05-28  3:04                           ` David Gibson
2009-05-28  7:58                           ` Benjamin Herrenschmidt
2009-05-27 23:57                       ` Robert Schwebel
2009-05-28  0:00                         ` David Miller
2009-05-28  3:21                         ` Grant Likely
2009-05-28  6:34                           ` Wolfram Sang
2009-05-28  7:55                             ` Benjamin Herrenschmidt
2009-05-28 13:34                             ` Grant Likely
2009-05-28  7:48                         ` Benjamin Herrenschmidt
2009-05-28 14:22                       ` Ben Dooks
2009-05-27 20:28                     ` David Miller
2009-05-27 20:31                       ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-28  2:52                   ` David Gibson
2009-05-28  4:27                     ` David Miller
2009-05-28  4:47                       ` David Gibson
2009-05-28  5:31                         ` David Miller
2009-05-28  5:47                           ` David Gibson
2009-05-28  7:47                   ` Benjamin Herrenschmidt
2009-05-28 14:17                 ` Ben Dooks
2009-05-28 14:24                   ` Robert Schwebel
2009-05-28 14:47                   ` Grant Likely
2009-05-27 19:29               ` Russell King
2009-05-27 19:47                 ` Sergei Shtylyov
2009-05-27 19:53                 ` Scott Wood
2009-05-27 19:54                   ` Timur Tabi
2009-05-27 20:25                     ` David Miller
2009-05-27 20:27                       ` Timur Tabi
2009-05-27 20:55                         ` David Miller
2009-05-27 23:26                           ` Robert Schwebel
2009-05-27 20:35                       ` M. Warner Losh
2009-05-27 20:14                   ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-27 20:23                 ` David Miller
2009-05-27 20:27                   ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-27 20:48                     ` Josh Boyer
2009-05-27 20:56                     ` David Miller
2009-05-27 20:52                 ` Mark Brown
2009-05-27 21:05                   ` Grant Likely
2009-05-28  0:11                     ` Jon Smirl
2009-05-28 12:43                     ` Sascha Hauer
2009-05-28 13:18                       ` Thomas Gleixner
2009-05-28 15:04                         ` Sascha Hauer
2009-05-28 15:27                           ` Thomas Gleixner
2009-05-29  0:51                           ` Benjamin Herrenschmidt
2009-05-29  7:52                             ` Sascha Hauer
2009-05-29  9:08                               ` Benjamin Herrenschmidt
2009-05-31 10:52                             ` Russell King - ARM Linux
2009-05-28 14:31                       ` Grant Likely
2009-05-28  3:25                   ` David Gibson
2009-05-28  8:10                 ` Benjamin Herrenschmidt
2009-05-28  7:38               ` Benjamin Herrenschmidt
2009-05-27 20:43             ` Grant Likely
2009-05-28  7:37             ` Benjamin Herrenschmidt
2009-05-28  9:15               ` Russell King - ARM Linux [this message]
2009-05-28  9:57                 ` David Miller
2009-05-28 10:11                   ` Benjamin Herrenschmidt
2009-05-28 10:33                     ` Robert Schwebel
2009-05-28 10:34                     ` Russell King - ARM Linux
2009-05-28 22:33                       ` Benjamin Herrenschmidt
2009-05-28 10:14                   ` Russell King - ARM Linux
2009-05-28 21:30                     ` David Miller
2009-05-28 12:17                   ` Dmitry Eremin-Solenikov
2009-05-28 12:48                     ` David Gibson
2009-05-28 12:55                       ` David Gibson
2009-05-28 14:13                     ` Grant Likely
2009-05-28 16:53                       ` Russell King - ARM Linux
2009-05-28 17:05                         ` Grant Likely
2009-05-28 18:46                         ` Alexander Clouter
2009-05-28 22:21                       ` Benjamin Herrenschmidt
2009-05-29  1:39                         ` David Gibson
2009-05-29  1:59                           ` Mitch Bradley
2009-05-29  3:52                             ` Benjamin Herrenschmidt
2009-05-29  4:11                               ` David Miller
2009-05-29  4:11                             ` David Miller
2009-05-29  4:56                               ` Benjamin Herrenschmidt
2009-05-29  5:11                                 ` David Miller
2009-05-28 10:00                 ` Benjamin Herrenschmidt
2009-05-28 11:44                 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-28 12:47                 ` Jon Smirl
2009-05-28 14:39                   ` Grant Likely
2009-05-28 14:54                 ` Grant Likely
2009-05-27 18:26           ` Peter Korsgaard
2009-05-27 16:32       ` Mark Brown
2009-05-27 18:50         ` Jon Smirl
2009-05-27 22:24           ` Mark Brown
2009-05-28  0:04             ` Jon Smirl
2009-05-28 13:07               ` Mark Brown
2009-05-27 20:42         ` Grant Likely
2009-05-27 21:38           ` Mark Brown
2009-05-28  3:02       ` David Gibson
2009-05-28  7:32       ` Benjamin Herrenschmidt
2009-05-28 13:38         ` Grant Likely
2009-05-27 22:01     ` Mitch Bradley
2009-05-28  8:17       ` Benjamin Herrenschmidt
2009-05-28 12:43     ` Holger Schurig
2009-05-28 13:12       ` Mark Brown
2009-05-27 17:44   ` Russell King
2009-05-27 17:52     ` Grant Likely
2009-05-28  3:44       ` David Gibson
2009-05-30 11:22 ` Pavel Machek
2009-05-31  1:29   ` Kyle Moffett
2009-05-31  5:56     ` David Miller
2009-06-01  8:37     ` Dmitry Eremin-Solenikov
2009-05-31 10:08 ` Russell King - ARM Linux
2009-06-01  9:24   ` Stephen Rothwell
2009-06-01 10:36   ` Janboe Ye

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=20090528091513.GA14789@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=devicetree-discuss@ozlabs.org \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=scottwood@freescale.com \
    --cc=timur@freescale.com \
    --cc=yuan-bo.ye@motorola.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

Powered by JetHome