]> git.itanic.dy.fi Git - linux-stable/commitdiff
PCI: aardvark: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge
authorPali Rohár <pali@kernel.org>
Mon, 11 Jul 2022 22:59:15 +0000 (00:59 +0200)
committerLorenzo Pieralisi <lpieralisi@kernel.org>
Fri, 16 Sep 2022 12:39:44 +0000 (14:39 +0200)
Register with Subsystem Device/Vendor ID is at offset 0x2c.

Export it via the emulated bridge to enable support for the Subsystem
Device/Vendor ID - by reading it in the PCI controller config space and
storing it in the emulated bridge control structures, so that it is
exposed in the respective PCI capability.

After this change Subsystem ID is visible in lspci output at line:

  Capabilities: [40] Subsystem

Link: https://lore.kernel.org/r/20220711225915.13896-1-pali@kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
drivers/pci/controller/pci-aardvark.c

index 966c8b48bd96937de4000f59bc512e1aa0905ea2..7cc51cfb8a13a070ffe63977ded76315b212465a 100644 (file)
@@ -33,6 +33,7 @@
 #define PCIE_CORE_DEV_ID_REG                                   0x0
 #define PCIE_CORE_CMD_STATUS_REG                               0x4
 #define PCIE_CORE_DEV_REV_REG                                  0x8
+#define PCIE_CORE_SSDEV_ID_REG                                 0x2c
 #define PCIE_CORE_PCIEXP_CAP                                   0xc0
 #define PCIE_CORE_PCIERR_CAP                                   0x100
 #define PCIE_CORE_ERR_CAPCTL_REG                               0x118
@@ -1077,6 +1078,8 @@ static int advk_sw_pci_bridge_init(struct advk_pcie *pcie)
        /* Indicates supports for Completion Retry Status */
        bridge->pcie_conf.rootcap = cpu_to_le16(PCI_EXP_RTCAP_CRSVIS);
 
+       bridge->subsystem_vendor_id = advk_readl(pcie, PCIE_CORE_SSDEV_ID_REG) & 0xffff;
+       bridge->subsystem_id = advk_readl(pcie, PCIE_CORE_SSDEV_ID_REG) >> 16;
        bridge->has_pcie = true;
        bridge->data = pcie;
        bridge->ops = &advk_pci_bridge_emul_ops;