[PATCH v2 0/3] ARM: PCI: implement generic PCI host controller
Jason Gunthorpe
jgunthorpe at obsidianresearch.com
Thu Feb 13 13:26:55 EST 2014
On Wed, Feb 12, 2014 at 08:16:08PM +0000, Will Deacon wrote:
> Like v1, I continue to support only a single controller and therefore a
> single I/O space. I'm not sure how to represent multiple controllers in the
> device-tree without inventing some horrible hacks, so any ideas in this area
> would be much appreciated.
The DT representation is very straightforward, just have more copies
of what you already have. Each DT stanza should be represented in
Linux a distinct PCI domain.
In Linux you run into two small problems
1) PCI Domain numbers needs to be allocated dynamically
* I think there should be a core thing to allocate a domain
object w/ a struct device, and assign a unique domain number.
We are already seeing drivers do things like keep track
of their own domain numbers via a counter (pcie-designware.c)
The host bridge object is similar to this but it isn't focused
on a domain.
2) The space in the IO fixed mapping needs to be allocated to PCI
host drivers dynamically
* pci_ioremap_io_dynamic that takes a bus address + cpu_physical
address and returns a Linux virtual address.
The first caller can get a nice traslation where bus address ==
Linux virtual address, everyone after can get best efforts.
You will have overlapping physical IO bus addresses - each domain will
have a 0 IO BAR - but those will have distinct CPU physical addresses
and can then be uniquely mapped into the IO mapping. So at the struct
resource level the two domains have disjoint IO addresses, but each
domain uses a different IO offset..
Jason
More information about the linux-arm-kernel
mailing list