Skip to content

Commit a914fc5

Browse files
davejiangjonmason
authored andcommitted
ntb: intel: add GNR support for Intel PCIe gen5 NTB
Add Intel Granite Rapids NTB PCI device ID and related enabling. Expectation is same hardware interface as Saphire Rapids Xeon platforms. Signed-off-by: Dave Jiang <[email protected]> Acked-by: Allen Hubbe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent 45e1058 commit a914fc5

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

drivers/ntb/hw/intel/ntb_hw_gen1.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static ssize_t ndev_debugfs_read(struct file *filp, char __user *ubuf,
763763
return ndev_ntb_debugfs_read(filp, ubuf, count, offp);
764764
else if (pdev_is_gen3(ndev->ntb.pdev))
765765
return ndev_ntb3_debugfs_read(filp, ubuf, count, offp);
766-
else if (pdev_is_gen4(ndev->ntb.pdev))
766+
else if (pdev_is_gen4(ndev->ntb.pdev) || pdev_is_gen5(ndev->ntb.pdev))
767767
return ndev_ntb4_debugfs_read(filp, ubuf, count, offp);
768768

769769
return -ENXIO;
@@ -1874,7 +1874,7 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev,
18741874
rc = gen3_init_dev(ndev);
18751875
if (rc)
18761876
goto err_init_dev;
1877-
} else if (pdev_is_gen4(pdev)) {
1877+
} else if (pdev_is_gen4(pdev) || pdev_is_gen5(pdev)) {
18781878
ndev->ntb.ops = &intel_ntb4_ops;
18791879
rc = intel_ntb_init_pci(ndev, pdev);
18801880
if (rc)
@@ -1904,7 +1904,8 @@ static int intel_ntb_pci_probe(struct pci_dev *pdev,
19041904

19051905
err_register:
19061906
ndev_deinit_debugfs(ndev);
1907-
if (pdev_is_gen1(pdev) || pdev_is_gen3(pdev) || pdev_is_gen4(pdev))
1907+
if (pdev_is_gen1(pdev) || pdev_is_gen3(pdev) ||
1908+
pdev_is_gen4(pdev) || pdev_is_gen5(pdev))
19081909
xeon_deinit_dev(ndev);
19091910
err_init_dev:
19101911
intel_ntb_deinit_pci(ndev);
@@ -1920,7 +1921,8 @@ static void intel_ntb_pci_remove(struct pci_dev *pdev)
19201921

19211922
ntb_unregister_device(&ndev->ntb);
19221923
ndev_deinit_debugfs(ndev);
1923-
if (pdev_is_gen1(pdev) || pdev_is_gen3(pdev) || pdev_is_gen4(pdev))
1924+
if (pdev_is_gen1(pdev) || pdev_is_gen3(pdev) ||
1925+
pdev_is_gen4(pdev) || pdev_is_gen5(pdev))
19241926
xeon_deinit_dev(ndev);
19251927
intel_ntb_deinit_pci(ndev);
19261928
kfree(ndev);
@@ -2047,6 +2049,8 @@ static const struct pci_device_id intel_ntb_pci_tbl[] = {
20472049

20482050
/* GEN4 */
20492051
{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_ICX)},
2052+
/* GEN5 PCIe */
2053+
{PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_NTB_B2B_GNR)},
20502054
{0}
20512055
};
20522056
MODULE_DEVICE_TABLE(pci, intel_ntb_pci_tbl);

drivers/ntb/hw/intel/ntb_hw_gen4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ int gen4_init_dev(struct intel_ntb_dev *ndev)
197197
ppd1 = ioread32(ndev->self_mmio + GEN4_PPD1_OFFSET);
198198
if (pdev_is_ICX(pdev))
199199
ndev->ntb.topo = gen4_ppd_topo(ndev, ppd1);
200-
else if (pdev_is_SPR(pdev))
200+
else if (pdev_is_SPR(pdev) || pdev_is_gen5(pdev))
201201
ndev->ntb.topo = spr_ppd_topo(ndev, ppd1);
202202
dev_dbg(&pdev->dev, "ppd %#x topo %s\n", ppd1,
203203
ntb_topo_string(ndev->ntb.topo));

drivers/ntb/hw/intel/ntb_hw_intel.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#define PCI_DEVICE_ID_INTEL_NTB_SS_BDX 0x6F0F
7171
#define PCI_DEVICE_ID_INTEL_NTB_B2B_SKX 0x201C
7272
#define PCI_DEVICE_ID_INTEL_NTB_B2B_ICX 0x347e
73+
#define PCI_DEVICE_ID_INTEL_NTB_B2B_GNR 0x0db4
7374

7475
/* Ntb control and link status */
7576
#define NTB_CTL_CFG_LOCK BIT(0)
@@ -228,4 +229,10 @@ static inline int pdev_is_gen4(struct pci_dev *pdev)
228229

229230
return 0;
230231
}
232+
233+
static inline int pdev_is_gen5(struct pci_dev *pdev)
234+
{
235+
return pdev->device == PCI_DEVICE_ID_INTEL_NTB_B2B_GNR;
236+
}
237+
231238
#endif

0 commit comments

Comments
 (0)