pci: mpc85xx: Do not access PCI BARs registers of BDF address 00:00.0
authorPali Rohár <pali@kernel.org>
Thu, 20 Apr 2023 19:44:23 +0000 (21:44 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 1 May 2023 22:59:33 +0000 (18:59 -0400)
commitc06597ff1151580d3ab7094c0175138b3896d16d
treed0dbeb6b52725f11eac33e859f031d4a4b44f5be
parent159f104076d4a0693599900deb8173f2af5942a4
pci: mpc85xx: Do not access PCI BARs registers of BDF address 00:00.0

At BDF address 00:00.0 is fictional device which PCI configuration header
is for configuring mpc85xx PCI controller itself. PCI config space of this
device has ATMU inbound registers on position of PCI BARs. Trying to do PCI
auto configuration of this device cause rewriting ATMU inbound registers.
To avoid it, do not allow overwriting registers at BARs positions. And
because this device does not have any PCI memory, return zeros when trying
to read PCI BARs config space registers. It signals to auto configuration
tool to not allocate any PCI memory for this device.

This information is taken from MPC8544E Reference Manual, sections
17.3.1.3, 17.3.1.1.1, 17.3.2 and 17.3.2.11. Available at NXP website:
https://www.nxp.com/docs/en/reference-manual/MPC8544ERM.pdf

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
drivers/pci/pci_mpc85xx.c