From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: monstr@monstr.eu
Cc: linux-pci@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
Thierry Reding <thierry.reding@avionic-design.de>,
Rob Herring <rob.herring@calxeda.com>,
David Laight <David.Laight@ACULAB.COM>,
Rob Herring <robherring2@gmail.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: pci and pcie device-tree binding - range No cells
Date: Mon, 10 Dec 2012 18:15:25 +0100 [thread overview]
Message-ID: <20121210181525.3ccd87c6@skate> (raw)
In-Reply-To: <50C60839.70603@monstr.eu>
Dear Michal Simek,
On Mon, 10 Dec 2012 17:05:13 +0100, Michal Simek wrote:
> CC: Thomas: I think it will be interesting to see this discussion
> because you are using size-cell/address-cells equal 1.
> http://www.spinics.net/lists/arm-kernel/msg211839.html
Thanks for Cc'ing me.
The thing is that on Marvell SoCs, we don't need to describe statically
in the Device Tree the translation between CPU addresses and PCI device
addresses, because those translations are set up dynamically at run
time through address decoding windows.
Marvell SoCs have up to 20 configurable address windows, which allow
you, at run time, to say "I would like the range from physical address
0xYYYYYYYY to 0xZZZZZZZZ to correspond to the PCIe device in port 1,
lane 2, or to the NAND, or to this or that device". Therefore, in the
PCIe driver I proposed for the Armada 370/XP SoCs [1], there is no need
to encode all those ranges statically in the DT.
The only "ranges" property I'm using is to allow the DT sub-nodes
describing each PCIe port/lane to access the CPU registers that allow
to see if the PCIe link is up or down, access the PCI configuration
space and so on. So all ranges in my "ranges" property correspond to
normal CPU registers, like the one you would put in the "reg" property
for any device. The fact that those devices are PCIe is really
orthogonal here.
Of course, I have no idea if I'm doing a correct usage of the DT, but I
certainly don't need those 6 values ranges with bits to say if it's I/O
space, memory space, bus number, device number and so on. The physical
addresses at which I'm setting up my address decoding windows are
decided dynamically at runtime, depending on the number of PCIe devices
that are found in the different PCIe slots (for now, those windows have
a statically defined size, but I'd ideally would like to size them to
match exactly the size of the PCIe device memory, in order to avoid
wasting physical address space, but I haven't found how to get the size
needed for each PCIe device during the ARM pcibios initialization
sequence).
For those willing to have a look at the PCIe patch set for Armada
370/XP, see:
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/136455.html.
The core of the PCIe driver and its DT binding documentation is at
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-December/136711.html.
Thanks a lot for your comments,
Thomas
[1] that I hope to extend to cover previous Marvell SoCs as well, they
work basically the same way
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2012-12-10 17:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-10 12:20 pci and pcie device-tree binding - range No cells Michal Simek
2012-12-10 14:26 ` Rob Herring
2012-12-10 15:05 ` Michal Simek
2012-12-10 15:21 ` Rob Herring
2012-12-10 15:37 ` Michal Simek
2012-12-10 15:52 ` David Laight
2012-12-10 16:05 ` Michal Simek
2012-12-10 17:15 ` Thomas Petazzoni [this message]
2012-12-10 23:24 ` Rob Herring
2012-12-12 16:16 ` Thomas Petazzoni
2012-12-12 17:22 ` Grant Likely
2012-12-12 17:29 ` Rob Herring
2012-12-10 16:02 ` Rob Herring
2012-12-10 16:11 ` Michal Simek
2012-12-10 21:43 ` Grant Likely
2012-12-10 22:38 ` Benjamin Herrenschmidt
2012-12-10 23:11 ` Mitch Bradley
2012-12-10 21:41 ` Grant Likely
2012-12-12 10:37 ` Michal Simek
2012-12-12 10:49 ` Grant Likely
[not found] ` <CAPcvp5EJH-Q6wd7my+V+FUVE1=hzwMN-yOfHiukGvDmkcoRcsQ@mail.gmail.com>
2012-12-12 12:19 ` Andrew Murray
2012-12-12 13:34 ` Thierry Reding
2012-12-12 16:44 ` Andrew Murray
2012-12-12 16:55 ` Michal Simek
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=20121210181525.3ccd87c6@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=David.Laight@ACULAB.COM \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=monstr@monstr.eu \
--cc=rob.herring@calxeda.com \
--cc=robherring2@gmail.com \
--cc=thierry.reding@avionic-design.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).