Skip to content

Commit e3e13c9

Browse files
paliLorenzo Pieralisi
authored andcommitted
PCI: mvebu: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge
Register with Subsystem Device/Vendor ID is at offset 0x2c. Export is via emulated bridge. After this change Subsystem ID is visible in lspci output at line: Capabilities: [40] Subsystem Link: https://lore.kernel.org/r/20220222155030.988-7-pali@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
1 parent 2a81dd9 commit e3e13c9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/pci/controller/pci-mvebu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#define PCIE_DEV_REV_OFF 0x0008
3333
#define PCIE_BAR_LO_OFF(n) (0x0010 + ((n) << 3))
3434
#define PCIE_BAR_HI_OFF(n) (0x0014 + ((n) << 3))
35+
#define PCIE_SSDEV_ID_OFF 0x002c
3536
#define PCIE_CAP_PCIEXP 0x0060
3637
#define PCIE_HEADER_LOG_4_OFF 0x0128
3738
#define PCIE_BAR_CTRL_OFF(n) (0x1804 + (((n) - 1) * 4))
@@ -731,6 +732,7 @@ static int mvebu_pci_bridge_emul_init(struct mvebu_pcie_port *port)
731732
struct pci_bridge_emul *bridge = &port->bridge;
732733
u32 dev_id = mvebu_readl(port, PCIE_DEV_ID_OFF);
733734
u32 dev_rev = mvebu_readl(port, PCIE_DEV_REV_OFF);
735+
u32 ssdev_id = mvebu_readl(port, PCIE_SSDEV_ID_OFF);
734736
u32 pcie_cap = mvebu_readl(port, PCIE_CAP_PCIEXP);
735737
u8 pcie_cap_ver = ((pcie_cap >> 16) & PCI_EXP_FLAGS_VERS);
736738

@@ -752,6 +754,8 @@ static int mvebu_pci_bridge_emul_init(struct mvebu_pcie_port *port)
752754
*/
753755
bridge->pcie_conf.cap = cpu_to_le16(pcie_cap_ver);
754756

757+
bridge->subsystem_vendor_id = ssdev_id & 0xffff;
758+
bridge->subsystem_id = ssdev_id >> 16;
755759
bridge->has_pcie = true;
756760
bridge->data = port;
757761
bridge->ops = &mvebu_pci_bridge_emul_ops;

0 commit comments

Comments
 (0)