ntb.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Kelvin Cao <kelvin.cao@microchip.com>
To: Kurt Schwemmer <kurt.schwemmer@microsemi.com>,
	Logan Gunthorpe <logang@deltatee.com>,
	Jon Mason <jdmason@kudzu.us>, Dave Jiang <dave.jiang@intel.com>,
	Allen Hubbe <allenbh@gmail.com>,
	linux-pci@vger.kernel.org, linux-ntb@googlegroups.com,
	linux-kernel@vger.kernel.org
Cc: Kelvin Cao <kelvin.cao@microchip.com>,
	kelvincao@outlook.com, Jeremy Pallotta <jmpallotta@gmail.com>
Subject: [PATCH 4/6] ntb_hw_switchtec: Update the way of getting VEP instance ID
Date: Thu, 23 Dec 2021 17:23:32 -0800	[thread overview]
Message-ID: <20211224012334.89173-5-kelvin.cao@microchip.com> (raw)
In-Reply-To: <20211224012334.89173-1-kelvin.cao@microchip.com>

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@microchip.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


  parent reply	other threads:[~2021-12-24  1:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24  1:23 [PATCH 0/6] Switchtec NTB Fixes and Improvements Kelvin Cao
2021-12-24  1:23 ` [PATCH 1/6] ntb_hw_switchtec: Fix pff ioread to read into mmio_part_cfg_all Kelvin Cao
2021-12-24  1:23 ` [PATCH 2/6] ntb_hw_switchtec: Fix bug with more than 32 partitions Kelvin Cao
2021-12-24  1:23 ` [PATCH 3/6] ntb_hw_switchtec: AND with the part_map for a valid tpart_vec Kelvin Cao
2021-12-24  1:23 ` Kelvin Cao [this message]
2021-12-24  1:23 ` [PATCH 5/6] ntb_hw_switchtec: Remove code for disabling ID protection Kelvin Cao
2021-12-24  1:23 ` [PATCH 6/6] ntb_hw_switchtec: Fix a minor issue in config_req_id_table() Kelvin Cao
2022-01-04 16:55 ` [PATCH 0/6] Switchtec NTB Fixes and Improvements Logan Gunthorpe
2022-01-04 21:28   ` Kelvin.Cao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211224012334.89173-5-kelvin.cao@microchip.com \
    --to=kelvin.cao@microchip.com \
    --cc=allenbh@gmail.com \
    --cc=dave.jiang@intel.com \
    --cc=jdmason@kudzu.us \
    --cc=jmpallotta@gmail.com \
    --cc=kelvincao@outlook.com \
    --cc=kurt.schwemmer@microsemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntb@googlegroups.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=logang@deltatee.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).