linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/9] Add support for MHI Endpoint function driver
@ 2023-06-02 11:47 Manivannan Sadhasivam
  2023-06-02 11:47 ` [PATCH v6 1/9] PCI: endpoint: Add missing documentation about the MSI/MSI-X range Manivannan Sadhasivam
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Manivannan Sadhasivam @ 2023-06-02 11:47 UTC (permalink / raw)
  To: lpieralisi, kw
  Cc: kishon, bhelgaas, linux-pci, linux-kernel, linux-arm-msm,
	dlemoal, Manivannan Sadhasivam

Hello,

This series adds support for Modem Host Interface (MHI) Endpoint function
driver and few updates to the PCI endpoint core.

MHI
===

MHI is the communication protocol used by the host machines to control and
communicate with the Qualcomm modems/WLAN devices over any high speed physical
bus like PCIe. In Linux kernel, MHI is modeled as a bus driver [1] and there
are two instances of MHI used in a typical setup.

1. MHI host - MHI implementation for the host machines like x86/ARM64.
2. MHI Endpoint - MHI implementation for the endpoint devices like modems.

MHI EPF
=======

The MHI Endpoint function driver (MHI EPF) is used on the MHI endpoint devices
like modems. The MHI EPF driver sits in between the PCIe EP and MHI EP bus and
carries out all of the PCIe related activities like BAR config, PCIe Event
handling, MMIO read/write etc,... for the MHI EP bus.

Below is the simple representation of the setup:


                 +----------------------------------------------------+
                 |                  Endpoint CPU                      |                   
                 |                                                    |
+------------+   |   +------------+   +-----------+   +-----------+   |
|            |   |   |            |   |           |   |           |   |
|            |   |   |   MHI EP   |   |           |   |           |   | PCIe Bus
|  Modem DSP +---+---+    Bus     +---+  MHI EPF  +---+  PCIe EP  +---+---------
|            |   |   |            |   |           |   |           |   |
|            |   |   |            |   |           |   |           |   |
+------------+   |   +------------+   +-----------+   +-----------+   |
                 |                                                    |
                 |                                                    |
                 +----------------------------------------------------+

The data packets will be read from the Modem DSP by the MHI stack and will be
transmitted to the host machine over PCIe bus with the help of MHI EPF driver.

Test setup
==========

This series has been tested on Snapdragon X55 modem a.k.a SDX55 connected to
the ARM64 host machine.

Thanks,
Mani

[1] https://www.kernel.org/doc/html/latest/mhi/mhi.html

Changes in v6:

* Moved the alloc/map and unmap/free code to separate helper functions and used
  them to avoid code duplication in epf driver.
* Removed superfluous WARN_ON_ONCE() from epf driver.

Changes in v5:

* Moved the PCI EPF driver match logic to pci_epf_match_id() function and used
  that to get the matched driver ID for passing to driver probe instead of
  storing the id during match.
* Added a patch to fix the missing documentation about MSI/MSI-X start vector.
* Addressed the review comments on the MHI EPF driver. Most notably, got rid of
  local variable for tracking MHI registration and used the mhi_dev pointer.
  Also, modified the MSI vector increment comment to make it clear.
* Added a patch for adding MHI EPF driver to MAINTAINERS file

Changes in v4:

* Collected review tag from Kishon
* Changed the IP_SW0 channel numbers as per latest MHI spec

Changes in v3:

* Fixed the probe function of EPF_VNTB driver

Changes in v2:

* Rebased on top of v6.3-rc1
* Switched to the new callback interface for passing events from EPC to EPF
* Dropped one patch related to notifier

Manivannan Sadhasivam (9):
  PCI: endpoint: Add missing documentation about the MSI/MSI-X range
  PCI: endpoint: Pass EPF device ID to the probe function
  PCI: endpoint: Return error if EPC is started/stopped multiple times
  PCI: endpoint: Add linkdown notifier support
  PCI: endpoint: Add BME notifier support
  PCI: qcom-ep: Add support for Link down notification
  PCI: qcom-ep: Add support for BME notification
  PCI: endpoint: Add PCI Endpoint function driver for MHI bus
  MAINTAINERS: Add PCI MHI endpoint function driver under MHI bus

 MAINTAINERS                                   |   1 +
 drivers/pci/controller/dwc/pcie-qcom-ep.c     |   2 +
 drivers/pci/endpoint/functions/Kconfig        |  10 +
 drivers/pci/endpoint/functions/Makefile       |   1 +
 drivers/pci/endpoint/functions/pci-epf-mhi.c  | 465 ++++++++++++++++++
 drivers/pci/endpoint/functions/pci-epf-ntb.c  |   3 +-
 drivers/pci/endpoint/functions/pci-epf-test.c |   2 +-
 drivers/pci/endpoint/functions/pci-epf-vntb.c |   2 +-
 drivers/pci/endpoint/pci-ep-cfs.c             |   3 +
 drivers/pci/endpoint/pci-epc-core.c           |  56 ++-
 drivers/pci/endpoint/pci-epf-core.c           |  18 +-
 include/linux/pci-epc.h                       |   2 +
 include/linux/pci-epf.h                       |   8 +-
 13 files changed, 560 insertions(+), 13 deletions(-)
 create mode 100644 drivers/pci/endpoint/functions/pci-epf-mhi.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2023-06-23 20:15 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 11:47 [PATCH v6 0/9] Add support for MHI Endpoint function driver Manivannan Sadhasivam
2023-06-02 11:47 ` [PATCH v6 1/9] PCI: endpoint: Add missing documentation about the MSI/MSI-X range Manivannan Sadhasivam
2023-06-02 11:47 ` [PATCH v6 2/9] PCI: endpoint: Pass EPF device ID to the probe function Manivannan Sadhasivam
2023-06-02 12:13   ` Damien Le Moal
2023-06-05 13:08     ` Lorenzo Pieralisi
2023-06-05 13:55       ` Manivannan Sadhasivam
2023-06-05  9:27   ` Lorenzo Pieralisi
2023-06-05 11:57     ` Manivannan Sadhasivam
2023-06-05 13:06       ` Lorenzo Pieralisi
2023-06-23 20:14   ` Bjorn Helgaas
2023-06-02 11:47 ` [PATCH v6 3/9] PCI: endpoint: Return error if EPC is started/stopped multiple times Manivannan Sadhasivam
2023-06-02 12:14   ` Damien Le Moal
2023-06-02 11:47 ` [PATCH v6 4/9] PCI: endpoint: Add linkdown notifier support Manivannan Sadhasivam
2023-06-02 11:47 ` [PATCH v6 5/9] PCI: endpoint: Add BME " Manivannan Sadhasivam
2023-06-02 11:47 ` [PATCH v6 6/9] PCI: qcom-ep: Add support for Link down notification Manivannan Sadhasivam
2023-06-02 11:47 ` [PATCH v6 7/9] PCI: qcom-ep: Add support for BME notification Manivannan Sadhasivam
2023-06-02 11:47 ` [PATCH v6 8/9] PCI: endpoint: Add PCI Endpoint function driver for MHI bus Manivannan Sadhasivam
2023-06-07 20:49   ` Bjorn Helgaas
2023-06-07 21:19     ` Bjorn Helgaas
2023-06-08 16:35       ` Manivannan Sadhasivam
2023-06-09  7:53       ` Lorenzo Pieralisi
2023-06-02 11:47 ` [PATCH v6 9/9] MAINTAINERS: Add PCI MHI endpoint function driver under " Manivannan Sadhasivam
2023-06-02 12:15   ` Damien Le Moal
2023-06-05 14:45 ` [PATCH v6 0/9] Add support for MHI Endpoint function driver Lorenzo Pieralisi

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).