Devicetree
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Robert Schwebel <r.schwebel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: devicetree-discuss
	<devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org,
	Janboe Ye <yuan-bo.ye-3WKxDLwmzFNWk0Htik3J/w@public.gmane.org>,
	Timur Tabi <timur-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	rmk-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org
Subject: Re: [RFC] [PATCH] Device Tree on ARM platform
Date: Wed, 27 May 2009 21:16:19 -0600	[thread overview]
Message-ID: <fa686aa40905272016i69d8e762v186943ac4121038a@mail.gmail.com> (raw)
In-Reply-To: <20090527234801.GP6805-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On Wed, May 27, 2009 at 5:48 PM, Robert Schwebel
<r.schwebel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> On Wed, May 27, 2009 at 02:35:11PM -0600, Grant Likely wrote:
>> > Unfortunately, it is an incomplete data structure regarding to what
>> > the kernel needs.
>>
>> I don't follow your argument. It's a data structure that uniquely
>> describes your hardware in a way which encourages the most code reuse
>> possible; but is still independent of kernel internal implementation.
>> ie. a FDT blob should be usable not just by Linux, but also by BSD or
>> any of the other OS options. It is not an attempt to eliminate
>> platform specific code; just to reduce it as much as possible. Weird,
>> harry, non-standard stuff probably still needs board specific code to
>> handle.
>
> The oftree by design wants to be a complete hardware description. As you
> mention above, there are cases where you *nevertheless* need ad-hoc
> information about things *not* encoded into the device tree.

That is an oversimplified characterization.  Of course the device tree
is striving to be a complete hardware description; but it cannot and
should not describe everything.  The goal is to make common stuff
common, and still have a mechanism to identify the corner cases.  For
example, most serial ports are described with a single node with
'compatible = "ns16550"' and 'reg', 'interrupts', 'current-speed' and
'clock-frequency' properties to describe the configuration.  This is a
common idiom which doesn't require any additional platform specific
code.  However, for a one-off board specific device which doesn't have
any kind of common description would probably be described simply as:

        data-capture@[address] {
                compatible = "<manufacturer>,<custom-daq-device-name>;
                reg = < [address] [size] >;
                interrupts = < [irq-number] [irq-sense] >;
        }

It it would be assumed that the device driver knows the details about
how the device is wired up.

So, no it does not eliminate platform specific code in all cases
(although I would argue most cases), but it does significantly reduce
it.

> This renders the whole concept ad absurdum. You need a machine number
> again - and if you need that: why not stay with the ARM model, define
> everything with platform data and avoid the whole thing?

That is not the problem being addressed.  It doesn't address
multiplatform kernels, it does not address the duplicate code issue,
and it doesn't address the reduced effort required of board ports.

> Regarding the multi OS argument: I consider it impossible that people
> agree on all micro details of a hardware decision. Will it really be
> possible to get a common agreement about let's say Russell's SMSC
> example between all these people? Remember: if we forget (or don't agree
> on) one single aspect which a driver developer *needs*, he will have to
> work around it -> machine number land.

Even assuming that you are correct; there is greater pressure when
using the device tree to make things work together because it means
less code to maintain.

> My impression is that oftree only works in a perfect world. But we don't
> have one, so the fundamental design decision is broken.

I disagree.  For the things that do work (and there are a lot of them)
it is a net win, and for the corner cases which do not, the mechanism
allows for the ability to handle exceptions at the
platform-support-code level (not at the device driver level).  That's
why I like the device tree model.  It acknowledges that the data
structure will never be perfect and provides the ability to deal with
it gracefully.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  parent reply	other threads:[~2009-05-28  3:16 UTC|newest]

Thread overview: 142+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1243408083.13460.14.camel@debian-nb>
2009-05-27 14:27 ` [RFC] [PATCH] Device Tree on ARM platform Grant Likely
2009-05-27 14:39   ` Timur Tabi
     [not found]     ` <ed82fe3e0905270739k38018c87ka11f62c5977e45fb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-27 15:05       ` Robert Schwebel
2009-05-27 16:32         ` Mark Brown
2009-05-27 18:50           ` Jon Smirl
     [not found]             ` <9e4733910905271150q1d51538draa8d039c8b147c05-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-27 22:24               ` Mark Brown
     [not found]                 ` <20090527222420.GC5591-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2009-05-28  0:04                   ` Jon Smirl
2009-05-28 13:07                     ` Mark Brown
     [not found]           ` <20090527163223.GE1970-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2009-05-27 20:42             ` Grant Likely
     [not found]               ` <fa686aa40905271342v5bc51665tb9b5d92950a43b82-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-27 21:38                 ` Mark Brown
     [not found]         ` <20090527150527.GK6805-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-05-27 15:39           ` Grant Likely
     [not found]             ` <fa686aa40905270839m375bbdacqb1acb1be0a2d2da0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-27 16:20               ` Robert Schwebel
     [not found]                 ` <20090527162000.GM6805-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-05-27 20:35                   ` Grant Likely
     [not found]                     ` <fa686aa40905271335o1165419hda2334bef42aa3f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-27 23:48                       ` Robert Schwebel
     [not found]                         ` <20090527234801.GP6805-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-05-27 23:52                           ` David Miller
2009-05-27 23:58                           ` Scott Wood
     [not found]                             ` <4A1DD3A0.3010501-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2009-05-28  0:02                               ` David Miller
2009-05-28  0:07                               ` Robert Schwebel
     [not found]                                 ` <20090528000707.GR6805-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-05-28  0:15                                   ` David Miller
     [not found]                                     ` <20090527.171525.204909140.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-05-28 10:37                                       ` Mark Brown
     [not found]                                         ` <20090528103745.GA19523-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2009-05-28 22:32                                           ` Grant Likely
2009-05-29 12:34                                             ` Mark Brown
     [not found]                                               ` <20090529123411.GB14650-HF5t3jzXg/6ND3a5+9QAFujbO/Zr0HzV@public.gmane.org>
2009-05-30  9:52                                                 ` Benjamin Herrenschmidt
2009-05-30 10:21                                                   ` Russell King - ARM Linux
     [not found]                                                     ` <20090530102153.GA6910-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-05-30 17:56                                                       ` Mark Brown
2009-06-02  7:57                                                     ` Holger Schurig
     [not found]                                                       ` <200906020957.20493.hs4233-x6+DxXLjN1AJvtFkdXX2Hg4jNU5vUVPG@public.gmane.org>
2009-06-02  9:48                                                         ` Mark Brown
2009-05-28  2:57                                   ` David Gibson
     [not found]                                     ` <20090528025718.GC1464-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-05-28  3:36                                       ` Grant Likely
2009-05-28  3:29                                   ` Grant Likely
2009-05-28  9:51                                     ` Wolfgang Denk
     [not found]                                       ` <20090528095126.99DB4832E416-C2Gvrrd9BC/j/ljBK/0BTg@public.gmane.org>
2009-05-28  9:59                                         ` David Miller
2009-05-28 10:13                                         ` Robert Schwebel
     [not found]                                           ` <20090528101339.GV6805-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-05-28 13:33                                             ` Jon Smirl
     [not found]                                               ` <9e4733910905280633u15546189q37a4b4080158249c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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 [this message]
2009-05-28  0:55                   ` Stephen Neuendorffer
2009-05-27 18:56             ` Alexander Clouter
     [not found]               ` <2ve0f6-8fn.ln1-kuKQLpWnKMRB2HF5bZY0Orm56z/blAVA@public.gmane.org>
2009-05-27 20:46                 ` Grant Likely
2009-05-27 21:32                   ` Alexander Clouter
2009-05-28 14:29                     ` Dmitry Eremin-Solenikov
2009-05-27 15:41           ` Peter Korsgaard
     [not found]             ` <87vdnm8sec.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org>
2009-05-27 16:23               ` Scott Wood
2009-05-27 17:56                 ` Russell King
     [not found]                   ` <20090527175609.GB31861-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-05-27 19:08                     ` Scott Wood
     [not found]                       ` <4A1D8FBA.6040802-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2009-05-27 19:13                         ` Jon Smirl
2009-05-27 19:21                           ` Russell King - ARM Linux
     [not found]                             ` <20090527192116.GA31110-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-05-27 19:39                               ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]                                 ` <20090527193927.GD30039-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2009-05-27 20:22                                   ` Grant Likely
     [not found]                                     ` <fa686aa40905271322x2f62c3dcs355374b30b4db3ca-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-27 20:19                                       ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]                                         ` <20090527201951.GF30039-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2009-05-27 20:54                                           ` Grant Likely
     [not found]                                             ` <fa686aa40905271354y50b9583cp9f53c35354edc285-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-28  3:04                                               ` David Gibson
2009-05-28  7:58                                               ` Benjamin Herrenschmidt
2009-05-27 23:57                                       ` Robert Schwebel
     [not found]                                         ` <20090527235704.GQ6805-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-05-28  0:00                                           ` David Miller
2009-05-28  3:21                                           ` Grant Likely
     [not found]                                             ` <fa686aa40905272021w18a148caqd2b73c4448da2b28-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-28  6:34                                               ` Wolfram Sang
     [not found]                                                 ` <20090528063445.GA12004-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
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
     [not found]                                     ` <20090527.132827.65331718.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-05-27 20:31                                       ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-28  2:52                               ` David Gibson
     [not found]                                 ` <20090528025258.GB1464-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-05-28  4:27                                   ` David Miller
     [not found]                                     ` <20090527.212730.183576278.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-05-28  4:47                                       ` David Gibson
     [not found]                                         ` <20090528044732.GK1464-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-05-28  5:31                                           ` David Miller
     [not found]                                             ` <20090527.223147.94364683.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
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
     [not found]                             ` <20090528141743.GA16199-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2009-05-28 14:47                               ` Grant Likely
2009-05-27 19:29                         ` Russell King
2009-05-27 19:47                           ` Sergei Shtylyov
     [not found]                           ` <20090527192909.GA32398-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-05-27 19:53                             ` Scott Wood
     [not found]                               ` <4A1D9A1E.80603-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2009-05-27 19:54                                 ` Timur Tabi
     [not found]                                   ` <4A1D9A66.5020002-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2009-05-27 20:25                                     ` David Miller
     [not found]                                       ` <20090527.132553.40558501.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-05-27 20:27                                         ` Timur Tabi
     [not found]                                           ` <4A1DA24D.5000101-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2009-05-27 20:55                                             ` David Miller
     [not found]                                               ` <20090527.135500.217447785.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
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
     [not found]                               ` <20090527.132328.78091350.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-05-27 20:27                                 ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]                                   ` <20090527202701.GA16219-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2009-05-27 20:48                                     ` Josh Boyer
2009-05-27 20:56                                     ` David Miller
2009-05-27 20:52                             ` Mark Brown
     [not found]                               ` <20090527205218.GA5591-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2009-05-27 21:05                                 ` Grant Likely
     [not found]                                   ` <fa686aa40905271405pc2f1738gc8dd139f61a0e27-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-28  0:11                                     ` Jon Smirl
2009-05-28 12:43                                     ` Sascha Hauer
2009-05-28 13:18                                       ` Thomas Gleixner
     [not found]                                         ` <alpine.LFD.2.00.0905281457170.3397-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-05-28 15:04                                           ` Sascha Hauer
     [not found]                                             ` <20090528150409.GO22742-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-05-28 15:27                                               ` Thomas Gleixner
2009-05-29  0:51                                               ` Benjamin Herrenschmidt
2009-05-29  7:52                                                 ` Sascha Hauer
     [not found]                                                   ` <20090529075238.GC24565-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-05-29  9:08                                                     ` Benjamin Herrenschmidt
2009-05-31 10:52                                                 ` Russell King - ARM Linux
     [not found]                                       ` <20090528124307.GN22742-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
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
     [not found]                         ` <20090528091513.GA14789-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-05-28  9:57                           ` David Miller
     [not found]                             ` <20090528.025739.16559619.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-05-28 10:11                               ` Benjamin Herrenschmidt
2009-05-28 10:33                                 ` Robert Schwebel
2009-05-28 10:34                                 ` Russell King - ARM Linux
     [not found]                                   ` <20090528103421.GC14789-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-05-28 22:33                                     ` Benjamin Herrenschmidt
2009-05-28 10:14                               ` Russell King - ARM Linux
     [not found]                                 ` <20090528101440.GB14789-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-05-28 21:30                                   ` David Miller
2009-05-28 12:17                             ` Dmitry Eremin-Solenikov
2009-05-28 12:48                               ` David Gibson
     [not found]                                 ` <20090528124817.GB4565-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-05-28 12:55                                   ` David Gibson
2009-05-28 14:13                               ` Grant Likely
     [not found]                                 ` <fa686aa40905280713u2b3ef5fvbe3d58ccdb629b60-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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
     [not found]                                       ` <20090529013908.GA7831-787xzQ0H9iRg7VrjXcPTGA@public.gmane.org>
2009-05-29  1:59                                         ` Mitch Bradley
     [not found]                                           ` <4A1F4189.8060702-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2009-05-29  3:52                                             ` Benjamin Herrenschmidt
2009-05-29  4:11                                               ` David Miller
2009-05-29  4:11                                             ` David Miller
     [not found]                                               ` <20090528.211123.46272556.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
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
     [not found]                             ` <9e4733910905280547w7ee65d40yb4b3ab9559e14dae-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-28 14:39                               ` Grant Likely
2009-05-28 14:54                           ` Grant Likely
2009-05-27 18:26                 ` Peter Korsgaard
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
     [not found]         ` <4A1DB855.2030608-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2009-05-28  8:17           ` Benjamin Herrenschmidt
2009-05-27 17:44   ` Russell King
     [not found]     ` <20090527174440.GA31861-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-05-27 17:52       ` Grant Likely
     [not found]         ` <fa686aa40905271052k3f55eb73k2cb0c3cff3c94d7b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-05-28  3:44           ` David Gibson

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=fa686aa40905272016i69d8e762v186943ac4121038a@mail.gmail.com \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=r.schwebel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=rmk-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=timur-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=yuan-bo.ye-3WKxDLwmzFNWk0Htik3J/w@public.gmane.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