]> git.ipfire.org Git - people/arne_f/kernel.git/commit
PCI: mvebu: split PCIe BARs into multiple MBus windows when needed
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 18 Apr 2014 12:19:53 +0000 (14:19 +0200)
committerJiri Slaby <jslaby@suse.cz>
Fri, 3 Mar 2017 10:44:50 +0000 (11:44 +0100)
commit42e99f1ca072b4e1c0ea6682d7c2c63929f3f3e2
treee3a3c12ec82a4311b955ea8a5cb488e2eaea5f9b
parent9921463b3aef9307dc9e19b1d6632b8d00f5bad2
PCI: mvebu: split PCIe BARs into multiple MBus windows when needed

commit 398f5d5e10b6b917cd9d35ef21d545b0afbada22 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: 45361a4fe446 ('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>
drivers/pci/host/pci-mvebu.c