Linux MHI Development
 help / color / mirror / Atom feed
* [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support
@ 2026-11-22  2:56 Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi() Krishna Chaitanya Chundru
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru, Anvita T

The Qualcomm Nord platform has four PCIe controllers (A/B/C/D) that can
operate either as root complex or as endpoint. The root-complex support
was added earlier; this series enables endpoint mode on top of it.

Bringing up endpoint mode touches several subsystems, so the series is
arranged as a set of generic, independently-useful changes followed by
the Nord-specific enablement:

Generic (useful to any platform, can be reviewed/applied on their own):
- PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi()
     Fix a pre-existing double-encoding of the MSI count; a prerequisite
     for the MSI-X patch below to request the correct vector count.
- PCI: qcom-ep: Add MSI-X support
     Advertise an MSI-X-capable epc_features variant and route
     PCI_IRQ_MSIX in ->raise_irq(). No change for existing SoCs.
- PCI: dwc: Preserve glue-provided eDMA HDMA channel separation
     dw_pcie_edma_init_data() hardcoded the HDMA channel register
     separation (ch_space_sz) to 256 bytes, overwriting anything a glue
     driver programmed. Only apply the default when it is unset, so a
     glue driver can describe hardware that spaces the per-channel
     register blocks further apart. Builds on the recently merged
     Channel Separation support.
- PCI: epf-mhi: Add MSI-X support
     Let the MHI endpoint function raise MSI-X when the controller
     supports it, using a dedicated MSI-X BAR from an optional "msix"
     region. Falls back to MSI otherwise.
- phy: qcom: qmp-pcie: Add PCIe endpoint mode support
     Add a .set_mode() hook and an optional per-config EP-mode table
     delta, applied as a second pass over the PLL/TXRXZ/PCS blocks when
     the PHY is put into endpoint mode before power-on.

Nord-specific enablement:
  - dt-bindings: PCI: qcom-ep: Add Nord PCIe Endpoint
  - PCI: qcom-ep: Add Nord PCIe Endpoint controller support
    (HDMA, NO_SNOOP override, MHI RAM parity-check disable, MSI-X, and
     the 4K HDMA channel separation via edma.ch_space_sz)
  - PCI: epf-mhi: Add Nord endpoint support
  - bus: mhi: host: pci_generic: Add support for Qualcomm Nord
    (lets a Linux host enumerate and drive the Nord endpoint over MHI)
  - phy: qcom: qmp-pcie: Add Nord endpoint mode init sequences
  - arm64: dts: qcom: nord: Add PCIe endpoint nodes (disabled by default)

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
Anvita T (2):
      PCI: qcom-ep: Add MSI-X support
      PCI: epf-mhi: Add MSI-X support

Krishna Chaitanya Chundru (9):
      PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi()
      PCI: dwc: Preserve glue-provided eDMA HDMA channel separation
      phy: qcom: qmp-pcie: Add PCIe endpoint mode support
      phy: qcom: qmp-pcie: Add Nord endpoint mode init sequences
      dt-bindings: PCI: qcom-ep: Add Nord PCIe Endpoint
      PCI: qcom-ep: Add Nord PCIe Endpoint controller support
      PCI: epf-mhi: Add Nord endpoint support
      bus: mhi: host: pci_generic: Add support for Qualcomm Nord
      arm64: dts: qcom: nord: Add PCIe endpoint nodes

 .../devicetree/bindings/pci/qcom,pcie-ep.yaml      |  38 ++-
 arch/arm64/boot/dts/qcom/nord-embedded.dtsi        | 369 +++++++++++++++++++++
 drivers/bus/mhi/host/pci_generic.c                 |  13 +
 drivers/pci/controller/dwc/pcie-designware.c       |   5 +-
 drivers/pci/controller/dwc/pcie-qcom-ep.c          |  33 ++
 drivers/pci/endpoint/functions/pci-epf-mhi.c       |  74 ++++-
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c  | 123 +++++++
 .../qualcomm/phy-qcom-qmp-qserdes-com-pcie-v6_40.h |   7 +
 8 files changed, 654 insertions(+), 8 deletions(-)
---
base-commit: f3ad6a695e245798f9a5bb34f2c7616880bac3d6
change-id: 20261027-nord_ep-f6e8d7b9c107

Best regards,
--  
Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>


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

* [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi()
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-23 10:03   ` Niklas Cassel
  2026-11-22  2:56 ` [PATCH 02/11] PCI: qcom-ep: Add MSI-X support Krishna Chaitanya Chundru
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

Since commit f62da6e7270c ("PCI: endpoint: Align pci_epc_set_msi(),
pci_epc_ops::set_msi() nr_irqs encoding"), pci_epc_set_msi() takes the
number of MSI interrupts directly; the controller driver encodes it into
the Multiple Message Capable field.

The MHI function driver still passes order_base_2(info->msi_count), which
is now encoded a second time: for msi_count = 32 the controller advertises
only 8 MSI vectors instead of 32.

Pass info->msi_count directly.

Fixes: f62da6e7270c ("PCI: endpoint: Align pci_epc_set_msi(), pci_epc_ops::set_msi() nr_irqs encoding")
Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index a633e47edf2f..52cfffcfd5ca 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -730,7 +730,7 @@ static int pci_epf_mhi_epc_init(struct pci_epf *epf)
 	}
 
 	ret = pci_epc_set_msi(epc, epf->func_no, epf->vfunc_no,
-			      order_base_2(info->msi_count));
+			      info->msi_count);
 	if (ret) {
 		dev_err(dev, "Failed to set MSI configuration: %d\n", ret);
 		return ret;

-- 
2.34.1


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

* [PATCH 02/11] PCI: qcom-ep: Add MSI-X support
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi() Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 03/11] PCI: epf-mhi: " Krishna Chaitanya Chundru
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru, Anvita T

From: Anvita T <anvita.t@oss.qualcomm.com>

The controller can signal interrupts using MSI-X in addition to MSI.
Add an epc_features variant that advertises msix_capable and select it
from ->get_features() for SoC configs that set the new msix_capable
flag. Route PCI_IRQ_MSIX requests in ->raise_irq() to
dw_pcie_ep_raise_msix_irq_doorbell().

No functional change for existing SoCs, which leave msix_capable unset.

Signed-off-by: Anvita T <anvita.t@oss.qualcomm.com>
Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/pci/controller/dwc/pcie-qcom-ep.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index 2d7ddf8d173f..c794a2207df2 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -170,12 +170,14 @@ enum qcom_pcie_ep_link_status {
  * @override_no_snoop: Override NO_SNOOP attribute in TLP to enable cache snooping
  * @disable_mhi_ram_parity_check: Disable MHI RAM data parity error check
  * @firmware_managed: Set if the controller is firmware managed
+ * @msix_capable: Set if the controller supports MSI-X
  */
 struct qcom_pcie_ep_cfg {
 	bool hdma_support;
 	bool override_no_snoop;
 	bool disable_mhi_ram_parity_check;
 	bool firmware_managed;
+	bool msix_capable;
 };
 
 /**
@@ -806,6 +808,8 @@ static int qcom_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
 		return dw_pcie_ep_raise_intx_irq(ep, func_no);
 	case PCI_IRQ_MSI:
 		return dw_pcie_ep_raise_msi_irq(ep, func_no, interrupt_num);
+	case PCI_IRQ_MSIX:
+		return dw_pcie_ep_raise_msix_irq_doorbell(ep, func_no, interrupt_num);
 	default:
 		dev_err(pci->dev, "Unknown IRQ type\n");
 		return -EINVAL;
@@ -852,9 +856,25 @@ static const struct pci_epc_features qcom_pcie_epc_features = {
 	.bar[BAR_2] = { .only_64bit = true, },
 };
 
+static const struct pci_epc_features qcom_pcie_epc_features_msix = {
+	DWC_EPC_COMMON_FEATURES,
+	.linkup_notifier = true,
+	.msi_capable = true,
+	.msix_capable = true,
+	.align = SZ_4K,
+	.bar[BAR_0] = { .only_64bit = true, },
+	.bar[BAR_2] = { .only_64bit = true, },
+};
+
 static const struct pci_epc_features *
 qcom_pcie_epc_get_features(struct dw_pcie_ep *pci_ep)
 {
+	struct dw_pcie *pci = to_dw_pcie_from_ep(pci_ep);
+	struct qcom_pcie_ep *pcie_ep = to_pcie_ep(pci);
+
+	if (pcie_ep->cfg && pcie_ep->cfg->msix_capable)
+		return &qcom_pcie_epc_features_msix;
+
 	return &qcom_pcie_epc_features;
 }
 

-- 
2.34.1


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

* [PATCH 03/11] PCI: epf-mhi: Add MSI-X support
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi() Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 02/11] PCI: qcom-ep: Add MSI-X support Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 04/11] PCI: dwc: Preserve glue-provided eDMA HDMA channel separation Krishna Chaitanya Chundru
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru, Anvita T

From: Anvita T <anvita.t@oss.qualcomm.com>

Allow the MHI endpoint function to signal interrupts using MSI-X when the
endpoint controller supports it. On controllers whose epc_features
advertise msix_capable, set up a dedicated MSI-X BAR (BAR_0) from a
"msix" memory region supplied by the platform and program the MSI-X
configuration.

The "msix" resource is optional and only looked up during bind; it is
required only when the controller reports MSI-X capability. At interrupt
time, select PCI_IRQ_MSIX over PCI_IRQ_MSI based on whether MSI-X has
been enabled by the host.

Fetch epc_features earlier in epc_init() so the MSI-X capability can be
checked before setting up the BARs.

Signed-off-by: Anvita T <anvita.t@oss.qualcomm.com>
Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/pci/endpoint/functions/pci-epf-mhi.c | 54 +++++++++++++++++++++++++---
 1 file changed, 49 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index 52cfffcfd5ca..a8765beffe06 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -148,6 +148,7 @@ struct pci_epf_mhi {
 	struct mutex lock;
 	void __iomem *mmio;
 	resource_size_t mmio_phys;
+	resource_size_t msix_phys;
 	struct dma_chan *dma_chan_tx;
 	struct dma_chan *dma_chan_rx;
 	struct workqueue_struct *dma_wq;
@@ -155,6 +156,7 @@ struct pci_epf_mhi {
 	struct list_head dma_list;
 	spinlock_t list_lock;
 	u32 mmio_size;
+	u32 msix_size;
 	int irq;
 };
 
@@ -230,12 +232,16 @@ static void pci_epf_mhi_raise_irq(struct mhi_ep_cntrl *mhi_cntrl, u32 vector)
 	struct pci_epf_mhi *epf_mhi = to_epf_mhi(mhi_cntrl);
 	struct pci_epf *epf = epf_mhi->epf;
 	struct pci_epc *epc = epf->epc;
+	unsigned int type = PCI_IRQ_MSI;
+
+	if (pci_epc_get_msix(epc, epf->func_no, epf->vfunc_no) > 0)
+		type = PCI_IRQ_MSIX;
 
 	/*
 	 * MHI supplies 0 based MSI vectors but the API expects the vector
 	 * number to start from 1, so we need to increment the vector by 1.
 	 */
-	pci_epc_raise_irq(epc, epf->func_no, epf->vfunc_no, PCI_IRQ_MSI,
+	pci_epc_raise_irq(epc, epf->func_no, epf->vfunc_no, type,
 			  vector + 1);
 }
 
@@ -714,11 +720,40 @@ static int pci_epf_mhi_epc_init(struct pci_epf *epf)
 {
 	struct pci_epf_mhi *epf_mhi = epf_get_drvdata(epf);
 	const struct pci_epf_mhi_ep_info *info = epf_mhi->info;
+	struct pci_epf_bar *msix_bar = &epf->bar[BAR_0];
 	struct pci_epf_bar *epf_bar = &epf->bar[info->bar_num];
 	struct pci_epc *epc = epf->epc;
 	struct device *dev = &epf->dev;
 	int ret;
 
+	epf_mhi->epc_features = pci_epc_get_features(epc, epf->func_no, epf->vfunc_no);
+	if (!epf_mhi->epc_features)
+		return -ENODATA;
+
+	if (epf_mhi->epc_features->msix_capable) {
+		if (!epf_mhi->msix_phys) {
+			dev_err(dev, "MSI-X BAR address not configured in DT\n");
+			return -EINVAL;
+		}
+
+		msix_bar->phys_addr = epf_mhi->msix_phys;
+		msix_bar->size = epf_mhi->msix_size;
+		msix_bar->barno = BAR_0;
+		msix_bar->flags = info->epf_flags;
+		ret = pci_epc_set_bar(epc, epf->func_no, epf->vfunc_no, msix_bar);
+		if (ret) {
+			dev_err(dev, "Failed to set MSI-X BAR: %d\n", ret);
+			return ret;
+		}
+
+		ret = pci_epc_set_msix(epc, epf->func_no, epf->vfunc_no,
+				       info->msi_count, BAR_0, 0);
+		if (ret) {
+			dev_err(dev, "Failed to set MSI-X configuration: %d\n", ret);
+			return ret;
+		}
+	}
+
 	epf_bar->phys_addr = epf_mhi->mmio_phys;
 	epf_bar->size = epf_mhi->mmio_size;
 	epf_bar->barno = info->bar_num;
@@ -743,10 +778,6 @@ static int pci_epf_mhi_epc_init(struct pci_epf *epf)
 		return ret;
 	}
 
-	epf_mhi->epc_features = pci_epc_get_features(epc, epf->func_no, epf->vfunc_no);
-	if (!epf_mhi->epc_features)
-		return -ENODATA;
-
 	if (info->flags & MHI_EPF_USE_DMA) {
 		ret = pci_epf_mhi_dma_init(epf_mhi);
 		if (ret) {
@@ -763,6 +794,7 @@ static void pci_epf_mhi_epc_deinit(struct pci_epf *epf)
 	struct pci_epf_mhi *epf_mhi = epf_get_drvdata(epf);
 	const struct pci_epf_mhi_ep_info *info = epf_mhi->info;
 	struct pci_epf_bar *epf_bar = &epf->bar[info->bar_num];
+	struct pci_epf_bar *msix_bar = &epf->bar[BAR_0];
 	struct mhi_ep_cntrl *mhi_cntrl = &epf_mhi->mhi_cntrl;
 	struct pci_epc *epc = epf->epc;
 
@@ -773,6 +805,8 @@ static void pci_epf_mhi_epc_deinit(struct pci_epf *epf)
 		mhi_ep_unregister_controller(mhi_cntrl);
 	}
 
+	if (epf_mhi->epc_features && epf_mhi->epc_features->msix_capable)
+		pci_epc_clear_bar(epc, epf->func_no, epf->vfunc_no, msix_bar);
 	pci_epc_clear_bar(epc, epf->func_no, epf->vfunc_no, epf_bar);
 }
 
@@ -880,6 +914,13 @@ static int pci_epf_mhi_bind(struct pci_epf *epf)
 	if (!epf_mhi->mmio)
 		return -ENOMEM;
 
+	/* MSI-X BAR address is optional; only present on EPCs that support MSI-X */
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "msix");
+	if (res) {
+		epf_mhi->msix_phys = res->start;
+		epf_mhi->msix_size = resource_size(res);
+	}
+
 	ret = platform_get_irq_byname(pdev, "doorbell");
 	if (ret < 0) {
 		iounmap(epf_mhi->mmio);
@@ -896,6 +937,7 @@ static void pci_epf_mhi_unbind(struct pci_epf *epf)
 	struct pci_epf_mhi *epf_mhi = epf_get_drvdata(epf);
 	const struct pci_epf_mhi_ep_info *info = epf_mhi->info;
 	struct pci_epf_bar *epf_bar = &epf->bar[info->bar_num];
+	struct pci_epf_bar *msix_bar = &epf->bar[BAR_0];
 	struct mhi_ep_cntrl *mhi_cntrl = &epf_mhi->mhi_cntrl;
 	struct pci_epc *epc = epf->epc;
 
@@ -912,6 +954,8 @@ static void pci_epf_mhi_unbind(struct pci_epf *epf)
 	}
 
 	iounmap(epf_mhi->mmio);
+	if (epf_mhi->epc_features && epf_mhi->epc_features->msix_capable)
+		pci_epc_clear_bar(epc, epf->func_no, epf->vfunc_no, msix_bar);
 	pci_epc_clear_bar(epc, epf->func_no, epf->vfunc_no, epf_bar);
 }
 

-- 
2.34.1


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

* [PATCH 04/11] PCI: dwc: Preserve glue-provided eDMA HDMA channel separation
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (2 preceding siblings ...)
  2026-11-22  2:56 ` [PATCH 03/11] PCI: epf-mhi: " Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 05/11] phy: qcom: qmp-pcie: Add PCIe endpoint mode support Krishna Chaitanya Chundru
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

dw_pcie_edma_init_data() unconditionally programs the HDMA channel
register space size (ch_space_sz) to 256 bytes. Some controllers space
their per-channel HDMA register blocks further apart, and a glue driver
knows the correct separation for its hardware.

Only apply the 256-byte default when the glue driver has not already set
ch_space_sz, so a glue-provided value is preserved. No functional change
for existing drivers, which do not set it.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/pci/controller/dwc/pcie-designware.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 12f102f48d5d..d55d4213be33 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -1041,7 +1041,10 @@ static void dw_pcie_edma_init_data(struct dw_pcie *pci)
 		pci->edma.ops = &dw_pcie_edma_ops;
 
 	pci->edma.flags |= DW_EDMA_CHIP_LOCAL;
-	pci->edma.ch_space_sz = 256;
+
+	/* Default unless a glue driver programmed a different separation */
+	if (!pci->edma.ch_space_sz)
+		pci->edma.ch_space_sz = 256;
 }
 
 static int dw_pcie_edma_find_mf(struct dw_pcie *pci)

-- 
2.34.1


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

* [PATCH 05/11] phy: qcom: qmp-pcie: Add PCIe endpoint mode support
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (3 preceding siblings ...)
  2026-11-22  2:56 ` [PATCH 04/11] PCI: dwc: Preserve glue-provided eDMA HDMA channel separation Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 06/11] phy: qcom: qmp-pcie: Add Nord endpoint mode init sequences Krishna Chaitanya Chundru
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

The register initialization sequence differs slightly between root
complex and endpoint mode. Add a .set_mode() op that records the
requested PCIe submode, and an optional per-config tbls_ep delta that is
applied as a second qmp_configure() pass over the pll_common/txrxz/pcs
blocks when the PHY was put into endpoint mode before power-on.

Configs that do not provide tbls_ep are unaffected and continue to
program only the root-complex tables.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c | 26 +++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
index ccdb7748a9e1..21cf6adf7d60 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
@@ -13,6 +13,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/phy/pcie.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
@@ -89,6 +90,7 @@ struct qmp_phy_cfg_tbls {
 struct qmp_phy_cfg {
 	const struct qmp_pcie_offsets *offsets;
 	const struct qmp_phy_cfg_tbls tbls;
+	const struct qmp_phy_cfg_tbls *tbls_ep;
 	const struct qmp_phy_init_tbl * const *pll_tbls;
 	const int *pll_nums;
 	bool port_split;
@@ -121,6 +123,7 @@ struct qmp_pcie {
 	struct reset_control_bulk_data *nocsr_resets;
 	struct regulator_bulk_data *vregs;
 	struct device **pd_devs;
+	bool is_ep;
 };
 
 struct qmp_pcie_multiphy {
@@ -930,6 +933,7 @@ static void qmp_pcie_init_port_registers(struct qmp_pcie *qmp)
 	const struct qmp_phy_cfg *cfg = qmp->cfg;
 	const struct qmp_pcie_offsets *offs = cfg->offsets;
 	const struct qmp_phy_cfg_tbls *tbls = &cfg->tbls;
+	const struct qmp_phy_cfg_tbls *ep_tbls = qmp->is_ep ? cfg->tbls_ep : NULL;
 	int i;
 
 	for (i = 0; i < cfg->num_regs; i++) {
@@ -957,6 +961,15 @@ static void qmp_pcie_init_port_registers(struct qmp_pcie *qmp)
 		qmp_configure(qmp->dev, port + offs->pcs_lanez,
 			      tbls->pcs_lanez, tbls->pcs_lanez_num);
 
+		if (ep_tbls) {
+			qmp_configure(qmp->dev, port + offs->pll,
+				      ep_tbls->pll_common, ep_tbls->pll_common_num);
+			qmp_configure(qmp->dev, port + offs->txrxz,
+				      ep_tbls->txrxz, ep_tbls->txrxz_num);
+			qmp_configure(qmp->dev, port + offs->pcs,
+				      ep_tbls->pcs, ep_tbls->pcs_num);
+		}
+
 		if (cfg->port_split)
 			qmp_configure(qmp->dev, port + offs->txrxz,
 				      tbls->port_split_post_cfg, tbls->port_split_post_cfg_num);
@@ -1179,9 +1192,22 @@ static int qmp_pcie_disable(struct phy *phy)
 	return qmp_pcie_exit(phy);
 }
 
+static int qmp_pcie_set_mode(struct phy *phy, enum phy_mode mode, int submode)
+{
+	struct qmp_pcie *qmp = phy_get_drvdata(phy);
+
+	if (mode != PHY_MODE_PCIE)
+		return -EINVAL;
+
+	qmp->is_ep = (submode == PHY_MODE_PCIE_EP);
+
+	return 0;
+}
+
 static const struct phy_ops qmp_pcie_phy_ops = {
 	.power_on	= qmp_pcie_enable,
 	.power_off	= qmp_pcie_disable,
+	.set_mode	= qmp_pcie_set_mode,
 	.owner		= THIS_MODULE,
 };
 

-- 
2.34.1


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

* [PATCH 06/11] phy: qcom: qmp-pcie: Add Nord endpoint mode init sequences
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (4 preceding siblings ...)
  2026-11-22  2:56 ` [PATCH 05/11] phy: qcom: qmp-pcie: Add PCIe endpoint mode support Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 07/11] dt-bindings: PCI: qcom-ep: Add Nord PCIe Endpoint Krishna Chaitanya Chundru
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

Provide the endpoint-mode PLL, TXRXZ and PCS init table deltas for the
Nord Gen5x16 PCIe multi-PHY and wire them up as tbls_ep so they are
applied on top of the shared root-complex tables when the controller is
operated in endpoint mode.

Add the QSERDES v6_40 COM register offsets (INTEGLOOP_GAIN0/1 for all
three modes and CLK_FWD_CONFIG_2) used by these sequences.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c  | 97 ++++++++++++++++++++++
 .../qualcomm/phy-qcom-qmp-qserdes-com-pcie-v6_40.h |  7 ++
 2 files changed, 104 insertions(+)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
index 21cf6adf7d60..dcd8a3f794cb 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-multiphy.c
@@ -653,6 +653,102 @@ static const struct qmp_phy_cfg_tbls nord_qmp_pcie_tbls = {
 	.port_split_post_cfg_num	= ARRAY_SIZE(nord_qmp_pcie_port_split_post_cfg_tbl),
 };
 
+static const struct qmp_phy_init_tbl nord_qmp_pcie_pll_ep_tbl[] = {
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_CLK_FWD_CONFIG_2, 0x28),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_CP_CTRL_MODE2, 0x28),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_PLL_RCTRL_MODE2, 0x0d),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_PLL_CCTRL_MODE2, 0x00),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_LOCK_CMP1_MODE2, 0xff),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_LOCK_CMP2_MODE2, 0x09),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_DEC_START_MODE2, 0x28),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN0_MODE2, 0xfb),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN1_MODE2, 0x03),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_BIN_VCOCAL_CMP_CODE1_MODE2, 0x87),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_BIN_VCOCAL_CMP_CODE2_MODE2, 0x17),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_CP_CTRL_MODE1, 0x28),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_PLL_RCTRL_MODE1, 0x0d),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_PLL_CCTRL_MODE1, 0x00),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_LOCK_CMP1_MODE1, 0xff),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_LOCK_CMP2_MODE1, 0x04),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_DEC_START_MODE1, 0x28),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN0_MODE1, 0xfb),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN1_MODE1, 0x03),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_BIN_VCOCAL_CMP_CODE1_MODE1, 0xc4),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_BIN_VCOCAL_CMP_CODE2_MODE1, 0x0b),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_CP_CTRL_MODE0, 0x28),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_PLL_RCTRL_MODE0, 0x0d),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_PLL_CCTRL_MODE0, 0x00),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_LOCK_CMP1_MODE0, 0x3f),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_LOCK_CMP2_MODE0, 0x01),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_DEC_START_MODE0, 0x19),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN0_MODE0, 0xfb),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN1_MODE0, 0x03),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_BIN_VCOCAL_CMP_CODE1_MODE0, 0xab),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_BG_TIMER, 0x06),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_SYS_CLK_CTRL, 0x07),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_PLL_IVCO, 0x0f),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_SYSCLK_EN_SEL, 0x00),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_PSM_CAL_EN, 0x01),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_COM_CMN_IETRIM, 0x1b),
+};
+
+static const struct qmp_phy_init_tbl nord_qmp_pcie_txrxz_ep_tbl[] = {
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE2_B1, 0x30),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE2_B3, 0x60),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE2_B4, 0x2c),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE2_B7, 0x1d),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE3_B0, 0xde),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE3_B1, 0x35),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE3_B2, 0x38),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE3_B4, 0x2c),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE3_B5, 0xdd),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE3_B7, 0x23),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE4_B0, 0xed),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE4_B1, 0x68),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE4_B2, 0x6d),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE4_B3, 0x20),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE4_B4, 0x8c),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE4_B7, 0x06),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE_0_1_B1, 0x42),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_MODE_RATE_0_1_B4, 0x1a),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_LANE_MODE_4, 0x00),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_TOP_LDO_CODE_CTRL3, 0x83),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_CDR_CP_CUR_PLL_RATE3, 0x01),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_CDR_CP_CUR_PLL_RATE4, 0x02),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_CDR_IQTUNE_CTRL, 0x00),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_KP_CAL_LOWER_FREQ_DIFF_BND_RATE3, 0x15),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_KP_CAL_LOWER_FREQ_DIFF_BND_RATE4, 0x0a),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RX_IVCM_CAL_CTRL4, 0x03),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_CDR_LOOP_RCODE_FAST_RATE_0_1, 0x00),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_CDR_LOOP_RCODE_FAST_RATE4, 0x02),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_CDR_VCO_CTUNE_MEAS_CNT1_RATE2, 0x09),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_CDR_VCO_CTUNE_MEAS_CNT1_RATE3, 0x09),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_VGA_CAL_MAN_VAL_RATE4, 0x0a),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_KVCO_IDEAL_FREQ_DIFF1_RATE3, 0x2f),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_KVCO_INIT_RATE_2_3, 0x11),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_KVCO_INIT_RATE_4, 0x03),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_RESTRIM_VREF_SEL, 0x12),
+	QMP_PHY_INIT_CFG(QSERDES_PCIE_V6_40_TXRXZ_VTHRESH_CAL_MAN_VAL_RATE4, 0x45),
+};
+
+static const struct qmp_phy_init_tbl nord_qmp_pcie_pcs_ep_tbl[] = {
+	QMP_PHY_INIT_CFG(QPHY_PCIE_V6_40_PCS_COM_POWER_STATE_CONFIG2, 0x34),
+	QMP_PHY_INIT_CFG(QPHY_PCIE_V6_40_PCS_COM_PCS_TX_RX_CONFIG5, 0x01),
+	QMP_PHY_INIT_CFG(QPHY_PCIE_V6_40_PCS_COM_PCS_TX_RX_CONFIG10, 0x00),
+	QMP_PHY_INIT_CFG(QPHY_PCIE_V6_40_PCS_COM_ALIGN_DETECT_CONFIG7, 0x30),
+	QMP_PHY_INIT_CFG(QPHY_PCIE_V6_40_PCS_COM_EQ_CONFIG2, 0xdc),
+	QMP_PHY_INIT_CFG(QPHY_PCIE_V6_40_PCS_COM_G345_EQ_CONFIG1, 0x07),
+};
+
+static const struct qmp_phy_cfg_tbls nord_qmp_pcie_ep_tbls = {
+	.pll_common	= nord_qmp_pcie_pll_ep_tbl,
+	.pll_common_num	= ARRAY_SIZE(nord_qmp_pcie_pll_ep_tbl),
+	.txrxz		= nord_qmp_pcie_txrxz_ep_tbl,
+	.txrxz_num	= ARRAY_SIZE(nord_qmp_pcie_txrxz_ep_tbl),
+	.pcs		= nord_qmp_pcie_pcs_ep_tbl,
+	.pcs_num	= ARRAY_SIZE(nord_qmp_pcie_pcs_ep_tbl),
+};
+
 static const struct qmp_phy_init_tbl * const nord_qmp_pcie_pll_a[] = {
 	nord_qmp_pcie_pll_a_ovl_tbl,
 };
@@ -839,6 +935,7 @@ static const char * const nord_pciephy_port_d_pipeclk_l[] = { "pipe_d" };
 static const struct qmp_phy_cfg nord_qmp_pcie_port_##_port##_cfg = {		\
 	.offsets		= &nord_pcie_offsets_v6_40,			\
 	.tbls			= nord_qmp_pcie_tbls,				\
+	.tbls_ep		= &nord_qmp_pcie_ep_tbls,			\
 	.pll_tbls		= nord_qmp_pcie_pll_##_port,			\
 	.pll_nums		= nord_qmp_pcie_pll_##_port##_nums,		\
 	.port_split		= _port_split,					\
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-pcie-v6_40.h b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-pcie-v6_40.h
index 0eeab0693e9b..3cc030625f25 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-pcie-v6_40.h
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-qserdes-com-pcie-v6_40.h
@@ -8,6 +8,8 @@
 
 #define QSERDES_PCIE_V6_40_COM_SSC_STEP_SIZE1_MODE1		0x000
 #define QSERDES_PCIE_V6_40_COM_SSC_STEP_SIZE2_MODE1		0x004
+#define QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN0_MODE1		0x040
+#define QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN1_MODE1		0x044
 #define QSERDES_PCIE_V6_40_COM_CLK_EP_DIV_MODE1			0x00c
 #define QSERDES_PCIE_V6_40_COM_CP_CTRL_MODE1			0x010
 #define QSERDES_PCIE_V6_40_COM_PLL_RCTRL_MODE1			0x014
@@ -26,6 +28,8 @@
 #define QSERDES_PCIE_V6_40_COM_BIN_VCOCAL_CMP_CODE2_MODE0	0x05c
 #define QSERDES_PCIE_V6_40_COM_SSC_STEP_SIZE1_MODE0		0x060
 #define QSERDES_PCIE_V6_40_COM_SSC_STEP_SIZE2_MODE0		0x064
+#define QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN0_MODE0		0x0a0
+#define QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN1_MODE0		0x0a4
 #define QSERDES_PCIE_V6_40_COM_CLK_EP_DIV_MODE0			0x06c
 #define QSERDES_PCIE_V6_40_COM_CP_CTRL_MODE0			0x070
 #define QSERDES_PCIE_V6_40_COM_PLL_RCTRL_MODE0			0x074
@@ -68,6 +72,8 @@
 #define QSERDES_PCIE_V6_40_COM_CMN_CONFIG_2			0x22c
 #define QSERDES_PCIE_V6_40_COM_SSC_STEP_SIZE1_MODE2		0x1cc
 #define QSERDES_PCIE_V6_40_COM_SSC_STEP_SIZE2_MODE2		0x1d0
+#define QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN0_MODE2		0x208
+#define QSERDES_PCIE_V6_40_COM_INTEGLOOP_GAIN1_MODE2		0x20c
 #define QSERDES_PCIE_V6_40_COM_CP_CTRL_MODE2			0x1dc
 #define QSERDES_PCIE_V6_40_COM_PLL_RCTRL_MODE2			0x1e0
 #define QSERDES_PCIE_V6_40_COM_PLL_CCTRL_MODE2			0x1e4
@@ -83,6 +89,7 @@
 #define QSERDES_PCIE_V6_40_COM_DCC_CAL_3			0x2e0
 #define QSERDES_PCIE_V6_40_COM_PSM_CAL_EN			0x2f0
 #define QSERDES_PCIE_V6_40_COM_CLK_FWD_CONFIG_1			0x2f4
+#define QSERDES_PCIE_V6_40_COM_CLK_FWD_CONFIG_2			0x2f8
 #define QSERDES_PCIE_V6_40_COM_IP_CTRL_AND_DP_SEL		0x2fc
 #define QSERDES_PCIE_V6_40_COM_PLL_SPARE_FOR_ECO		0x2b8
 #define QSERDES_PCIE_V6_40_COM_PLL_IVCO_MODE1			0x0f8

-- 
2.34.1


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

* [PATCH 07/11] dt-bindings: PCI: qcom-ep: Add Nord PCIe Endpoint
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (5 preceding siblings ...)
  2026-11-22  2:56 ` [PATCH 06/11] phy: qcom: qmp-pcie: Add Nord endpoint mode init sequences Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 08/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

Add the qcom,nord-pcie-ep compatible for the PCIe Endpoint controller on
the Qualcomm Nord platform.

Like the other DMA-capable controllers, it has three interrupts, requires
an IOMMU and uses the same five clocks as sa8775p. The instance that
supports MSI-X additionally exposes a dedicated MSI-X BAR as an eighth
"msix" register region, so permit Nord to carry seven or eight reg
entries while leaving the other controllers at seven.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 .../devicetree/bindings/pci/qcom,pcie-ep.yaml      | 38 +++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml
index bed9a40b186b..9a6a7f6f7f62 100644
--- a/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml
@@ -13,6 +13,7 @@ properties:
   compatible:
     oneOf:
       - enum:
+          - qcom,nord-pcie-ep
           - qcom,sa8775p-pcie-ep
           - qcom,sar2130p-pcie-ep
           - qcom,sdx55-pcie-ep
@@ -31,6 +32,7 @@ properties:
       - description: Memory region used to map remote RC address space
       - description: BAR memory region
       - description: DMA register space
+      - description: MSI-X BAR memory region
 
   reg-names:
     minItems: 6
@@ -42,6 +44,7 @@ properties:
       - const: addr_space
       - const: mmio
       - const: dma
+      - const: msix
 
   clocks:
     minItems: 5
@@ -185,7 +188,39 @@ allOf:
           minItems: 2
           maxItems: 2
         iommus: false
-    else:
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,nord-pcie-ep
+    then:
+      properties:
+        reg:
+          minItems: 7
+          maxItems: 8
+        reg-names:
+          minItems: 7
+          maxItems: 8
+        interrupts:
+          minItems: 3
+          maxItems: 3
+        interrupt-names:
+          minItems: 3
+          maxItems: 3
+      required:
+        - iommus
+
+  - if:
+      not:
+        properties:
+          compatible:
+            contains:
+              enum:
+                - qcom,nord-pcie-ep
+                - qcom,sdx55-pcie-ep
+    then:
       properties:
         reg:
           minItems: 7
@@ -263,6 +298,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - qcom,nord-pcie-ep
               - qcom,sa8775p-pcie-ep
     then:
       properties:

-- 
2.34.1


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

* [PATCH 08/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (6 preceding siblings ...)
  2026-11-22  2:56 ` [PATCH 07/11] dt-bindings: PCI: qcom-ep: Add Nord PCIe Endpoint Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 09/11] PCI: epf-mhi: Add Nord endpoint support Krishna Chaitanya Chundru
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

Add support for the PCIe Endpoint controller found on the Nord platform
via the qcom,nord-pcie-ep compatible. It supports HDMA, overrides the
NO_SNOOP attribute and disables the MHI RAM parity check, and is MSI-X
capable.

The Nord HDMA block spaces its per-channel register blocks 4K apart
instead of the dw-edma 256-byte default, so program edma.ch_space_sz
from the SoC config.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/pci/controller/dwc/pcie-qcom-ep.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index c794a2207df2..661bd8aac7cc 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -171,6 +171,8 @@ enum qcom_pcie_ep_link_status {
  * @disable_mhi_ram_parity_check: Disable MHI RAM data parity error check
  * @firmware_managed: Set if the controller is firmware managed
  * @msix_capable: Set if the controller supports MSI-X
+ * @ch_space_sz: HDMA per-channel register space size in bytes. 0 selects the
+ *               dw-edma default (256).
  */
 struct qcom_pcie_ep_cfg {
 	bool hdma_support;
@@ -178,6 +180,7 @@ struct qcom_pcie_ep_cfg {
 	bool disable_mhi_ram_parity_check;
 	bool firmware_managed;
 	bool msix_capable;
+	u32 ch_space_sz;
 };
 
 /**
@@ -903,6 +906,7 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev)
 		pcie_ep->pci.edma.ll_wr_cnt = 8;
 		pcie_ep->pci.edma.ll_rd_cnt = 8;
 		pcie_ep->pci.edma.mf = EDMA_MF_HDMA_NATIVE;
+		pcie_ep->pci.edma.ch_space_sz = pcie_ep->cfg->ch_space_sz;
 	}
 
 	platform_set_drvdata(pdev, pcie_ep);
@@ -984,7 +988,16 @@ static const struct qcom_pcie_ep_cfg cfg_1_34_0_fw_managed = {
 	.firmware_managed = true,
 };
 
+static const struct qcom_pcie_ep_cfg cfg_nord = {
+	.hdma_support = true,
+	.override_no_snoop = true,
+	.disable_mhi_ram_parity_check = true,
+	.msix_capable = true,
+	.ch_space_sz = SZ_4K,
+};
+
 static const struct of_device_id qcom_pcie_ep_match[] = {
+	{ .compatible = "qcom,nord-pcie-ep", .data = &cfg_nord},
 	{ .compatible = "qcom,sa8255p-pcie-ep", .data = &cfg_1_34_0_fw_managed},
 	{ .compatible = "qcom,sa8775p-pcie-ep", .data = &cfg_1_34_0},
 	{ .compatible = "qcom,sdx55-pcie-ep", },

-- 
2.34.1


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

* [PATCH 09/11] PCI: epf-mhi: Add Nord endpoint support
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (7 preceding siblings ...)
  2026-11-22  2:56 ` [PATCH 08/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 10/11] bus: mhi: host: pci_generic: Add support for Qualcomm Nord Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes Krishna Chaitanya Chundru
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

Add the pci_epf_mhi_nord endpoint function info for the Nord platform.
It uses the v1 MHI config over BAR_1 with 32 MSI vectors and eDMA, and a
Qualcomm vendor/device ID.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/pci/endpoint/functions/pci-epf-mhi.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index a8765beffe06..6476a2f33f6d 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -140,6 +140,23 @@ static const struct pci_epf_mhi_ep_info sa8775p_info = {
 	.flags = MHI_EPF_USE_DMA,
 };
 
+static struct pci_epf_header nord_header = {
+	.vendorid = PCI_VENDOR_ID_QCOM,
+	.deviceid = 0x0120,
+	.baseclass_code = PCI_CLASS_OTHERS,
+	.interrupt_pin = PCI_INTERRUPT_INTA,
+};
+
+static const struct pci_epf_mhi_ep_info nord_info = {
+	.config = &mhi_v1_config,
+	.epf_header = &nord_header,
+	.bar_num = BAR_1,
+	.epf_flags = PCI_BASE_ADDRESS_MEM_TYPE_32,
+	.msi_count = 32,
+	.mru = 0x8000,
+	.flags = MHI_EPF_USE_DMA,
+};
+
 struct pci_epf_mhi {
 	const struct pci_epc_features *epc_features;
 	const struct pci_epf_mhi_ep_info *info;
@@ -993,6 +1010,7 @@ static int pci_epf_mhi_probe(struct pci_epf *epf,
 }
 
 static const struct pci_epf_device_id pci_epf_mhi_ids[] = {
+	{ .name = "pci_epf_mhi_nord", .driver_data = (kernel_ulong_t)&nord_info },
 	{ .name = "pci_epf_mhi_sa8775p", .driver_data = (kernel_ulong_t)&sa8775p_info },
 	{ .name = "pci_epf_mhi_sdx55", .driver_data = (kernel_ulong_t)&sdx55_info },
 	{ .name = "pci_epf_mhi_sm8450", .driver_data = (kernel_ulong_t)&sm8450_info },

-- 
2.34.1


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

* [PATCH 10/11] bus: mhi: host: pci_generic: Add support for Qualcomm Nord
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (8 preceding siblings ...)
  2026-11-22  2:56 ` [PATCH 09/11] PCI: epf-mhi: Add Nord endpoint support Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  2026-11-22  2:56 ` [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes Krishna Chaitanya Chundru
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

Add an MHI PCI device entry for the Qualcomm Nord endpoint (device ID
0x0120), so a Linux host can enumerate and drive it over MHI. Nord
exposes the same software IP channel configuration as sa8775p, so reuse
its controller config.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 drivers/bus/mhi/host/pci_generic.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index ca9ef4aaa014..65201ec8dc76 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -383,6 +383,17 @@ static const struct mhi_pci_dev_info mhi_qcom_sa8775p_info = {
 	.sideband_wake = false,
 };
 
+static const struct mhi_pci_dev_info mhi_qcom_nord_info = {
+	.name = "qcom-nord",
+	.edl_trigger = false,
+	.config = &mhi_qcom_sa8775p_config,
+	/* The endpoint places the MHI registers in BAR 1 */
+	.bar_num = 1,
+	.dma_data_width = 32,
+	.mru_default = 32768,
+	.sideband_wake = false,
+};
+
 static const struct mhi_pci_dev_info mhi_qcom_sdx75_info = {
 	.name = "qcom-sdx75m",
 	.fw = "qcom/sdx75m/xbl.elf",
@@ -966,6 +977,8 @@ static const struct mhi_pci_dev_info mhi_netprisma_fcun69_info = {
 static const struct pci_device_id mhi_pci_id_table[] = {
 	{PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0116),
 		.driver_data = (kernel_ulong_t) &mhi_qcom_sa8775p_info },
+	{PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0120),
+		.driver_data = (kernel_ulong_t) &mhi_qcom_nord_info },
 	/* Telit FN920C04 (sdx35) */
 	{PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x011a, 0x1c5d, 0x2020),
 		.driver_data = (kernel_ulong_t) &mhi_telit_fn920c04_info },

-- 
2.34.1


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

* [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes
  2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
                   ` (9 preceding siblings ...)
  2026-11-22  2:56 ` [PATCH 10/11] bus: mhi: host: pci_generic: Add support for Qualcomm Nord Krishna Chaitanya Chundru
@ 2026-11-22  2:56 ` Krishna Chaitanya Chundru
  10 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-11-22  2:56 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Niklas Cassel,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: mhi, linux-arm-msm, linux-pci, devicetree, linux-phy,
	Krishna Chaitanya Chundru

Add the pcie0_ep..pcie3_ep endpoint controller nodes for the four Nord
PCIe instances, including their PARF/DBI/ELBI/ATU/MMIO/DMA register
regions, clocks, interrupts (global, doorbell, dma), interconnects,
SMMU, resets, power domains, PHYs and pin control. pcie0_ep additionally
carries the dedicated MSI-X BAR region.

Endpoint mode swaps the PERST#/WAKE# directions relative to root complex
(PERST# is an input, WAKE# an output), so dedicated pcieN_ep_default pin
states are used instead of the root-complex pcieN_default ones. All
nodes are left disabled by default.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/nord-embedded.dtsi | 369 ++++++++++++++++++++++++++++
 1 file changed, 369 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
index db70631af6f1..d86c78b9640b 100644
--- a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
+++ b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
@@ -1541,6 +1541,287 @@ pcie_phy: phy@1b00000 {
 		status = "disabled";
 	};
 
+	pcie0_ep: pcie-ep@1b80000 {
+		compatible = "qcom,nord-pcie-ep";
+
+		reg = <0x00 0x01b80000 0x00 0x00004000>,
+		      <0x00 0x40000000 0x00 0x00000f20>,
+		      <0x00 0x40000f20 0x00 0x000000a8>,
+		      <0x00 0x40010000 0x00 0x00020000>,
+		      <0x00 0x40100000 0x00 0x0ff00000>,
+		      <0x00 0x01b84000 0x00 0x00001000>,
+		      <0x00 0x40030000 0x00 0x00010000>,
+		      <0x00 0x40020000 0x00 0x00001400>;
+		reg-names = "parf",
+			    "dbi",
+			    "elbi",
+			    "atu",
+			    "addr_space",
+			    "mmio",
+			    "dma",
+			    "msix";
+
+		clocks = <&gcc GCC_PCIE_A_AUX_CLK>,
+			 <&gcc GCC_PCIE_A_CFG_AHB_CLK>,
+			 <&gcc GCC_PCIE_A_MSTR_AXI_CLK>,
+			 <&gcc GCC_PCIE_A_SLV_AXI_CLK>,
+			 <&gcc GCC_PCIE_A_SLV_Q2A_AXI_CLK>;
+		clock-names = "aux",
+			      "cfg",
+			      "bus_master",
+			      "bus_slave",
+			      "slave_q2a";
+
+		assigned-clocks = <&gcc GCC_PCIE_A_AUX_CLK>;
+		assigned-clock-rates = <19200000>;
+
+		dma-coherent;
+
+		interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 444 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "global",
+				  "doorbell",
+				  "dma";
+
+		interconnects = <&pcie_data_inbound MASTER_PCIE_0 QCOM_ICC_TAG_ALWAYS
+				 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+				<&hscnoc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+				 &config_noc SLAVE_PCIE_0 QCOM_ICC_TAG_ALWAYS>;
+		interconnect-names = "pcie-mem",
+				     "cpu-pcie";
+
+		iommus = <&pcie_smmu 0x0>;
+
+		resets = <&gcc GCC_PCIE_A_BCR>;
+		reset-names = "core";
+
+		power-domains = <&gcc GCC_PCIE_A_GDSC>;
+
+		phys = <&pcie_phy 0>;
+		phy-names = "pciephy";
+
+		reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
+		wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&pcie0_ep_default>;
+		pinctrl-names = "default";
+
+		linux,pci-domain = <0>;
+
+		status = "disabled";
+	};
+
+	pcie1_ep: pcie-ep@1b88000 {
+		compatible = "qcom,nord-pcie-ep";
+
+		reg = <0x00 0x01b88000 0x00 0x00004000>,
+		      <0x00 0x50000000 0x00 0x00000f20>,
+		      <0x00 0x50000f20 0x00 0x000000a8>,
+		      <0x00 0x50010000 0x00 0x00010000>,
+		      <0x00 0x50100000 0x00 0x00100000>,
+		      <0x00 0x01b8c000 0x00 0x00001000>,
+		      <0x00 0x50030000 0x00 0x00010000>;
+		reg-names = "parf",
+			    "dbi",
+			    "elbi",
+			    "atu",
+			    "addr_space",
+			    "mmio",
+			    "dma";
+
+		clocks = <&gcc GCC_PCIE_B_AUX_CLK>,
+			 <&gcc GCC_PCIE_B_CFG_AHB_CLK>,
+			 <&gcc GCC_PCIE_B_MSTR_AXI_CLK>,
+			 <&gcc GCC_PCIE_B_SLV_AXI_CLK>,
+			 <&gcc GCC_PCIE_B_SLV_Q2A_AXI_CLK>;
+		clock-names = "aux",
+			      "cfg",
+			      "bus_master",
+			      "bus_slave",
+			      "slave_q2a";
+
+		assigned-clocks = <&gcc GCC_PCIE_B_AUX_CLK>;
+		assigned-clock-rates = <19200000>;
+
+		dma-coherent;
+
+		interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 658 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 845 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "global",
+				  "doorbell",
+				  "dma";
+
+		interconnects = <&pcie_data_inbound MASTER_PCIE_1 QCOM_ICC_TAG_ALWAYS
+				 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+				<&hscnoc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+				 &config_noc SLAVE_PCIE_1 QCOM_ICC_TAG_ALWAYS>;
+		interconnect-names = "pcie-mem",
+				     "cpu-pcie";
+
+		iommus = <&pcie_smmu 0x10000>;
+
+		resets = <&gcc GCC_PCIE_B_BCR>;
+		reset-names = "core";
+
+		power-domains = <&gcc GCC_PCIE_B_GDSC>;
+
+		phys = <&pcie_phy 1>;
+		phy-names = "pciephy";
+
+		reset-gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
+		wake-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&pcie1_ep_default>;
+		pinctrl-names = "default";
+
+		num-lanes = <4>;
+		linux,pci-domain = <1>;
+
+		status = "disabled";
+	};
+
+	pcie2_ep: pcie-ep@1b90000 {
+		compatible = "qcom,nord-pcie-ep";
+
+		reg = <0x00 0x01b90000 0x00 0x00004000>,
+		      <0x00 0x60000000 0x00 0x00000f20>,
+		      <0x00 0x60000f20 0x00 0x000000a8>,
+		      <0x00 0x60010000 0x00 0x00010000>,
+		      <0x00 0x60100000 0x00 0x00100000>,
+		      <0x00 0x01b94000 0x00 0x00001000>,
+		      <0x00 0x60030000 0x00 0x00010000>;
+		reg-names = "parf",
+			    "dbi",
+			    "elbi",
+			    "atu",
+			    "addr_space",
+			    "mmio",
+			    "dma";
+
+		clocks = <&gcc GCC_PCIE_C_AUX_CLK>,
+			 <&gcc GCC_PCIE_C_CFG_AHB_CLK>,
+			 <&gcc GCC_PCIE_C_MSTR_AXI_CLK>,
+			 <&gcc GCC_PCIE_C_SLV_AXI_CLK>,
+			 <&gcc GCC_PCIE_C_SLV_Q2A_AXI_CLK>;
+		clock-names = "aux",
+			      "cfg",
+			      "bus_master",
+			      "bus_slave",
+			      "slave_q2a";
+
+		assigned-clocks = <&gcc GCC_PCIE_C_AUX_CLK>;
+		assigned-clock-rates = <19200000>;
+
+		dma-coherent;
+
+		interrupts = <GIC_SPI 464 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "global",
+				  "doorbell",
+				  "dma";
+
+		interconnects = <&pcie_data_inbound MASTER_PCIE_2 QCOM_ICC_TAG_ALWAYS
+				 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+				<&hscnoc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+				 &config_noc SLAVE_PCIE_2 QCOM_ICC_TAG_ALWAYS>;
+		interconnect-names = "pcie-mem",
+				     "cpu-pcie";
+
+		iommus = <&pcie_smmu 0x20000>;
+
+		resets = <&gcc GCC_PCIE_C_BCR>;
+		reset-names = "core";
+
+		power-domains = <&gcc GCC_PCIE_C_GDSC>;
+
+		phys = <&pcie_phy 2>;
+		phy-names = "pciephy";
+
+		reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
+		wake-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&pcie2_ep_default>;
+		pinctrl-names = "default";
+
+		num-lanes = <2>;
+		linux,pci-domain = <2>;
+
+		status = "disabled";
+	};
+
+	pcie3_ep: pcie-ep@1b98000 {
+		compatible = "qcom,nord-pcie-ep";
+
+		reg = <0x00 0x01b98000 0x00 0x00004000>,
+		      <0x00 0x70000000 0x00 0x00000f20>,
+		      <0x00 0x70000f20 0x00 0x000000a8>,
+		      <0x00 0x70010000 0x00 0x00010000>,
+		      <0x00 0x70100000 0x00 0x00100000>,
+		      <0x00 0x01b9c000 0x00 0x00001000>,
+		      <0x00 0x70030000 0x00 0x00010000>;
+		reg-names = "parf",
+			    "dbi",
+			    "elbi",
+			    "atu",
+			    "addr_space",
+			    "mmio",
+			    "dma";
+
+		clocks = <&gcc GCC_PCIE_D_AUX_CLK>,
+			 <&gcc GCC_PCIE_D_CFG_AHB_CLK>,
+			 <&gcc GCC_PCIE_D_MSTR_AXI_CLK>,
+			 <&gcc GCC_PCIE_D_SLV_AXI_CLK>,
+			 <&gcc GCC_PCIE_D_SLV_Q2A_AXI_CLK>;
+		clock-names = "aux",
+			      "cfg",
+			      "bus_master",
+			      "bus_slave",
+			      "slave_q2a";
+
+		assigned-clocks = <&gcc GCC_PCIE_D_AUX_CLK>;
+		assigned-clock-rates = <19200000>;
+
+		dma-coherent;
+
+		interrupts = <GIC_SPI 465 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "global",
+				  "doorbell",
+				  "dma";
+
+		interconnects = <&pcie_data_inbound MASTER_PCIE_3 QCOM_ICC_TAG_ALWAYS
+				 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+				<&hscnoc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+				 &config_noc SLAVE_PCIE_3 QCOM_ICC_TAG_ALWAYS>;
+		interconnect-names = "pcie-mem",
+				     "cpu-pcie";
+
+		iommus = <&pcie_smmu 0x30000>;
+
+		resets = <&gcc GCC_PCIE_D_BCR>;
+		reset-names = "core";
+
+		power-domains = <&gcc GCC_PCIE_D_GDSC>;
+
+		phys = <&pcie_phy 3>;
+		phy-names = "pciephy";
+
+		reset-gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
+		wake-gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
+
+		pinctrl-0 = <&pcie3_ep_default>;
+		pinctrl-names = "default";
+
+		num-lanes = <2>;
+		linux,pci-domain = <3>;
+
+		status = "disabled";
+	};
+
 	pcie_cfg: interconnect@1ba0000 {
 		compatible = "qcom,nord-pcie-cfg";
 		reg = <0x0 0x01ba0000 0x0 0x7200>;
@@ -1961,6 +2242,94 @@ perst-pins {
 		};
 	};
 
+	pcie0_ep_default: pcie0-ep-default-state {
+		perst-pins {
+			pins = "gpio2";
+			function = "gpio";
+			bias-pull-down;
+		};
+
+		clkreq-pins {
+			pins = "gpio1";
+			function = "pcie0_clk_req_n";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+
+		wake-pins {
+			pins = "gpio0";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	pcie1_ep_default: pcie1-ep-default-state {
+		perst-pins {
+			pins = "gpio5";
+			function = "gpio";
+			bias-pull-down;
+		};
+
+		clkreq-pins {
+			pins = "gpio4";
+			function = "pcie1_clk_req_n";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+
+		wake-pins {
+			pins = "gpio3";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	pcie2_ep_default: pcie2-ep-default-state {
+		perst-pins {
+			pins = "gpio8";
+			function = "gpio";
+			bias-pull-down;
+		};
+
+		clkreq-pins {
+			pins = "gpio7";
+			function = "pcie2_clk_req_n";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+
+		wake-pins {
+			pins = "gpio6";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	pcie3_ep_default: pcie3-ep-default-state {
+		perst-pins {
+			pins = "gpio11";
+			function = "gpio";
+			bias-pull-down;
+		};
+
+		clkreq-pins {
+			pins = "gpio10";
+			function = "pcie3_clk_req_n";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+
+		wake-pins {
+			pins = "gpio9";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	qup_i2c0_default: qup-i2c0-default-state {
 		pins = "gpio111", "gpio112";
 		function = "qup0_se0";

-- 
2.34.1


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

* Re: [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi()
  2026-11-22  2:56 ` [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi() Krishna Chaitanya Chundru
@ 2026-11-23 10:03   ` Niklas Cassel
  0 siblings, 0 replies; 13+ messages in thread
From: Niklas Cassel @ 2026-11-23 10:03 UTC (permalink / raw)
  To: Krishna Chaitanya Chundru
  Cc: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas,
	Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jingoo Han, Vinod Koul, Neil Armstrong, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa, mhi, linux-arm-msm, linux-pci,
	devicetree, linux-phy

On Sun, Nov 22, 2026 at 08:26:14AM +0530, Krishna Chaitanya Chundru wrote:
> Since commit f62da6e7270c ("PCI: endpoint: Align pci_epc_set_msi(),
> pci_epc_ops::set_msi() nr_irqs encoding"), pci_epc_set_msi() takes the
> number of MSI interrupts directly; the controller driver encodes it into
> the Multiple Message Capable field.
> 
> The MHI function driver still passes order_base_2(info->msi_count), which
> is now encoded a second time: for msi_count = 32 the controller advertises
> only 8 MSI vectors instead of 32.
> 
> Pass info->msi_count directly.
> 
> Fixes: f62da6e7270c ("PCI: endpoint: Align pci_epc_set_msi(), pci_epc_ops::set_msi() nr_irqs encoding")


As Sashiko already pointed out [1], this Fixes tag is wrong.

Please also reword the commit message, since it is based on the same
misunderstanding.

This matters for stable: commit 1bf5f25324f7 is in v6.5, but commit
f62da6e7270c is only in v6.16, so with the current tag, the stable
kernels in between would not get this fix.

The code change itself looks good to me.

[1] https://lore.kernel.org/all/sashiko-outbox-227654@kernel.org/


Kind regards,
Niklas

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

end of thread, other threads:[~2026-11-23 10:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22  2:56 [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 01/11] PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi() Krishna Chaitanya Chundru
2026-11-23 10:03   ` Niklas Cassel
2026-11-22  2:56 ` [PATCH 02/11] PCI: qcom-ep: Add MSI-X support Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 03/11] PCI: epf-mhi: " Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 04/11] PCI: dwc: Preserve glue-provided eDMA HDMA channel separation Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 05/11] phy: qcom: qmp-pcie: Add PCIe endpoint mode support Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 06/11] phy: qcom: qmp-pcie: Add Nord endpoint mode init sequences Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 07/11] dt-bindings: PCI: qcom-ep: Add Nord PCIe Endpoint Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 08/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 09/11] PCI: epf-mhi: Add Nord endpoint support Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 10/11] bus: mhi: host: pci_generic: Add support for Qualcomm Nord Krishna Chaitanya Chundru
2026-11-22  2:56 ` [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes Krishna Chaitanya Chundru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox