[PATCH v2 0/3] PCI: endpoint: pci-epf-vntb: allow arbitrary BAR mapping

Jerome Brunet posted 3 patches 6 months, 2 weeks ago
drivers/pci/endpoint/functions/pci-epf-vntb.c | 141 +++++++++++++++++++++++---
1 file changed, 129 insertions(+), 12 deletions(-)
[PATCH v2 0/3] PCI: endpoint: pci-epf-vntb: allow arbitrary BAR mapping
Posted by Jerome Brunet 6 months, 2 weeks ago
The patchset allows arbitrary BAR mapping for vNTB PCI endpoint function.

This was developed for the Renesas platform with requires a mapping that
was not possible before:
* BAR0 (1MB):  CTRL+SPAD
* BAR2 (1MB):  MW0
* BAR4 (256B): Doorbell

It is possible to setup the host side driver with the mapping above without any
functional change but it makes sense to also add arbitrary mapping support
there. This is will be sent in a dedicated series.

The patchset should not change anything for existing users.

Possible next steps:
- Align the NTB endpoint function: I'd be happy to propose something there
  but I would only be able to compile test it since I do not have the HW
  to test it.
- Expose BAR configuration in the CTRL registers: I've been doodling with
  the idea to add a few extra registers in the CTRL region to describe
  the BAR mapping of the other regions. That way, there would less chance
  for the 2 sides to become mis-aligned. I'm not certain it makes sense and
  would welcome others opinion on this :)

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
Changes in v2:
- Align commit description casing style
- Delay adding MW4 enumeration to patch 3
- Apply renaming suggestion on patch 3
- Dropped patch 4 for the NTB: will be re-sent separately.
- Link to v1: https://lore.kernel.org/r/20250505-pci-vntb-bar-mapping-v1-0-0e0d12b2fa71@baylibre.com

---
Jerome Brunet (3):
      PCI: endpoint: pci-epf-vntb: Return an error code on bar init
      PCI: endpoint: pci-epf-vntb: Align mw naming with config names
      PCI: endpoint: pci-epf-vntb: Allow BAR assignment via configfs

 drivers/pci/endpoint/functions/pci-epf-vntb.c | 141 +++++++++++++++++++++++---
 1 file changed, 129 insertions(+), 12 deletions(-)
---
base-commit: db2e86db6ec76de51aff24fb0ae43987d4c02355
change-id: 20250505-pci-vntb-bar-mapping-3cc3ff624e76

Best regards,
-- 
Jerome
Re: [PATCH v2 0/3] PCI: endpoint: pci-epf-vntb: allow arbitrary BAR mapping
Posted by Manivannan Sadhasivam 5 months, 4 weeks ago
On Tue, 03 Jun 2025 19:03:37 +0200, Jerome Brunet wrote:
> The patchset allows arbitrary BAR mapping for vNTB PCI endpoint function.
> 
> This was developed for the Renesas platform with requires a mapping that
> was not possible before:
> * BAR0 (1MB):  CTRL+SPAD
> * BAR2 (1MB):  MW0
> * BAR4 (256B): Doorbell
> 
> [...]

Applied, thanks!

[1/3] PCI: endpoint: pci-epf-vntb: Return an error code on bar init
      commit: 7ea488cce73263231662e426639dd3e836537068
[2/3] PCI: endpoint: pci-epf-vntb: Align mw naming with config names
      commit: a079d83c4afd4896f7f29bd9e807cb382043b360
[3/3] PCI: endpoint: pci-epf-vntb: Allow BAR assignment via configfs
      commit: a0cc6e6fd072616315147ac68a12672d5a2fa223

Best regards,
-- 
Manivannan Sadhasivam <mani@kernel.org>