From: Arnd Bergmann <arnd@arndb.de>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Lior Amsalem <alior@marvell.com>,
Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
devicetree-discuss@lists.ozlabs.org,
Maen Suleiman <maen@marvell.com>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
Gregory Clement <gregory.clement@free-electrons.com>,
linux-arm-kernel@lists.infradead.org,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Subject: Re: [PATCH 04/14] bus: mvebu-mbus: Add static window allocation to the DT binding
Date: Fri, 7 Jun 2013 23:07:43 +0200 [thread overview]
Message-ID: <201306072307.44145.arnd@arndb.de> (raw)
In-Reply-To: <20130607200054.GA9010@obsidianresearch.com>
On Friday 07 June 2013, Jason Gunthorpe wrote:
> On Fri, Jun 07, 2013 at 09:01:44PM +0200, Arnd Bergmann wrote:
>
> > > +- compatible: Should be set to one of the following:
> > > + marvell,armada370-mbus
> > > + marvell,armadaxp-mbus
> >
> > I thought they are compatible with all older ones at the register level,
> > as long as we describe all the differences in the ranges property
> > and other properties.
>
> Agree, maybe this can come later?
I'm just wondering if the name should be for the original device that
introduced them.
> > > + soc {
> > > + devbus-bootcs {
> > > + status = "okay";
> > > + ranges = <0 0x012f0000 0xe8000000 0x8000000>;
> >
> > The example should also contain an #address-cells and #size-cells
> > property in the devbus-bootcs, as those are required for interpreting the
> > ranges property.
>
> Right,
>
> Is the ranges right though? I was expecting this:
>
> ranges = <0 0x012f0000 0 0x8000000>
>
> The 2nd address cell in the 2dword space should almost always be 0.
>
> The 2nd address cell should be interprited as the offset within the
> target's window, not as some kind of physical base address.
Ah, that's right. I missed that.
> >>+ (Note that the windowid cell is encoding the target ID = 0x01 and attribute
> >>+ ID = 0x2f, and the selected base address for the window is 0xe8000000).
>
> ... The proper place to indicate the base address for the window is in
> the mbus ranges:
>
> mbus {
> ranges = <0x012f0000 0 0xe8000000 0x8000000>
> devbus-bootcs {
> ranges = <0 0x012f0000 0 0x8000000>
> }
> }
>
> We shouldn't mangle the DT format just to make it convenient for
> humans to write - if this is a major problem then I'd try to use the
> preprocessor first.. There are several reasonable solutions down that
> path, IMHO.
agreed.
> > I don't understand the part about zeroing a windowid. Is "target = 0x0,
> > attribute = 0x0" the actual setting for the internal registers? If so,
> > don't call it a dummy translation or a special case.
> > If not, why not use the actual setting here?
>
> Internal regs has a special window register that doesn't have a target
> id. We need to define an address cell for it, I suggest something like
> <0xFFFFFFFF 0>, or <0x0000FFFF 0>...
Ok. I'd suggest using a value of '0' at least for the bits that are
used for encoding the other windows, and using the remaining bits to
identify whether it's the internal-reg or something else. One bit would
be enough for that, but 0xffff would work as well. I have a (weak)
preference for just using one bit. If we define a bit to mean "not
internal regs", then the macro could always set that, and zero would
actually be a valid and convenient representation of the internal regs.
> > > +
> > > + soc {
> > > + pcie-controller {
> > > + ranges =
> > > + <0x82000000 0 0x40000 0 0x40000 0 0x00002000
> > > + 0x82000000 0 0x80000 0 0x80000 0 0x00002000
> > > + 0x82000000 0 0xe0000000 0xffff0000 0xe0000000 0 0x08000000
> > > + 0x81000000 0 0 0xffff0000 0xe8000000 0 0x00100000>;
> > > +
> > > + pcie@1,0 {
> > > + /* ... */
> > > + };
> > > + };
> > > + };
>
> > Again, I don't understand this part. For the purpose of specification, I
> > would not make a special case here. It is not a hardware property that makes
> > these special but the way we use it from Linux. Consequently I would suggest
> > we skip the PCI ranges in the initial boot time setup by identifying the
> > pcie-controller node by its "compatible" property.
>
> This is tricky :| The PCIE controller needs both target IDs and the
> aperture range to allocate them in.
And the target ID is port specific, right?
Is the aperture range actually fixed in hardware in any way? Could we just
describe the entire 4GB translation for each port, and let the mbus driver
pass the aperture to the pcie driver, based on whatever address space is left
doing doing the boot-time window assignments?
Arnd
next prev parent reply other threads:[~2013-06-07 21:07 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 16:47 [PATCH 00/14] MBus device tree binding Ezequiel Garcia
[not found] ` <1370623671-7748-1-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-06-07 16:47 ` [PATCH 01/14] bus: mvebu-mbus: Use pr_fmt Ezequiel Garcia
[not found] ` <1370623671-7748-2-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-06-07 16:56 ` Thomas Petazzoni
2013-06-08 14:15 ` Jason Cooper
2013-06-07 16:47 ` [PATCH 02/14] bus: mvebu-mbus: Factor out initialization details Ezequiel Garcia
2013-06-07 16:47 ` [PATCH 03/14] bus: mvebu-mbus: Introduce device tree binding Ezequiel Garcia
[not found] ` <1370623671-7748-4-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-06-07 19:10 ` Arnd Bergmann
[not found] ` <201306072110.35856.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-07 19:44 ` Jason Gunthorpe
[not found] ` <20130607194430.GA7854-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-06-07 19:53 ` Arnd Bergmann
[not found] ` <201306072153.03855.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-07 20:09 ` Jason Gunthorpe
2013-06-07 21:15 ` Arnd Bergmann
[not found] ` <201306072315.50390.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-08 0:26 ` Jason Gunthorpe
2013-06-08 17:29 ` Ezequiel Garcia
2013-06-07 16:47 ` [PATCH 04/14] bus: mvebu-mbus: Add static window allocation to the DT binding Ezequiel Garcia
[not found] ` <1370623671-7748-5-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-06-07 19:01 ` Arnd Bergmann
[not found] ` <201306072101.44694.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-07 20:00 ` Jason Gunthorpe
2013-06-07 21:07 ` Arnd Bergmann [this message]
[not found] ` <20130607200054.GA9010-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-06-08 18:38 ` Ezequiel Garcia
2013-06-09 1:45 ` Jason Gunthorpe
[not found] ` <20130609014506.GB10027-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-06-09 14:39 ` Ezequiel Garcia
2013-06-11 13:57 ` Ezequiel Garcia
2013-06-11 15:26 ` Arnd Bergmann
2013-06-11 21:50 ` Jason Gunthorpe
[not found] ` <20130611215023.GA12649-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-06-11 22:22 ` Sebastian Hesselbarth
[not found] ` <51B7A325.8070108-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-06-11 23:02 ` Arnd Bergmann
2013-06-11 23:08 ` Jason Gunthorpe
[not found] ` <20130611230845.GB13892-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-06-12 7:37 ` Sebastian Hesselbarth
2013-06-11 22:34 ` Arnd Bergmann
2013-06-11 22:58 ` Jason Gunthorpe
[not found] ` <20130611225841.GA13892-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-06-11 23:10 ` Arnd Bergmann
2013-06-12 11:14 ` Grant Likely
2013-06-12 20:45 ` Arnd Bergmann
[not found] ` <201306122245.55960.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-12 21:12 ` Ezequiel Garcia
2013-06-12 21:26 ` Jason Gunthorpe
[not found] ` <20130612212641.GB8625-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2013-06-12 21:36 ` Ezequiel Garcia
2013-06-12 21:52 ` Arnd Bergmann
[not found] ` <201306122352.32749.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-12 22:02 ` Jason Gunthorpe
2013-06-12 22:20 ` Arnd Bergmann
[not found] ` <201306130020.30437.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-12 22:24 ` Arnd Bergmann
2013-06-15 16:03 ` Grant Likely
2013-06-12 20:02 ` Ezequiel Garcia
2013-06-12 20:12 ` Jason Gunthorpe
2013-06-12 21:50 ` Arnd Bergmann
2013-06-12 11:07 ` Grant Likely
2013-06-12 11:43 ` Arnd Bergmann
2013-06-12 11:54 ` Grant Likely
[not found] ` <CACxGe6v5wDK8nvuEZJ3o=pL7tvz-xdVwfnZFQjywL=JNZaHitQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-12 11:58 ` Arnd Bergmann
2013-06-12 10:52 ` Grant Likely
2013-06-09 13:42 ` Arnd Bergmann
2013-06-09 14:34 ` Ezequiel Garcia
2013-06-09 15:37 ` Arnd Bergmann
2013-06-12 10:48 ` Grant Likely
2013-06-11 13:31 ` Ezequiel Garcia
2013-06-11 15:02 ` Arnd Bergmann
2013-06-07 16:47 ` [PATCH 05/14] bus: mvebu-mbus: Update the mbus-compatible node's ranges property Ezequiel Garcia
[not found] ` <1370623671-7748-6-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-06-12 10:25 ` Grant Likely
2013-06-07 16:47 ` [PATCH 06/14] ARM: mvebu: Initialize MBus using the DT binding Ezequiel Garcia
2013-06-07 16:47 ` [PATCH 07/14] ARM: mvebu: Remove the harcoded BootROM window allocation Ezequiel Garcia
2013-06-07 16:47 ` [PATCH 08/14] memory: mvebu-devbus: Remove address decoding window workaround Ezequiel Garcia
2013-06-07 16:47 ` [PATCH 09/14] ARM: mvebu: Add MBus to Armada 370/XP device tree Ezequiel Garcia
2013-06-07 16:47 ` [PATCH 10/14] ARM: mvebu: Add BootROM " Ezequiel Garcia
2013-06-07 16:47 ` [PATCH 11/14] ARM: mvebu: Relocate Armada 370/XP DeviceBus device tree nodes Ezequiel Garcia
[not found] ` <1370623671-7748-12-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-06-07 19:18 ` Arnd Bergmann
2013-06-07 16:47 ` [PATCH 12/14] ARM: mvebu: Remove device tree unused properties on A370 Ezequiel Garcia
[not found] ` <1370623671-7748-13-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-06-07 16:56 ` Thomas Petazzoni
2013-06-08 14:18 ` Jason Cooper
2013-06-07 16:47 ` [PATCH 13/14] ARM: mvebu: Relocate Armada 370 PCIe device tree nodes Ezequiel Garcia
2013-06-07 16:47 ` [PATCH 14/14] ARM: mvebu: Relocate Armada XP " Ezequiel Garcia
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=201306072307.44145.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=alior@marvell.com \
--cc=andrew@lunn.ch \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maen@marvell.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=thomas.petazzoni@free-electrons.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;
as well as URLs for NNTP newsgroup(s).