]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
PCI: generic: Add support for Synopsys DesignWare RC in ECAM mode
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 6 Oct 2017 16:39:18 +0000 (17:39 +0100)
committerBjorn Helgaas <helgaas@kernel.org>
Fri, 6 Oct 2017 22:46:26 +0000 (17:46 -0500)
commit58fb207fb10074be48f51e514422dea7ce5fa048
tree0179417d0b591f14a9224609fbcc029fe92f1ca5
parent9e66317d3c92ddaab330c125dfe9d06eee268aff
PCI: generic: Add support for Synopsys DesignWare RC in ECAM mode

Some implementations of the Synopsys DesignWare PCIe controller implement
a so-called ECAM shift mode, which allows a static memory window to be
configured that covers the configuration space of the entire bus range.

Usually, when the firmware performs all the low level configuration that is
required to expose this controller in a fully ECAM compatible manner, we
can simply describe it as "pci-host-ecam-generic" and be done with it.
However, in some cases (e.g., the Marvell Armada 80x0 as well as the
Socionext SynQuacer Soc), the IP was synthesized with an ATU window
granularity that does not allow the first bus to be mapped in a way that
prevents the device on the downstream port from appearing more than once,
and so we still need special handling in software to drive this static
almost-ECAM configuration.

So extend the pci-host-generic driver so it can support these controllers
as well, by adding special config space accessors that take the above quirk
into account.

Note that, unlike most drivers for this IP, this driver does not expose a
fake bridge device at B/D/F 00:00.0. There is no point in doing so, given
that this is not a true bridge, and does not require any windows to be
configured in order for the downstream device to operate correctly.
Omitting it also prevents the PCI resource allocation routines from handing
out BAR space to it unnecessarily.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[bhelgaas: factor out pci_dw_valid_device(), add pci_dw_ecam_map_bus() and
use generic read/write functions]
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>
Acked-by: Will Deacon <will.deacon@arm.com>
drivers/pci/host/pci-host-generic.c