From: David Gibson <david@gibson.dropbear.id.au>
To: Stephen Boyd <stephen.boyd@linaro.org>
Cc: "Rob Herring" <robh+dt@kernel.org>,
"Frank Rowand" <frowand.list@gmail.com>,
"Pantelis Antoniou" <pantelis.antoniou@konsulko.com>,
"Mark Brown" <broonie@kernel.org>,
"Grant Likely" <grant.likely@secretlab.ca>,
"Mark Rutland" <mark.rutland@arm.com>,
"Matt Porter" <mporter@konsulko.com>,
"Koen Kooi" <koen@dominion.thruhere.net>,
"Guenter Roeck" <linux@roeck-us.net>,
"Marek Vašut" <marex@denx.de>, "Wolfram Sang" <wsa@the-dreams.de>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"Pantelis Antoniou" <panto@antoniou-consulting.com>
Subject: Re: DT connectors, thoughts
Date: Mon, 29 Aug 2016 09:45:11 -0400 [thread overview]
Message-ID: <20160829134511.GC2166@littlecatz> (raw)
In-Reply-To: <147217552167.17958.11590706771471540284@sboyd-linaro>
[-- Attachment #1: Type: text/plain, Size: 4899 bytes --]
On Thu, Aug 25, 2016 at 06:38:41PM -0700, Stephen Boyd wrote:
> Quoting David Gibson (2016-07-21 21:25:56)
> > On Thu, Jul 21, 2016 at 02:15:57PM -0500, Rob Herring wrote:
> > > On Mon, Jul 18, 2016 at 9:20 AM, David Gibson
> > > <david@gibson.dropbear.id.au> wrote:
> > >
> > > I understand how you are using i2c alias, but not the intc. It would
> > > help if the same names were not used in multiple places unless they
> > > are the same thing.
> >
> > Yes, sorry. We have both the /soc/intc node which is the base board's
> > master interrupt controller. Then we have the connector local 'intc'
> > alias which describes the local interrupt space for just the
> > connector.
> >
> > > What does using aliases here buy us vs. just properties with a
> > > phandle?
> >
> > Um.. I'm not sure what you mean.
>
> I think Rob means drop the aliases node and just have:
Oh, ok. The reason for the aliases node is that putting the aliases
(or whatever you want to call them) in the top level connector node
limits what potential extensions we can make to the connector format.
The aliases can essentially have any property name, so they could
collide with additional "metadata" properties we might want to add.
> property = &phandle;
Note that the example above is misleading. Without the < >, the label
reference will expand to a path string, not a phandle.
> In this example:
>
> i2c = &i2c;
> intc = &w1_irqs;
> mmio = &mmio;
>
> or perhaps to have a list of phandles and names that map to them?
>
> targets = <&i2c>, <&w1_irqs>, <&mmio>;
> target-names = "i2c", "intc", "mmio";
That would work, but a) using phandles instead of paths introduces an
additional lookup for no particular benegit and b) it seems harder to
parse. In addition the aliases format suggested matches the global
aliases property already defined by IEEE1275, so it seems a good place
to start.
>
> ?
>
> >
> > > > mmio = &mmio;
> > > > };
> > > > };
> > > > };
> > > > };
> > > >
> > > > Note that the symbols are local to the connector, and explicitly
> > > > listed, rather than including all labels in the tree. This is to
> > > > enforce (or at the very least encourage) plugins to only access those
> > > > parts of the base tree.
> > > >
> > > > Note also the use of an interrupt nexus node contained within the
> > > > connector to control which irqs the socketed device can use. I think
> > > > this needs some work to properly handle unit addresses, but hope
> > > > that's enough to give the rough idea.
> > > >
> > > > So, what does the thing that goes in the socket look like? I'm
> > > > thinking some new dts syntax like this:
> > > >
> > > > /dts-v1/;
> > > >
> > > > /plugin/ foo,widget-socket {
> > > > compatible = "foo,whirligig-widget";
> > > > };
> > > >
> > > > &i2c {
> > > > whirligig-controller@... {
> > > > ...
> > > > interrupt-parent = <&widget-irqs>;
> > > > interrupts = <0>;
> > > > };
> > > > };
>
> How would we support an expansion board that goes onto two
> sockets/connectors provided by the baseboard when the connectors
> "export" the same phandle aliases? From what I can tell with this design
> we'll be unable to describe a device on the expansion board that is
> wired to properties provided by the two connectors.
Ok, so there are two parts to this.
1) Allowing a plugin to use multiple connectors.
I thought a bit about this case, but didn't address it for
simplicity. That would require a different syntax, so we can rethink
this if it's a use case we think we need.
2) Dealing with alias collisions between connector types
This one is fairly straightforward to handle. By default, we'll use
labels from connectors we plug into "as is". However, we can add a
syntax that allows us to locally rename labels from a connector (for
those familiar with Python, think "import foo from bar as baz").
So, combining those thoughts together, I'm thinking dtc format for
something connecting to two different widget sockets (pretty much the
worst case) would look something like:
/plugin/ foo,widget-socket {
};
/plugin/ foo,widget-socket {
realias {
i2c-b = "i2c";
intc-b = "intc";
mmio-b = "mmio";
};
};
&i2c {
.. devices on the i2c from the first plug ..
};
&i2c-b {
.. devices on the i2c from the second plug ..
};
Obviously we'd also need to devise an encoding for this to compile
into, since the one I proposed previously won't work in this case.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2016-08-29 13:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 20:58 portable device tree connector -- problem statement Frank Rowand
[not found] ` <577ACE0D.9050700-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-07-05 8:31 ` Mark Brown
2016-07-05 14:24 ` Frank Rowand
2016-07-05 18:07 ` Pantelis Antoniou
2016-07-05 18:04 ` Pantelis Antoniou
2016-07-18 14:20 ` DT connectors, thoughts David Gibson
2016-07-20 20:59 ` Pantelis Antoniou
2016-07-21 13:42 ` David Gibson
2016-07-21 14:14 ` Pantelis Antoniou
2016-07-21 19:09 ` Rob Herring
2016-07-21 19:15 ` Pantelis Antoniou
2016-07-21 19:21 ` Rob Herring
[not found] ` <2C63DCA2-385A-4EE3-A957-F1DBEF7929F8-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-07-22 4:16 ` David Gibson
2016-07-22 3:47 ` David Gibson
2016-07-22 3:46 ` David Gibson
2016-07-20 20:59 ` Pantelis Antoniou
2016-07-21 19:15 ` Rob Herring
2016-07-22 4:25 ` David Gibson
2016-08-26 1:38 ` Stephen Boyd
2016-08-29 13:45 ` David Gibson [this message]
[not found] ` <147252286938.20899.1763773530822329216@sboyd-linaro>
2016-08-30 23:55 ` David Gibson
[not found] ` <147329189889.27412.12053595745294007737@sboyd-linaro>
2016-09-08 0:26 ` 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=20160829134511.GC2166@littlecatz \
--to=david@gibson.dropbear.id.au \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=koen@dominion.thruhere.net \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=marex@denx.de \
--cc=mark.rutland@arm.com \
--cc=mporter@konsulko.com \
--cc=pantelis.antoniou@konsulko.com \
--cc=panto@antoniou-consulting.com \
--cc=robh+dt@kernel.org \
--cc=stephen.boyd@linaro.org \
--cc=wsa@the-dreams.de \
/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).