]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/powernv: PCI support for p7IOC under OPAL v2
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 15 Nov 2011 17:29:08 +0000 (17:29 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 25 Nov 2011 03:53:15 +0000 (14:53 +1100)
commit17f96e8a51fec546097fae1615fd33311af1af48
treedc1df367a9a3e5b641f480a2e9a729a337762492
parent951a8858a3b367b99aac6ec3ce73d2abe674ce8e
powerpc/powernv: PCI support for p7IOC under OPAL v2

This adds support for p7IOC (and possibly other IODA v1 IO Hubs)
using OPAL v2 interfaces.

We completely take over resource assignment and assign them using an
algorithm that hands out device BARs in a way that makes them fit in
individual segments of the M32 window of the bridge, which enables us
to assign individual PEs to devices and functions.

The current implementation gives out a PE per functions on PCIe, and a
PE for the entire bridge for PCIe to PCI-X bridges.

This can be adjusted / fine tuned later.

We also setup DMA resources (32-bit only for now) and MSIs (both 32-bit
and 64-bit MSI are supported).

The DMA allocation tries to divide the available 256M segments of the
32-bit DMA address space "fairly" among PEs. This is done using a
"weight" heuristic which assigns less value to things like OHCI USB
controllers than, for example SCSI RAID controllers. This algorithm
will probably want some fine tuning for specific devices or device
types.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/kernel/pci_dn.c
arch/powerpc/platforms/powernv/Makefile
arch/powerpc/platforms/powernv/pci-ioda.c [new file with mode: 0644]
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/powernv/pci.h