Skip to content

Commit a3282f8

Browse files
Rakesh-Saladibjorn-helgaas
authored andcommitted
PCI: switchtec: Add Microchip PCI100X device IDs
Add Microchip parts to the Device ID table so the driver supports PCI100x devices. Add a new macro to quirk the Microchip Switchtec PCI100x parts to allow DMA access via NTB to work when the IOMMU is turned on. PCI100x family has 6 variants; each variant is designed for different application usages, different port counts and lane counts: PCI1001 has 1 x4 upstream port and 3 x4 downstream ports PCI1002 has 1 x4 upstream port and 4 x2 downstream ports PCI1003 has 2 x4 upstream ports, 2 x2 upstream ports, and 2 x2 downstream ports PCI1004 has 4 x4 upstream ports PCI1005 has 1 x4 upstream port and 6 x2 downstream ports PCI1006 has 6 x2 upstream ports and 2 x2 downstream ports [Historical note: these parts use PCI_VENDOR_ID_EFAR (0x1055), from EFAR Microsystems, which was acquired in 1996 by Standard Microsystems Corp, which was acquired by Microchip Technology in 2012. The PCI-SIG confirms that Vendor ID 0x1055 is assigned to Microchip even though it's not visible via https://pcisig.com/membership/member-companies] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rakesh Babu Saladi <[email protected]> [bhelgaas: Vendor ID history] Signed-off-by: Bjorn Helgaas <[email protected]> Acked-By: Logan Gunthorpe <[email protected]>
1 parent 40384c8 commit a3282f8

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

drivers/pci/quirks.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5984,6 +5984,17 @@ SWITCHTEC_QUIRK(0x5552); /* PAXA 52XG5 */
59845984
SWITCHTEC_QUIRK(0x5536); /* PAXA 36XG5 */
59855985
SWITCHTEC_QUIRK(0x5528); /* PAXA 28XG5 */
59865986

5987+
#define SWITCHTEC_PCI100X_QUIRK(vid) \
5988+
DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_EFAR, vid, \
5989+
PCI_CLASS_BRIDGE_OTHER, 8, quirk_switchtec_ntb_dma_alias)
5990+
SWITCHTEC_PCI100X_QUIRK(0x1001); /* PCI1001XG4 */
5991+
SWITCHTEC_PCI100X_QUIRK(0x1002); /* PCI1002XG4 */
5992+
SWITCHTEC_PCI100X_QUIRK(0x1003); /* PCI1003XG4 */
5993+
SWITCHTEC_PCI100X_QUIRK(0x1004); /* PCI1004XG4 */
5994+
SWITCHTEC_PCI100X_QUIRK(0x1005); /* PCI1005XG4 */
5995+
SWITCHTEC_PCI100X_QUIRK(0x1006); /* PCI1006XG4 */
5996+
5997+
59875998
/*
59885999
* The PLX NTB uses devfn proxy IDs to move TLPs between NT endpoints.
59896000
* These IDs are used to forward responses to the originator on the other

drivers/pci/switch/switchtec.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,26 @@ static void switchtec_pci_remove(struct pci_dev *pdev)
17391739
.driver_data = gen, \
17401740
}
17411741

1742+
#define SWITCHTEC_PCI100X_DEVICE(device_id, gen) \
1743+
{ \
1744+
.vendor = PCI_VENDOR_ID_EFAR, \
1745+
.device = device_id, \
1746+
.subvendor = PCI_ANY_ID, \
1747+
.subdevice = PCI_ANY_ID, \
1748+
.class = (PCI_CLASS_MEMORY_OTHER << 8), \
1749+
.class_mask = 0xFFFFFFFF, \
1750+
.driver_data = gen, \
1751+
}, \
1752+
{ \
1753+
.vendor = PCI_VENDOR_ID_EFAR, \
1754+
.device = device_id, \
1755+
.subvendor = PCI_ANY_ID, \
1756+
.subdevice = PCI_ANY_ID, \
1757+
.class = (PCI_CLASS_BRIDGE_OTHER << 8), \
1758+
.class_mask = 0xFFFFFFFF, \
1759+
.driver_data = gen, \
1760+
}
1761+
17421762
static const struct pci_device_id switchtec_pci_tbl[] = {
17431763
SWITCHTEC_PCI_DEVICE(0x8531, SWITCHTEC_GEN3), /* PFX 24xG3 */
17441764
SWITCHTEC_PCI_DEVICE(0x8532, SWITCHTEC_GEN3), /* PFX 32xG3 */
@@ -1833,6 +1853,12 @@ static const struct pci_device_id switchtec_pci_tbl[] = {
18331853
SWITCHTEC_PCI_DEVICE(0x5552, SWITCHTEC_GEN5), /* PAXA 52XG5 */
18341854
SWITCHTEC_PCI_DEVICE(0x5536, SWITCHTEC_GEN5), /* PAXA 36XG5 */
18351855
SWITCHTEC_PCI_DEVICE(0x5528, SWITCHTEC_GEN5), /* PAXA 28XG5 */
1856+
SWITCHTEC_PCI100X_DEVICE(0x1001, SWITCHTEC_GEN4), /* PCI1001 16XG4 */
1857+
SWITCHTEC_PCI100X_DEVICE(0x1002, SWITCHTEC_GEN4), /* PCI1002 12XG4 */
1858+
SWITCHTEC_PCI100X_DEVICE(0x1003, SWITCHTEC_GEN4), /* PCI1003 16XG4 */
1859+
SWITCHTEC_PCI100X_DEVICE(0x1004, SWITCHTEC_GEN4), /* PCI1004 16XG4 */
1860+
SWITCHTEC_PCI100X_DEVICE(0x1005, SWITCHTEC_GEN4), /* PCI1005 16XG4 */
1861+
SWITCHTEC_PCI100X_DEVICE(0x1006, SWITCHTEC_GEN4), /* PCI1006 16XG4 */
18361862
{0}
18371863
};
18381864
MODULE_DEVICE_TABLE(pci, switchtec_pci_tbl);

0 commit comments

Comments
 (0)