[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211224012334.89173-5-kelvin.cao@microchip.com>
Date: Thu, 23 Dec 2021 17:23:32 -0800
From: Kelvin Cao <kelvin.cao@...rochip.com>
To: Kurt Schwemmer <kurt.schwemmer@...rosemi.com>,
Logan Gunthorpe <logang@...tatee.com>,
Jon Mason <jdmason@...zu.us>,
Dave Jiang <dave.jiang@...el.com>,
Allen Hubbe <allenbh@...il.com>, <linux-pci@...r.kernel.org>,
<linux-ntb@...glegroups.com>, <linux-kernel@...r.kernel.org>
CC: Kelvin Cao <kelvin.cao@...rochip.com>, <kelvincao@...look.com>,
"Jeremy Pallotta" <jmpallotta@...il.com>
Subject: [PATCH 4/6] 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 <kelvin.cao@...rochip.com>
---
drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
index 25302a384a7d..03839346233d 100644
--- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
+++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
@@ -419,8 +419,10 @@ static void switchtec_ntb_part_link_speed(struct switchtec_ntb *sndev,
enum ntb_width *width)
{
struct switchtec_dev *stdev = sndev->stdev;
- u32 pff =
- ioread32(&stdev->mmio_part_cfg_all[partition].vep_pff_inst_id);
+ struct part_cfg_regs __iomem *part_cfg =
+ &stdev->mmio_part_cfg_all[partition];
+
+ u32 pff = ioread32(&part_cfg->vep_pff_inst_id) & 0xFF;
u32 linksta = ioread32(&stdev->mmio_pff_csr[pff].pci_cap_region[13]);
if (speed)
@@ -1089,7 +1091,7 @@ static int crosslink_enum_partition(struct switchtec_ntb *sndev,
{
struct part_cfg_regs __iomem *part_cfg =
&sndev->stdev->mmio_part_cfg_all[sndev->peer_partition];
- u32 pff = ioread32(&part_cfg->vep_pff_inst_id);
+ u32 pff = ioread32(&part_cfg->vep_pff_inst_id) & 0xFF;
struct pff_csr_regs __iomem *mmio_pff =
&sndev->stdev->mmio_pff_csr[pff];
const u64 bar_space = 0x1000000000LL;
--
2.25.1
Powered by blists - more mailing lists