public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux@fluff.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	devicetree-discuss <devicetree-discuss@ozlabs.org>,
	linux-kernel@vger.kernel.org, Timur Tabi <timur@freescale.com>,
	Jon Smirl <jonsmirl@gmail.com>,
	Scott Wood <scottwood@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 15:22:08 +0100	[thread overview]
Message-ID: <20090528142208.GB16199@trinity.fluff.org> (raw)
In-Reply-To: <fa686aa40905271322x2f62c3dcs355374b30b4db3ca@mail.gmail.com>

On Wed, May 27, 2009 at 02:22:50PM -0600, Grant Likely wrote:
> On Wed, May 27, 2009 at 1:39 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagnioj@jcrosoft.com> wrote:
> > On 20:21 Wed 27 May     , Russell King - ARM Linux wrote:
> >> On Wed, May 27, 2009 at 03:13:55PM -0400, Jon Smirl wrote:
> >> > On Wed, May 27, 2009 at 3:08 PM, Scott Wood <scottwood@freescale.com> wrote:
> >> > > I'm not talking about platform specific code, I'm talking about code to
> >> > > retrieve information about a device from the device tree.  There would not
> >> > > be separate instances of this for "platforms X, Y and Z", just one
> >> > > of_platform binding in each driver.  It's no different than having a
> >> > > platform bus binding, except in the data structures used.
> >> > >
> >> > > But to restate, having external glue to create platform devices from the
> >> > > device tree is fine if that's what you want to do.  We used to do that, but
> >> > > it was a pain compared to keeping everything in one place.  Your experience
> >> > > may differ.
> >> >
> >> > Could 'struct platform_device' and 'struct of_platform_device" be
> >> > unified into a single structure? It's personal preference whether the
> >> > internal representation of the hardware is done via a device tree or
> >> > snippets of platform code, but do we need to have to different device
> >> > types?
> >>
> >> That's a damned good question - platform devices have been around since
> >> the dawn of the device model, so the real question which needs to be
> >> asked is: what was the reason that of_platform_device created rather
> >> than unifying it with the already provided platform_device ?
> > I agree at 100%
> >
> > when you have to support the same driver for non OF and OF platform it's
> > really a pain in the ass
> 
> There are two issues that keep the of_platform and platform busses
> separate.  They aren't show stoppers, but they reflect the current
> state.
> 
> 1) Source of data: a platform_device carries a pdata structure with it
> to describe the hardware.  An of_device carries a device_node pointer.
>  Before dropping of_platform bus, a mechanism needs to be in place to
> add hooks for translating the device tree data into a pdata structure
> for each platform device.
> 
> 2) Driver binding mechanism:  device tree nodes usually have a
> "compatible" property which is a list of strings.  The first string
> describes exactly what the device is (ie. "atmel,24c08") and an
> optional list of other devices which it is register interface
> backwards compatible with.  The intent is that newer devices can claim
> compatibility with older ones so that existing device drivers will
> work without needing to be told the new device name.  However, it
> leaves the option when a device errata or something similar raises
> it's ugly head, a driver can still get information about the exact
> device name and apply the appropriate workarounds.  Driver probing
> should walk the list and give preference to higher priority compatible
> values.  of_platform bus does this, but I cannot think of a clean way
> to do the same thing with the platform bus.
> 
> One option that has been suggested (more than once) is to make the
> adapter code an of_platform_driver which translates the device tree
> data and then registers the appropriate platform_devices.  This neatly
> solves the problem, but I don't like the overhead involved in
> registering 2 struct devices with the kernel for every device node in
> the device tree.

Surely the code could simply run at init time, throwing away the data
and code it doesn't need once it is done?

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.


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

Thread overview: 151+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-27  7:08 [RFC] [PATCH] Device Tree on ARM platform 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 [this message]
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
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=20090528142208.GB16199@trinity.fluff.org \
    --to=ben-linux@fluff.org \
    --cc=devicetree-discuss@ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jonsmirl@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=plagnioj@jcrosoft.com \
    --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