linux-imx/drivers/pci
Thomas Petazzoni 42e99f1ca0 PCI: mvebu: split PCIe BARs into multiple MBus windows when needed
commit 398f5d5e10 upstream.

MBus windows are used on Marvell platforms to map certain peripherals
in the physical address space. In the PCIe context, MBus windows are
needed to map PCIe I/O and memory regions in the physical address.

However, those MBus windows can only have power of two sizes, while
PCIe BAR do not necessarily guarantee this. For this reason, the
current pci-mvebu breaks on platforms where PCIe devices have BARs
that don't sum up to a power of two size at the emulated bridge level.

This commit fixes this by allowing the pci-mvebu driver to create
multiple contiguous MBus windows (each having a power of two size) to
cover a given PCIe BAR.

To achieve this, two functions are added: mvebu_pcie_add_windows() and
mvebu_pcie_del_windows() to respectively add and remove all the MBus
windows that are needed to map the provided PCIe region base and
size. The emulated PCI bridge code now calls those functions, instead
of directly calling the mvebu-mbus driver functions.

Fixes: 45361a4fe4 ('pci: PCIe driver for Marvell Armada 370/XP systems')
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397823593-1932-8-git-send-email-thomas.petazzoni@free-electrons.com
Tested-by: Neil Greatorex <neil@fatboyfat.co.uk>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
2017-03-03 11:44:50 +01:00
..
host PCI: mvebu: split PCIe BARs into multiple MBus windows when needed 2017-03-03 11:44:50 +01:00
hotplug powerpc/pci/rpadlpar: Fix device reference leaks 2017-01-26 17:40:19 +01:00
pcie PCI: Export pcie_find_root_port 2016-12-12 15:25:46 +01:00
access.c PCI: Use function 0 VPD for identical functions, regular VPD for others 2016-11-28 22:22:54 +01:00
ats.c
bus.c PCI: Delay enabling bridges until they're needed 2013-07-25 12:35:03 -06:00
host-bridge.c PCI: add host bridge release support 2012-04-30 14:52:43 -06:00
hotplug-pci.c PCI: hotplug: remove pci_do_scan_bus() 2012-06-13 15:42:27 -06:00
htirq.c
ioapic.c PCI: Convert ioapic.c to module_pci_driver 2013-05-27 17:05:28 -06:00
iov.c PCI: Return -ENOSYS for SR-IOV operations on non-SR-IOV devices 2013-07-31 16:47:56 -06:00
irq.c PCI: Convert dev_printk(KERN_<LEVEL> to dev_<level>( 2012-11-07 15:24:18 -07:00
Kconfig PCI: remove ARCH_SUPPORTS_MSI kconfig option 2013-08-12 15:26:48 +00:00
Makefile pci: PCIe driver for Marvell Armada 370/XP systems 2013-05-20 19:18:44 +00:00
msi.c PCI/MSI: Add device flag indicating that 64-bit MSIs don't work 2014-12-06 15:14:51 +01:00
of.c
pci-acpi.c PCI / ACPI / PM: Clear pme_poll for devices in D3cold on wakeup 2013-09-20 00:24:43 +02:00
pci-driver.c PCI: Generate uppercase hex for modalias var in uevent 2015-03-01 23:34:14 +01:00
pci-label.c
pci-stub.c PCI: Convert dev_printk(KERN_<LEVEL> to dev_<level>( 2012-11-07 15:24:18 -07:00
pci-sysfs.c PCI: Support PCIe devices with short cfg_size 2016-09-21 13:40:07 +02:00
pci.c PCI: Check for PME in targeted sleep state 2017-01-26 17:39:10 +01:00
pci.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-09-05 14:54:29 -07:00
probe.c PCI/AER: Clear error status registers during enumeration and restore 2016-06-23 13:58:55 +02:00
proc.c pci/proc: switch to fixed_size_llseek() 2013-06-29 12:57:48 +04:00
quirks.c PCI: Use function 0 VPD for identical functions, regular VPD for others 2016-11-28 22:22:54 +01:00
remove.c PCI: Add pcibios hooks for adding and removing PCI buses 2013-04-12 15:38:25 -06:00
rom.c PCI: Fix infinite loop with ROM image of size 0 2015-03-01 23:34:15 +01:00
search.c PCI: Fix reference count leak in pci_dev_present() 2013-01-25 13:49:27 -07:00
setup-bus.c PCI changes for the v3.12 merge window: 2013-09-03 16:24:35 -07:00
setup-irq.c PCI: Provide a default pcibios_update_irq() 2012-09-18 17:28:21 -06:00
setup-res.c PCI: Remove unused variables 2013-04-15 10:56:27 -06:00
slot.c PCI: Warn about failures instead of "must_check" functions 2013-04-17 10:21:12 -06:00
syscall.c
vpd.c
xen-pcifront.c xen/pcifront: Fix mysterious crashes when NUMA locality information was extracted. 2016-03-03 12:46:08 +01:00