Skip to content

Commit 2f58265

Browse files
kelvin-caojonmason
authored andcommitted
ntb_hw_switchtec: Update the way of getting VEP instance ID
Gen4 firmware adds DMA VEP and NVMe VEP support in VEP (virtual EP) instance ID register in addtion to management EP. Update the way of getting management VEP instance ID. Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent 857e239 commit 2f58265

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/ntb/hw/mscc/ntb_hw_switchtec.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,10 @@ static void switchtec_ntb_part_link_speed(struct switchtec_ntb *sndev,
419419
enum ntb_width *width)
420420
{
421421
struct switchtec_dev *stdev = sndev->stdev;
422-
u32 pff =
423-
ioread32(&stdev->mmio_part_cfg_all[partition].vep_pff_inst_id);
422+
struct part_cfg_regs __iomem *part_cfg =
423+
&stdev->mmio_part_cfg_all[partition];
424+
425+
u32 pff = ioread32(&part_cfg->vep_pff_inst_id) & 0xFF;
424426
u32 linksta = ioread32(&stdev->mmio_pff_csr[pff].pci_cap_region[13]);
425427

426428
if (speed)
@@ -1089,7 +1091,7 @@ static int crosslink_enum_partition(struct switchtec_ntb *sndev,
10891091
{
10901092
struct part_cfg_regs __iomem *part_cfg =
10911093
&sndev->stdev->mmio_part_cfg_all[sndev->peer_partition];
1092-
u32 pff = ioread32(&part_cfg->vep_pff_inst_id);
1094+
u32 pff = ioread32(&part_cfg->vep_pff_inst_id) & 0xFF;
10931095
struct pff_csr_regs __iomem *mmio_pff =
10941096
&sndev->stdev->mmio_pff_csr[pff];
10951097
const u64 bar_space = 0x1000000000LL;

0 commit comments

Comments
 (0)