From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Rob Herring <robh+dt@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
linux-soc@vger.kernel.org, Andy Gross <andy.gross@linaro.org>,
David Brown <david.brown@linaro.org>,
Stephen Boyd <sboyd@codeaurora.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: Re: [PATCH 1/4] soc: qcom: add an EBI2 device tree bindings
Date: Mon, 29 Aug 2016 13:51:12 +0200 [thread overview]
Message-ID: <201608291351.12915.arnd@arndb.de> (raw)
In-Reply-To: <CACRpkdZ=HU6j3=Ye4dm=tFU=KmG54bq06KDfxPViWUouOA=jOA@mail.gmail.com>
On Thursday 18 August 2016, Linus Walleij wrote:
> On Mon, Aug 8, 2016 at 11:32 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Monday, August 8, 2016 11:24:02 PM CEST Linus Walleij wrote:
>
> So two devices "foo" and "bar" on the EBI2 bus, in the old
> scheme.
>
> So I need to encode the CS in the first cell of the reg for
> foo-ebi2, and get rid of chipselect = <2> fine:
>
> ebi2@1a100000 {
> compatible = "qcom,msm8660-ebi2";
> #address-cells = <1>;
> #size-cells = <1>;
> (...)
> cs2@1b800000 {
> #address-cells = <2>;
> #size-cells = <1>;
> qcom,xmem-recovery-cycles = <5>;
> foo-ebi2@1b800000 {
> compatible = "foo";
> reg = <2 0x1b800000 0x100>;
> (...)
> };
> bar-ebi2@1ba00000 {
> compatible = "bar";
> reg = <2 0x1ba00000 0x100>;
> (...)
> };
> };
> };
>
> This is not looking good at all. First: the configuration settings for
> the chipselect (i.e. all devices below it, both "foo" and "bar" are
> just floating in space. When parsing the tree how should you know
> what chipselect to set up the stuff on? Shall I check the child nodes
> first value in the reg property and then make a majority vote on what
> chipselect they apply to or what? That doesn't make sense.
I would have one node per chip-select and then put the devices on
that CS below it, with #address-cells=1 again.
> So I assume doing away with the chipselect node altogether would
> be prefered. But then: where do I put stuff like "qcom,xmem-recovery-cycles"
> that apply to the whole chipselect, not just a single subdevice on that
> chipselect? I certainly cannot encode it in the reg since it needs
> to be the same for all devices and it's not about addressing.
>
> The only thing I can reasonably come up with would be this:
>
> ebi2@1a100000 {
> compatible = "qcom,msm8660-ebi2";
> #address-cells = <2>;
> #size-cells = <1>;
> qcom,xmem-recovery-cycles = <0>, <0>, <5>, <0>, <0>, <0>;
No, better put the settings into one device per cs.
> So the chip select settings are shoehorned into an array in the top
> node that is then indexed to find the settings for cs0, cs1 etc.
>
> There will be 6 such arrays for the different per-cs settings.
>
> Is this what you want? I kind of thought the hierarchical model
> was nice since each device was below its chipselect node, but
> I understand that it breaks the pattern of other similar bus drivers.
Nothing wrong with having a hierarchy here, what I'm interested
in is making the addressing reflect what the hardware actually
does. With the empty "ranges", it looks like the entire 32-bit
address is getting exposed to the external bus, which is usually
not how things work: instead, each "cs" line gets raised by an I/O
operation on a particular CPU address range, and that range should
be part of the "ranges" propert of the main bus node, and the
externally visible addresses should be the translated addresses
in the child bus representation in DT.
Arnd
next prev parent reply other threads:[~2016-08-29 11:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1470691445-27571-1-git-send-email-linus.walleij@linaro.org>
[not found] ` <1470691445-27571-1-git-send-email-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-08 21:24 ` [PATCH 1/4] soc: qcom: add an EBI2 device tree bindings Linus Walleij
[not found] ` <1470691445-27571-2-git-send-email-linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-08-08 21:32 ` Arnd Bergmann
2016-08-18 8:14 ` Linus Walleij
2016-08-29 11:51 ` Arnd Bergmann [this message]
2016-08-29 12:24 ` Rob Herring
[not found] ` <CAL_JsqJPckLGDSiqnspvtP_=t+yZ+0vO-8MxGB6x7poOZiyK+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-29 13:13 ` Linus Walleij
2016-08-29 13:42 ` Arnd Bergmann
[not found] ` <201608291542.55387.arnd-r2nGTMty4D4@public.gmane.org>
2016-08-29 16:18 ` Linus Walleij
[not found] ` <CACRpkdaRPa=tCH2FQUOUzp0Q2YvdLNA7R2y3w==sH40DwJ2vGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-29 14:06 ` Rob Herring
2016-08-29 17:21 ` Linus Walleij
2016-08-29 22:51 ` Rob Herring
[not found] ` <201608291351.12915.arnd-r2nGTMty4D4@public.gmane.org>
2016-08-29 12:45 ` Linus Walleij
2016-08-10 20:31 ` Rob Herring
[not found] <1467969122-6552-1-git-send-email-linus.walleij@linaro.org>
2016-07-08 9:11 ` Linus Walleij
2016-07-15 19:19 ` Rob Herring
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=201608291351.12915.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andy.gross@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.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;
as well as URLs for NNTP newsgroup(s).