]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 20 Feb 2019 09:48:41 +0000 (10:48 +0100)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fri, 22 Feb 2019 10:51:14 +0000 (10:51 +0000)
commit676bf91b8a01fa4392afa32c3d4fcc90481e5e10
tree72e9013567363a1e8473693b7573b1686951d7d8
parente2671f794597969903c08e053535761f344853cd
PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags

Depending on the capabilities of the PCI controller/platform, the
PCI-to-PCI bridge emulation behavior might need to be different. For
example, on platforms that use the pci-mvebu code, we currently don't
support prefetchable memory BARs, so the corresponding fields in the
PCI-to-PCI bridge configuration space should be read-only.

To implement this, extend pci_bridge_emul_init() to take a "flags"
argument, with currently one flag supported:

PCI_BRIDGE_EMUL_NO_PREFETCHABLE_BAR

that will make the prefetchable memory base and limit registers
read-only.

The pci-mvebu and pci-aardvark drivers are updated accordingly.

Fixes: bf1a8567f4a9b ("PCI: mvebu: Convert to PCI emulated bridge config space")
Reported-by: Luís Mendes <luis.p.mendes@gmail.com>
Reported-by: Leigh Brown <leigh@solinno.co.uk>
Tested-by: Leigh Brown <leigh@solinno.co.uk>
Tested-by: Luis Mendes <luis.p.mendes@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org
Cc: Luís Mendes <luis.p.mendes@gmail.com>
Cc: Leigh Brown <leigh@solinno.co.uk>
drivers/pci/controller/pci-aardvark.c
drivers/pci/controller/pci-mvebu.c
drivers/pci/pci-bridge-emul.c
drivers/pci/pci-bridge-emul.h