1 From 1d3e170344dff2cef8827db6c09909b78cbc11d7 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Tue, 30 Nov 2021 18:29:05 +0100
4 Subject: [PATCH] PCI: aardvark: Add support for DEVCAP2, DEVCTL2, LNKCAP2 and
5 LNKCTL2 registers on emulated bridge
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 PCI aardvark hardware supports access to DEVCAP2, DEVCTL2, LNKCAP2 and
11 LNKCTL2 configuration registers of PCIe core via PCIE_CORE_PCIEXP_CAP.
12 Export them via emulated software root bridge.
14 Link: https://lore.kernel.org/r/20211130172913.9727-4-kabel@kernel.org
15 Signed-off-by: Pali Rohár <pali@kernel.org>
16 Signed-off-by: Marek Behún <kabel@kernel.org>
17 Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
19 drivers/pci/controller/pci-aardvark.c | 15 +++++++++++----
20 1 file changed, 11 insertions(+), 4 deletions(-)
22 diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
23 index c5300d49807a..25af189a1052 100644
24 --- a/drivers/pci/controller/pci-aardvark.c
25 +++ b/drivers/pci/controller/pci-aardvark.c
26 @@ -884,8 +884,13 @@ advk_pci_bridge_emul_pcie_conf_read(struct pci_bridge_emul *bridge,
30 + case PCI_EXP_DEVCAP2:
31 + case PCI_EXP_DEVCTL2:
32 + case PCI_EXP_LNKCAP2:
33 + case PCI_EXP_LNKCTL2:
34 *value = advk_readl(pcie, PCIE_CORE_PCIEXP_CAP + reg);
35 return PCI_BRIDGE_EMUL_HANDLED;
38 return PCI_BRIDGE_EMUL_NOT_HANDLED;
40 @@ -899,10 +904,6 @@ advk_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge,
41 struct advk_pcie *pcie = bridge->data;
44 - case PCI_EXP_DEVCTL:
45 - advk_writel(pcie, new, PCIE_CORE_PCIEXP_CAP + reg);
49 advk_writel(pcie, new, PCIE_CORE_PCIEXP_CAP + reg);
50 if (new & PCI_EXP_LNKCTL_RL)
51 @@ -924,6 +925,12 @@ advk_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge,
52 advk_writel(pcie, new, PCIE_ISR0_REG);
55 + case PCI_EXP_DEVCTL:
56 + case PCI_EXP_DEVCTL2:
57 + case PCI_EXP_LNKCTL2:
58 + advk_writel(pcie, new, PCIE_CORE_PCIEXP_CAP + reg);