Skip to content

Commit 4ab3454

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: mvebu: Fix support for DEVCAP2, DEVCTL2 and LNKCTL2 registers on emulated bridge
Armada XP and new hardware supports access to DEVCAP2, DEVCTL2 and LNKCTL2 configuration registers of PCIe core via PCIE_CAP_PCIEXP. So export them via emulated software root bridge. Pre-XP hardware does not support these registers and returns zeros. Link: https://lore.kernel.org/r/[email protected] Fixes: 1f08673 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]>
1 parent 838ff44 commit 4ab3454

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/pci/controller/pci-mvebu.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,18 @@ mvebu_pci_bridge_emul_pcie_conf_read(struct pci_bridge_emul *bridge,
560560
*value = mvebu_readl(port, PCIE_RC_RTSTA);
561561
break;
562562

563+
case PCI_EXP_DEVCAP2:
564+
*value = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_DEVCAP2);
565+
break;
566+
567+
case PCI_EXP_DEVCTL2:
568+
*value = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_DEVCTL2);
569+
break;
570+
571+
case PCI_EXP_LNKCTL2:
572+
*value = mvebu_readl(port, PCIE_CAP_PCIEXP + PCI_EXP_LNKCTL2);
573+
break;
574+
563575
default:
564576
return PCI_BRIDGE_EMUL_NOT_HANDLED;
565577
}
@@ -672,6 +684,17 @@ mvebu_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge,
672684
if (new & PCI_EXP_RTSTA_PME)
673685
mvebu_writel(port, ~PCIE_INT_PM_PME, PCIE_INT_CAUSE_OFF);
674686
break;
687+
688+
case PCI_EXP_DEVCTL2:
689+
mvebu_writel(port, new, PCIE_CAP_PCIEXP + PCI_EXP_DEVCTL2);
690+
break;
691+
692+
case PCI_EXP_LNKCTL2:
693+
mvebu_writel(port, new, PCIE_CAP_PCIEXP + PCI_EXP_LNKCTL2);
694+
break;
695+
696+
default:
697+
break;
675698
}
676699
}
677700

0 commit comments

Comments
 (0)