From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] PCI: ARM: add support for generic PCI host controller
Date: Wed, 19 Feb 2014 21:48:48 +0100 [thread overview]
Message-ID: <3905203.TvF8RmfLsz@wuerfel> (raw)
In-Reply-To: <CAErSpo5PCTyZ5jzumJxD=CCN+-t-Z31Cw+9ejT_oTQ4fFQePag@mail.gmail.com>
On Wednesday 19 February 2014 13:18:24 Bjorn Helgaas wrote:
> >
> > Right, this is an interesting case indeed, and I think we haven't
> > considered it in the binding so far. We already encode a "bus-range"
> > in DT, so we can easily partition the ECAM config space, but it
> > still violates one of the two assumptions:
> > a) that the register ranges for the two host bridge devices are
> > non-overlapping in DT
> > b) that the ECAM register range as specified in DT starts at bus
> > 0 and is a power-of-two size.
> > Since the binding is not fixed that, we could change the definition to
> > say that the ECAM register range in the "reg" property must match
> > the buses listed in the "bus-range" property.
>
> Addresses in the ACPI MCFG table correspond to bus number 0, but the
> MCFG also provides start & end bus numbers, so the valid range does
> not necessarily start with bus 0 and need not be power-of-two in size.
> Something similar sounds like a good idea for DT.
Hmm, we'll have to think about that. From a DT perspective, we try
to keep things local to the node using it, so listing only the
registers we are allowed to access is more natural.
Another option would be to have a separate device node for the ECAM
registers and point to that from the host controller node, which
would describe this cleanly but also add a bit of complexity that
will rarely be used.
> > I still want to make sure I understand exactly what this case is about
> > though, i.e. what is shared and what is separate if you have two host
> > bridges with a common ECAM region:
> >
> > * I assume I/O space is always shared on x86, but probably separate
> > elsewhere.
>
> I think x86 *could* support multiple I/O spaces, but user-mode
> inb/outb could only reach the 0-64K space. I think ia64 has the same
> limitation on user code, but it supports many spaces in the kernel.
Ok.
> > * Each host would always have a fixed memory space aperture, right?
>
> The ACPI _CRS/_PRS/_SRS mechanism theoretically allows changes to the
> bus number, I/O space, and memory space apertures of host bridges.
> But we don't do any of those changes today, and I don't know if any
> BIOSes actually allow it.
I mean non-overlapping apertures in particular. We also have
cases where the aperture that we list in DT is just programmed
into hardware registers by the host driver and could be arbitrary,
but you can't normally have the same MMIO address go to two
devices on internal buses (or not in a sensible way).
> > * From what I understand from your description, the hardware does
> > not enforce specific bus numbers for each host. How does the
> > host bridge know its root bus number then?
>
> I don't know details of any specific hardware. I'm just saying that
> ACPI provides a mechanism for the OS to manipulate the bus number
> range below a host bridge. Of course, a BIOS is free to omit _PRS and
> _SRS, and in that case, the bus/IO/memory apertures reported by _CRS
> are fixed and can't be changed. We learn the root bus number from the
> host bridge _CRS (but I'm sure you knew that, so maybe I missed the
> point of your question).
I guess the answer then is that the host bridge can have a register
for programming the root bus number, but it's not standardized and
therefore the access is hidden in the _PRS/_SRS methods. If we have
the same on DT and want to reprogram the bus numbers, we'd need to
have a kernel driver for the nonstandard registers of the host bridge.
> > * Should I expect one IOMMU per host bridge or one ECAM region,
> > or can either be possible?
>
> It's possible to have multiple IOMMUs per host bridge, and I think
> they can even be buried down in the PCIe hierarchy.
Oh, I didn't know that. So how do you actually find the IOMMU for
a given domain/bus/device/function combination?
> > * The IntA-IntB IRQ numbers are always per host bridge I assume.
>
> For conventional PCI, INTx are just wires that could go anywhere, so
> there's no connection between them and a host bridge. You have to
> have a _PRT or similar to make sense out of them. For PCIe, a Root
> Complex maps INTx emulation messages to system interrupts in an
> implementation-specific way, so we need a _PRT there, too. I don't
> think there's a requirement that these IRQ numbers be per-host bridge.
Right, makes sense.
Thanks for the detailed explanations!
Arnd
next prev parent reply other threads:[~2014-02-19 20:48 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 20:16 [PATCH v2 0/3] ARM: PCI: implement generic PCI host controller Will Deacon
2014-02-12 20:16 ` [PATCH v2 1/3] ARM: mach-virt: allow PCI support to be selected Will Deacon
2014-02-12 20:16 ` [PATCH v2 2/3] ARM: bios32: use pci_enable_resource to enable PCI resources Will Deacon
2014-02-12 22:28 ` Jason Gunthorpe
2014-02-13 10:06 ` Will Deacon
2014-02-13 12:22 ` Jingoo Han
2014-02-12 20:16 ` [PATCH v2 3/3] PCI: ARM: add support for generic PCI host controller Will Deacon
2014-02-12 20:59 ` Arnd Bergmann
2014-02-13 11:04 ` Will Deacon
2014-02-13 11:47 ` Arnd Bergmann
2014-02-13 12:00 ` Will Deacon
2014-02-13 12:21 ` Arnd Bergmann
2014-02-12 21:51 ` Kumar Gala
2014-02-13 11:07 ` Will Deacon
2014-02-13 16:22 ` Kumar Gala
2014-02-13 16:25 ` Will Deacon
2014-02-13 16:28 ` Arnd Bergmann
2014-02-13 18:11 ` Mark Rutland
2014-02-13 18:26 ` Jason Gunthorpe
2014-02-13 19:53 ` Will Deacon
2014-02-13 20:20 ` Jason Gunthorpe
2014-02-14 9:59 ` Arnd Bergmann
2014-02-14 22:00 ` Liviu Dudau
2014-02-15 13:03 ` Arnd Bergmann
2014-02-18 17:41 ` Jason Gunthorpe
2014-02-18 18:25 ` Arnd Bergmann
2014-02-18 18:45 ` Jason Gunthorpe
2014-02-18 19:13 ` Arnd Bergmann
2014-02-19 2:44 ` Liviu Dudau
2014-02-19 6:48 ` Jason Gunthorpe
2014-02-19 10:24 ` Arnd Bergmann
2014-02-19 11:37 ` Liviu Dudau
2014-02-19 13:26 ` Arnd Bergmann
2014-02-19 15:30 ` Liviu Dudau
2014-02-19 19:47 ` Arnd Bergmann
2014-02-19 0:28 ` Bjorn Helgaas
2014-02-19 9:58 ` Arnd Bergmann
2014-02-19 18:20 ` Bjorn Helgaas
2014-02-19 19:06 ` Arnd Bergmann
2014-02-19 20:18 ` Bjorn Helgaas
2014-02-19 20:48 ` Arnd Bergmann [this message]
2014-02-19 21:10 ` Jason Gunthorpe
2014-02-19 21:33 ` Bjorn Helgaas
2014-02-19 22:12 ` Arnd Bergmann
2014-02-19 22:18 ` Bjorn Helgaas
2014-02-13 19:52 ` Rob Herring
2014-02-13 18:06 ` Jason Gunthorpe
2014-02-13 19:51 ` Will Deacon
2014-02-13 18:26 ` [PATCH v2 0/3] ARM: PCI: implement " Jason Gunthorpe
2014-02-14 11:05 ` Arnd Bergmann
2014-02-18 18:00 ` Jason Gunthorpe
2014-02-18 18:40 ` Arnd Bergmann
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=3905203.TvF8RmfLsz@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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