All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pantelis Antoniou <panto@antoniou-consulting.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: David Gibson <david@gibson.dropbear.id.au>,
	Grant Likely <grant.likely@secretlab.ca>,
	Kevin Hilman <khilman@ti.com>, Matt Porter <mporter@ti.com>,
	Koen Kooi <koen@dominion.thruhere.net>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Felipe Balbi <balbi@ti.com>, Deepak Saxena <dsaxena@linaro.org>,
	Scott Wood <scottwood@freescale.com>,
	Russ Dill <Russ.Dill@ti.com>,
	linux-omap@vger.kernel.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [RFC] Device Tree Overlays Proposal (Was Re: capebus moving omap_devices to mach-omap2)
Date: Mon, 12 Nov 2012 14:05:47 +0200	[thread overview]
Message-ID: <D212FBB3-B434-4B9F-9237-95C4117834DB@antoniou-consulting.com> (raw)
In-Reply-To: <509D8A62.1080102@wwwdotorg.org>

Hi Stephen,

On Nov 10, 2012, at 12:57 AM, Stephen Warren wrote:

> On 11/08/2012 07:26 PM, David Gibson wrote:
> ...
>> I also think graft will handle most of your use cases, although as I
>> said I don't fully understand the implications of some of them, so I
>> could be wrong.  So, the actual insertion of the subtree is pretty
>> trivial to implement.  phandles are the obvious other matter to be
>> dealt with.  I haven't found the right thread where what you've
>> envisaged so far is discussed, so here are things I can see:
>> 
>> 1) Avoiding phandle collisions between main tree and subtree (or
>>   between subtrees).
>> 
>> I'm hopeful that this can be resolved just by establishing some
>> conventions about the ranges of phandles to be used for various
>> components.  I'd certainly be happy to add a directive to dtc which
>> enforces allocation of phandles within a specified range.
> 
> One case I wonder about is:
> 
> Base board A that's split into two .dts files e.g. due to there being
> two versions of the base board which are 90% identical, yet there being
> a few differences between them.
> 
> Base board B that's just a single .dts file.
> 
> We might allocate phandle range 0..999 for the base board.
> 
> Child board X plugs into either, so the two base boards need to "export"
> the same set of phandle IDs to the child board to allow it to reference
> them.
> 
> If base board A version 2 comes along after the phandle IDs that the
> child board uses are defined, then how do we handle assigning a specific
> phandle ID range to each of base board A's two version-specific
> overlays, when the version-specific changes might affect arbitrary
> phandle IDs within the range, and require some to be moved into the base
> board version-specific overlays and some to stay in the common base
> board .dts?
> 

Static phandle allocation, could work, but not without considerable trouble.

Maybe we're over-engineering things. Perhaps having the kernel use the
phandle values generated by dtc is not required.

What about the following simple scheme:

1) Have dtc create local phandle values the same way, as it is today.
   Generate the flat tree normally, but keep in a table the locations
   of all phandle references. Keep track of non resolvable phandle references
   in a different table. One could use the fixup mechanism I described in
   a previous email, if you don't care about keeping a big table.
2) Upon loading the base DT or the overlay, the kernel makes sure the phandles
   don't overlap; simply add a per DT fragment constant offset.
3) Resolve phandle references that were unresolved at compile time.
 

>> 2) Resolving phandle references within a subtree
>> 
>> If we can handle (1) by convention, we don't need anything here, the
>> references are fine as is.
>> 
>> (3) Resolving phandle references from the subtree to the main tree.
>> 
>> So, I think this can actually be avoided, at least in cases where what
>> physical connections are available to the expansion module is well
>> defined.  The main causes to have external references are interrupts
>> and gpios.  Interrupts we handle by defining an interrupt specifier
>> space for the interrupts available on the expansion
>> socket/connector/bus/whatever.  In the master tree we then have
>> something like:
>> 
>> ...
>> 	expansion-socket@XXXX {
>> 		expansion-id = "SlotA";
>> 		interrupt-map = < /* map expansion irq specs to
>> 				     board interrupt controllers */ >;
>> 		interrupt-map-mask = < ... >;
>> 		ranges = < /* map expansion local addresses to global
>> 		              mmio */ >;
>> 	};
> 
> We would end up needing an interrupt-map or ranges type of property for
> basically any resource type.
> 
> For example, what about an I2C bus that's routed to the daughter board,
> and the daughter board contains an I2C bus mux, whose control path isn't
> through I2C but rather GPIOs? In this case, the I2C bus mux isn't a
> child of the I2C bus, but a separate entity that indicates its parent
> I2C bus using a phandle. I presume a similar argument applies to almost
> any kind of resource. This is probably do-able, but certainly something
> to consider with the socket approach. I do like the socket approach though.

Capebus has taken this approach.

You see, perhaps from the standpoint of the standard platform devices that
a cape provides, a bus is not a very fitting construct.

But from a hardware engineer/user perspective, a cape is an expansion board,
and virtual slots are used. This is similar to what you're saying
with socket approach, right? 

Regards

-- Pantelis



  parent reply	other threads:[~2012-11-12 12:05 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 20:40 [RFC] Device Tree Overlays Proposal (Was Re: capebus moving omap_devices to mach-omap2) Grant Likely
2012-11-05 21:40 ` Tabi Timur-B04825
2012-11-05 21:40   ` Tabi Timur-B04825
2012-11-05 23:22   ` Tony Lindgren
2012-11-05 23:22     ` Tony Lindgren
2012-11-09 12:06     ` Grant Likely
2012-11-09 12:06       ` Grant Likely
2012-11-06  0:07   ` Grant Likely
2012-11-06  0:07     ` Grant Likely
2012-11-06 10:31   ` Pantelis Antoniou
2012-11-06 10:31     ` Pantelis Antoniou
2012-11-07 22:35   ` Ryan Mallon
2012-11-07 22:35     ` Ryan Mallon
2012-11-08 13:28     ` Koen Kooi
2012-11-08 13:28       ` Koen Kooi
2012-11-08 14:09       ` Timur Tabi
2012-11-08 14:09         ` Timur Tabi
2012-11-08 17:00       ` Mitch Bradley
2012-11-08 17:00         ` Mitch Bradley
2012-11-06 10:30 ` Pantelis Antoniou
2012-11-06 11:14   ` Grant Likely
2012-11-06 18:35     ` Tony Lindgren
2012-11-06 19:29       ` Russ Dill
2012-11-06 19:41         ` Pantelis Antoniou
2012-11-06 19:41           ` Pantelis Antoniou
2012-11-06 22:17           ` Stephen Warren
2012-11-06 22:17             ` Stephen Warren
2012-11-06 19:34     ` Pantelis Antoniou
2012-11-06 20:45       ` Grant Likely
2012-11-06 20:50         ` Grant Likely
2012-11-07  8:06         ` Pantelis Antoniou
2012-11-07 15:33           ` Alan Tull
2012-11-07 15:33             ` Alan Tull
2012-11-09 17:03           ` Grant Likely
2012-11-07  8:13         ` Pantelis Antoniou
2012-11-07 10:19           ` Benoit Cousson
2012-11-07 10:19             ` Benoit Cousson
2012-11-07 11:02             ` Pantelis Antoniou
2012-11-07 11:02               ` Pantelis Antoniou
2012-11-07 11:12               ` Benoit Cousson
2012-11-07 11:12                 ` Benoit Cousson
2012-11-07 11:23                 ` Pantelis Antoniou
2012-11-07 11:23                   ` Pantelis Antoniou
2012-11-09 20:33               ` Grant Likely
2012-11-12 11:34                 ` Pantelis Antoniou
2012-11-12 13:01                   ` Grant Likely
2012-11-07 17:25             ` Stephen Warren
2012-11-07 22:10               ` Pantelis Antoniou
2012-11-07 22:10                 ` Pantelis Antoniou
2012-11-08 10:36               ` Cousson, Benoit
2012-11-08 10:36                 ` Cousson, Benoit
2012-11-09  5:32   ` Joel A Fernandes
2012-11-09 14:29     ` David Gibson
2012-11-10  3:15       ` Joel A Fernandes
2012-11-09 21:22     ` Grant Likely
2012-11-12 11:47       ` Pantelis Antoniou
2012-11-12 11:47         ` Pantelis Antoniou
2012-11-13  3:59       ` Joel A Fernandes
2012-11-09 22:59     ` Stephen Warren
     [not found]   ` <-4237940489086529028@unknownmsgid>
     [not found]     ` <559B8433-67C3-4A1A-A5D6-859907655176@antoniou-consulting.com>
2012-11-10  3:36       ` Joel A Fernandes
2012-11-10  3:36         ` Joel A Fernandes
2012-11-12 12:48         ` Pantelis Antoniou
2012-11-13  2:28         ` David Gibson
2012-11-06 22:37 ` Stephen Warren
2012-11-06 22:37   ` Stephen Warren
2012-11-07  0:54   ` Mitch Bradley
2012-11-07  0:54     ` Mitch Bradley
2012-11-09 17:02     ` Grant Likely
2012-11-12 11:29       ` Pantelis Antoniou
2012-11-07  8:47   ` Pantelis Antoniou
2012-11-07 17:18     ` Stephen Warren
2012-11-07 22:08       ` Pantelis Antoniou
2012-11-07 22:08         ` Pantelis Antoniou
2012-11-09 16:28   ` Grant Likely
2012-11-09 23:23     ` Stephen Warren
2012-11-09 23:40       ` Grant Likely
2012-11-12 10:53         ` Koen Kooi
2012-11-12 12:10       ` Pantelis Antoniou
2012-11-12 12:10         ` Pantelis Antoniou
2012-11-12 16:52         ` Stephen Warren
2012-11-13  7:25           ` David Gibson
2012-11-13  8:09             ` Pantelis Antoniou
2012-11-13  8:09               ` Pantelis Antoniou
2012-11-13 12:24               ` Grant Likely
2012-11-13 13:38                 ` Pantelis Antoniou
2012-11-13 13:38                   ` Pantelis Antoniou
2012-11-15  4:57                   ` David Gibson
2012-11-13 17:10               ` Stephen Warren
2012-11-13 23:30               ` David Gibson
2012-11-13 23:30                 ` David Gibson
2012-11-14  0:00                 ` Pantelis Antoniou
2012-11-13 16:57             ` Stephen Warren
2012-11-13 18:10               ` Mitch Bradley
2012-11-13 18:10                 ` Mitch Bradley
2012-11-13 18:29                 ` Stephen Warren
2012-11-13 18:29                   ` Stephen Warren
2012-11-13 19:09                   ` Mitch Bradley
2012-11-13 19:11                     ` Pantelis Antoniou
2012-11-17 22:27       ` Jean-Christophe PLAGNIOL-VILLARD
2012-11-20 17:09         ` Grant Likely
2012-11-11 20:47     ` Rob Landley
2012-11-12 12:50       ` Pantelis Antoniou
2012-11-12 16:54         ` Stephen Warren
2012-11-12 16:54           ` Stephen Warren
2012-11-12 11:23     ` Pantelis Antoniou
2012-11-12 16:49       ` Stephen Warren
2012-11-12 17:00         ` Pantelis Antoniou
2012-11-12 17:10           ` Stephen Warren
2012-11-12 17:19             ` Pantelis Antoniou
2012-11-12 17:29               ` Stephen Warren
2012-11-12 17:38                 ` Pantelis Antoniou
2012-11-12 20:16       ` Russ Dill
2012-11-12 16:45     ` Stephen Warren
2012-11-09  2:26 ` David Gibson
2012-11-09 15:40   ` Pantelis Antoniou
2012-11-13  0:03     ` David Gibson
2012-11-13  0:03       ` David Gibson
2012-11-09 21:08   ` Grant Likely
2012-11-13  0:05     ` David Gibson
2012-11-13  0:05       ` David Gibson
2012-11-09 21:42   ` Grant Likely
2012-11-13  1:05     ` David Gibson
2012-11-13  1:05       ` David Gibson
2012-11-13  5:22       ` Stephen Warren
2012-11-13  6:54         ` David Gibson
2012-11-13  6:54           ` David Gibson
2012-11-09 22:57   ` Stephen Warren
2012-11-09 23:27     ` Grant Likely
2012-11-12 12:05     ` Pantelis Antoniou [this message]
2012-11-09 23:14   ` Stephen Warren
2012-11-09 23:14     ` Stephen Warren
2012-11-09 23:06 ` Stephen Warren
2012-11-09 23:32   ` Grant Likely
2012-11-12 11:03 ` Koen Kooi
2012-11-12 11:03   ` Koen Kooi

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=D212FBB3-B434-4B9F-9237-95C4117834DB@antoniou-consulting.com \
    --to=panto@antoniou-consulting.com \
    --cc=Russ.Dill@ti.com \
    --cc=balbi@ti.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dsaxena@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=khilman@ti.com \
    --cc=koen@dominion.thruhere.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mporter@ti.com \
    --cc=scottwood@freescale.com \
    --cc=swarren@wwwdotorg.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.