mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 12:25:18 +02:00
PCI: loongson: Enable MSI in LS7A Root Complex
commit a4bbcac11d
upstream.
The LS7A chipset can be used as part of a PCIe Root Complex with
Loongson-3C6000 and similar CPUs. In this case, DEV_LS7A_PCIE_PORT5 has a
PCI_CLASS_BRIDGE_HOST class code, and it is a Type 0 Function whose config
space provides access to Root Complex registers.
The DEV_LS7A_PCIE_PORT5 has an MSI Capability, and its MSI Enable bit must
be set before other devices below the Root Complex can use MSI. This is
not the standard PCI behavior of MSI Enable, so the normal PCI MSI code
does not set it.
Set the DEV_LS7A_PCIE_PORT5 MSI Enable bit via a quirk so other devices
below the Root Complex can use MSI.
[kwilczynski: exit early to reduce indentation; commit log]
Link: https://lore.kernel.org/linux-pci/20240612065315.2048110-1-chenhuacai@loongson.cn
Signed-off-by: Sheng Wu <wusheng@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a5b1cce14a
commit
e22b88f234
|
@ -163,6 +163,19 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_LOONGSON,
|
||||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_LOONGSON,
|
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_LOONGSON,
|
||||||
DEV_LS7A_HDMI, loongson_pci_pin_quirk);
|
DEV_LS7A_HDMI, loongson_pci_pin_quirk);
|
||||||
|
|
||||||
|
static void loongson_pci_msi_quirk(struct pci_dev *dev)
|
||||||
|
{
|
||||||
|
u16 val, class = dev->class >> 8;
|
||||||
|
|
||||||
|
if (class != PCI_CLASS_BRIDGE_HOST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &val);
|
||||||
|
val |= PCI_MSI_FLAGS_ENABLE;
|
||||||
|
pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, val);
|
||||||
|
}
|
||||||
|
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_LOONGSON, DEV_LS7A_PCIE_PORT5, loongson_pci_msi_quirk);
|
||||||
|
|
||||||
static struct loongson_pci *pci_bus_to_loongson_pci(struct pci_bus *bus)
|
static struct loongson_pci *pci_bus_to_loongson_pci(struct pci_bus *bus)
|
||||||
{
|
{
|
||||||
struct pci_config_window *cfg;
|
struct pci_config_window *cfg;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user