* [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-22 3:03 ` sashiko-bot
2026-11-22 2:56 ` [PATCH 02/11] PCI: qcom-ep: Add MSI-X support Krishna Chaitanya Chundru
` (10 subsequent siblings)
11 siblings, 1 reply; 19+ 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] 19+ 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-22 3:03 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-22 3:03 UTC (permalink / raw)
To: Krishna Chaitanya Chundru
Cc: linux-pci, devicetree, linux-phy, robh, conor+dt, vkoul,
neil.armstrong, olteanv
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] PCI: epf-mhi: wrong Fixes tag and attribution for
pci_epc_set_msi() bug
--
commit 65569d8fa7d0b7d1c73f3c6a6921db637279c429
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
> PCI: epf-mhi: Pass the actual number of MSI vectors to pci_epc_set_msi()
>
> 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>
[Severity: Low]
Prior to commit f62da6e7270c ("PCI: endpoint: Align pci_epc_set_msi(),
pci_epc_ops::set_msi() nr_irqs encoding"), pci_epc_set_msi() already
took the unencoded number of interrupts (1..32) and called
order_base_2() internally before invoking epc->ops->set_msi(); that
commit only moved the order_base_2() call into the controller drivers.
The double order_base_2() encoding in pci_epf_mhi_epc_init() has been
present since the driver was added, and pointing Fixes: at f62da6e7270c
("PCI: endpoint: Align pci_epc_set_msi(), pci_epc_ops::set_msi() nr_irqs
encoding") (which is marked stable+noautosel) prevents older stable
trees from picking up this fix. Should the commit message and Fixes:
tag instead reference the commit that introduced the driver:
Fixes: 1bf5f25324f7 ("PCI: endpoint: Add PCI Endpoint function driver for MHI bus")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com?part=1
^ permalink raw reply [flat|nested] 19+ 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 3:08 ` sashiko-bot
2026-11-22 2:56 ` [PATCH 03/11] PCI: epf-mhi: " Krishna Chaitanya Chundru
` (9 subsequent siblings)
11 siblings, 1 reply; 19+ 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] 19+ messages in thread* Re: [PATCH 02/11] PCI: qcom-ep: Add MSI-X support
2026-11-22 2:56 ` [PATCH 02/11] PCI: qcom-ep: Add MSI-X support Krishna Chaitanya Chundru
@ 2026-11-22 3:08 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-22 3:08 UTC (permalink / raw)
To: Krishna Chaitanya Chundru
Cc: linux-pci, devicetree, linux-phy, robh, conor+dt, vkoul,
neil.armstrong, olteanv
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] PCI: qcom-ep: modpost error on unexported
dw_pcie_ep_raise_msix_irq_doorbell()
--
commit 2d6d23ea15c7e7d49381c678551e49590d53c5b3
Author: Anvita T <anvita.t@oss.qualcomm.com>
PCI: qcom-ep: Add MSI-X support
This commit adds MSI-X support to the Qualcomm PCIe Endpoint driver by
introducing an msix_capable SoC config flag and routing PCI_IRQ_MSIX
requests to dw_pcie_ep_raise_msix_irq_doorbell().
> diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
> index abbf6b738c380..335207de8f0cc 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
[ ... ]
> @@ -807,6 +809,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;
[Severity: High]
Does building with CONFIG_PCIE_QCOM_EP=m fail at modpost with an undefined
reference to dw_pcie_ep_raise_msix_irq_doorbell()?
CONFIG_PCIE_QCOM_EP is tristate and selects the bool symbol
CONFIG_PCIE_DW_EP, but unlike dw_pcie_ep_raise_intx_irq() and
dw_pcie_ep_raise_msi_irq(), dw_pcie_ep_raise_msix_irq_doorbell() in
drivers/pci/controller/dwc/pcie-designware-ep.c lacks EXPORT_SYMBOL_GPL().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com?part=2
^ permalink raw reply [flat|nested] 19+ 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 3:15 ` sashiko-bot
2026-11-22 2:56 ` [PATCH 04/11] PCI: dwc: Preserve glue-provided eDMA HDMA channel separation Krishna Chaitanya Chundru
` (8 subsequent siblings)
11 siblings, 1 reply; 19+ 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] 19+ messages in thread* Re: [PATCH 03/11] PCI: epf-mhi: Add MSI-X support
2026-11-22 2:56 ` [PATCH 03/11] PCI: epf-mhi: " Krishna Chaitanya Chundru
@ 2026-11-22 3:15 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-22 3:15 UTC (permalink / raw)
To: Krishna Chaitanya Chundru
Cc: linux-pci, devicetree, linux-phy, robh, conor+dt, vkoul,
neil.armstrong, olteanv
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] PCI: epf-mhi: msix_bar and epf_bar collide on BAR_0 in
pci_epf_mhi_epc_init()
- [Medium] PCI: epf-mhi: stale msix_phys retained across unbind in
pci_epf_mhi_bind()
- [Medium] PCI: epf-mhi: unguarded pci_epc_get_msix() in
pci_epf_mhi_raise_irq()
--
commit ff5df916c7bb4879ef75224bb4a16f16be1ead17
Author: Anvita T <anvita.t@oss.qualcomm.com>
PCI: epf-mhi: Add MSI-X support
This commit adds MSI-X support to the MHI PCI endpoint function driver by
configuring BAR_0 from an optional "msix" platform memory resource and
selecting PCI_IRQ_MSIX when MSI-X is enabled.
> diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
> index 52cfffcfd5ca0..a8765beffe060 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
[ ... ]
> @@ -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);
> }
[Severity: Medium]
Should pci_epf_mhi_raise_irq() check epf_mhi->epc_features->msix_capable
before calling pci_epc_get_msix()?
Without that check, every MHI interrupt acquires epc->lock an extra time
(contending with pci_epc_map_addr() and pci_epc_unmap_addr() in the data
path) and calls epc->ops->get_msix(), which on DesignWare controllers
walks ep->func_list and reads PCI_MSIX_FLAGS over DBI MMIO even when
msix_capable is false.
> @@ -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;
[Severity: High]
Does msix_bar collide with epf_bar on BAR_0 when info->bar_num is BAR_0?
All existing pci_epf_mhi_ep_info configurations (sdx55_info, sm8450_info,
and sa8775p_info) set .bar_num = BAR_0. When bound to an MSI-X capable
controller, msix_bar and epf_bar point to the same epf->bar[BAR_0] entry:
pci_epf_mhi_epc_init() sets BAR_0 for MSI-X and points the MSI-X table at
BAR_0, then overwrites epf->bar[BAR_0] in place with mmio_phys and
mmio_size and calls pci_epc_set_bar() on BAR_0 a second time.
Because epf->bar[BAR_0] is mutated in place before the second call,
dw_pcie_ep_set_bar() compares the overwritten size against itself, tears
down the MSI-X inbound iATU mapping on BAR_0, skips updating the BAR mask
register (leaving BAR_0 sized to msix_size), and remaps BAR_0 to
mmio_phys while PCI_MSIX_TABLE still points at BAR_0. In addition,
pci_epf_mhi_epc_deinit() and pci_epf_mhi_unbind() call
pci_epc_clear_bar() twice on &epf->bar[BAR_0].
[ ... ]
> @@ -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);
[Severity: Medium]
Can epf_mhi->msix_phys and epf_mhi->msix_size retain stale values across
an unbind and rebind?
struct pci_epf_mhi is allocated in pci_epf_mhi_probe() and reused across
binds, and neither pci_epf_mhi_unbind() nor the !res path here clears
msix_phys or msix_size. If the function is unbound from an EPC with an
"msix" resource and rebound to an MSI-X capable EPC where "msix" is
missing, pci_epf_mhi_epc_init() will see the previous controller's
non-zero msix_phys and program BAR_0 with the stale physical address.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com?part=3
^ permalink raw reply [flat|nested] 19+ 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
` (7 subsequent siblings)
11 siblings, 0 replies; 19+ 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] 19+ 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
` (6 subsequent siblings)
11 siblings, 0 replies; 19+ 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] 19+ 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
` (5 subsequent siblings)
11 siblings, 0 replies; 19+ 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] 19+ 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
` (4 subsequent siblings)
11 siblings, 0 replies; 19+ 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] 19+ 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 3:08 ` sashiko-bot
2026-11-22 2:56 ` [PATCH 09/11] PCI: epf-mhi: Add Nord endpoint support Krishna Chaitanya Chundru
` (3 subsequent siblings)
11 siblings, 1 reply; 19+ 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] 19+ messages in thread* Re: [PATCH 08/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support
2026-11-22 2:56 ` [PATCH 08/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support Krishna Chaitanya Chundru
@ 2026-11-22 3:08 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-22 3:08 UTC (permalink / raw)
To: Krishna Chaitanya Chundru
Cc: linux-pci, devicetree, linux-phy, robh, conor+dt, vkoul,
neil.armstrong, olteanv
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] PCI: qcom-ep: unconditional msix_capable in cfg_nord breaks
7-reg instances
--
commit 04b8653283bc8abe57f3e64a544c24c1195d37c3
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
PCI: qcom-ep: Add Nord PCIe Endpoint controller support
This commit adds the qcom,nord-pcie-ep compatible and cfg_nord configuration
for the Nord PCIe Endpoint controller, including per-channel HDMA register
spacing via ch_space_sz.
> diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
> index 335207de8f0cc..79acedb301974 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
[ ... ]
> @@ -985,7 +989,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,
> +};
[Severity: High]
Does setting .msix_capable = true unconditionally in cfg_nord break the
Nord PCIe endpoint instances that do not support MSI-X?
Per Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml,
qcom,nord-pcie-ep nodes allow 7 or 8 reg entries because only one Nord
controller instance provides the 8th "msix" register region, while the
other three instances have 7 reg entries and no MSI-X support. Because
qcom_pcie_epc_get_features() reports epc_features->msix_capable = true
solely from pcie_ep->cfg->msix_capable, binding pci-epf-mhi to any of the
7-reg instances leaves epf_mhi->msix_phys as 0 and causes
pci_epf_mhi_epc_init() to fail with -EINVAL ("MSI-X BAR address not
configured in DT") instead of falling back to MSI.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com?part=8
^ permalink raw reply [flat|nested] 19+ 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
` (2 subsequent siblings)
11 siblings, 0 replies; 19+ 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] 19+ 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 3:19 ` sashiko-bot
2026-11-22 2:56 ` [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes Krishna Chaitanya Chundru
2026-11-22 3:19 ` [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support sashiko-bot
11 siblings, 1 reply; 19+ 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] 19+ messages in thread* Re: [PATCH 10/11] bus: mhi: host: pci_generic: Add support for Qualcomm Nord
2026-11-22 2:56 ` [PATCH 10/11] bus: mhi: host: pci_generic: Add support for Qualcomm Nord Krishna Chaitanya Chundru
@ 2026-11-22 3:19 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-22 3:19 UTC (permalink / raw)
To: Krishna Chaitanya Chundru
Cc: linux-pci, devicetree, linux-phy, robh, conor+dt, vkoul,
neil.armstrong, olteanv
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] bus: mhi: host: pci_generic: 0x0120 wildcard class matches
QCOM Root Port
- [Low] bus: mhi: host: pci_generic: unsorted PID 0x0120 entry in
mhi_pci_id_table
--
commit bf997d1ac5e3f263dea66560b3e85c9fdd9703e3
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
bus: mhi: host: pci_generic: Add support for Qualcomm Nord
This commit adds an MHI PCI device entry for the Qualcomm Nord endpoint
(device ID 0x0120), reusing the sa8775p MHI controller configuration.
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index ca9ef4aaa0140..65201ec8dc76c 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
[ ... ]
> @@ -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 },
[Severity: Medium]
Does this match 17cb:0120 PCIe Root Ports in addition to the Nord MHI
endpoint?
Device ID 0x0120 is also used by Qualcomm Root Ports:
drivers/pci/quirks.c:pci_dev_acs_enabled() {
...
/* QCOM Glymur root port */
{ PCI_VENDOR_ID_QCOM, 0x0120, pci_quirk_qcom_rp_acs },
...
}
Because PCI_DEVICE() leaves .class and .class_mask at 0, udev autoloads
mhi_pci_generic for 17cb:0120 Root Ports, and if pcieport is not bound
(for example with CONFIG_PCIEPORTBUS=n or pcie_ports=compat),
mhi_pci_probe() binds to the Root Port bridge and tries to map BAR 1 as
MHI registers. Should this entry restrict .class and .class_mask to
match nord_header's PCI_CLASS_OTHERS?
[Severity: Low]
This isn't a bug, but the comment above mhi_pci_id_table asks to keep the
entries sorted by PID, so 0x0120 should go after the 0x011a entries.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com?part=10
^ permalink raw reply [flat|nested] 19+ 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
2026-11-22 3:17 ` sashiko-bot
2026-11-22 3:19 ` [PATCH 00/11] PCI: qcom-ep: Add Nord PCIe Endpoint controller support sashiko-bot
11 siblings, 1 reply; 19+ 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] 19+ messages in thread* Re: [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes
2026-11-22 2:56 ` [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes Krishna Chaitanya Chundru
@ 2026-11-22 3:17 ` sashiko-bot
0 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-22 3:17 UTC (permalink / raw)
To: Krishna Chaitanya Chundru
Cc: linux-pci, devicetree, linux-phy, robh, conor+dt, vkoul,
neil.armstrong, olteanv
Thank you for your contribution! Sashiko AI review found 6 potential
issues to consider:
- [High] arm64: dts: qcom: nord: overlapping atu and msix reg regions in
pcie0_ep
- [High] arm64: dts: qcom: nord: non-power-of-2 msix BAR size in
pcie0_ep
- [High] arm64: dts: qcom: nord: missing msix reg region in
pcie1_ep..pcie3_ep
- [Medium] arm64: dts: qcom: nord: missing num-lanes = <8> property in
pcie0_ep
- [Medium] arm64: dts: qcom: nord: 1 MB addr_space reg size in
pcie1_ep..pcie3_ep
- [Low] arm64: dts: qcom: nord: missing gpio.h include in
nord-embedded.dtsi
--
commit 2599e7213b15292427fa12c65b538dbb750cb433
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
arm64: dts: qcom: nord: Add PCIe endpoint nodes
This commit adds the pcie0_ep..pcie3_ep endpoint controller nodes and
their pin control states for the four PCIe instances on Nord.
> diff --git a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> index e6d0bd21744e2..829fc63681c1d 100644
> --- a/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> +++ b/arch/arm64/boot/dts/qcom/nord-embedded.dtsi
> @@ -1638,6 +1638,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>,
[Severity: High]
Should the atu region size in pcie0_ep be 0x00010000 (like
pcie1_ep..pcie3_ep) instead of 0x00020000?
With a size of 0x00020000, the atu region spans 0x40010000..0x4002ffff and
overlaps the msix region at 0x40020000..0x400213ff.
dw_pcie_get_resources() claims the full range in iomem_resource via
devm_ioremap_resource() and sets pci->atu_size = 0x20000, which causes
dw_pcie_iatu_detect() to probe unrolled iATU indices 128..255 at
0x40020000..0x4002ffff and write test patterns (0x11110000) into the MSI-X
BAR memory space.
> + <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";
[Severity: High]
Does the 0x00001400 msix region size cause pci_epc_set_bar() to fail with
-EINVAL?
pci_epf_mhi_bind() records resource_size(res) of the "msix" resource as
epf_mhi->msix_size, and pci_epf_mhi_epc_init() passes that directly as
msix_bar->size to pci_epc_set_bar(), which requires a power-of-2 BAR size:
drivers/pci/endpoint/pci-epc-core.c:pci_epc_set_bar() {
...
if (!is_power_of_2(epf_bar->size))
return -EINVAL;
...
}
[ ... ]
> + phys = <&pcie_phy 0>;
> + phy-names = "pciephy";
> +
> + reset-gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
> + wake-gpios = <&tlmm 0 GPIO_ACTIVE_LOW>;
[Severity: Low]
These nodes introduce the first uses of GPIO_ACTIVE_LOW in
nord-embedded.dtsi, but neither nord-embedded.dtsi nor nord.dtsi includes
<dt-bindings/gpio/gpio.h>. Should nord-embedded.dtsi include
<dt-bindings/gpio/gpio.h> directly so it does not depend on inclusion order
in board .dts files?
> +
> + pinctrl-0 = <&pcie0_ep_default>;
> + pinctrl-names = "default";
> +
> + linux,pci-domain = <0>;
> +
> + status = "disabled";
> + };
[Severity: Medium]
Is pcie0_ep missing num-lanes = <8>?
On Nord, pcie0 in nord.dtsi is the 8-lane port of the quadfurcated PHY and
specifies num-lanes = <8>, while pcie1_ep..pcie3_ep below specify
num-lanes = <4>, <2>, and <2>. Without num-lanes on pcie0_ep,
dw_pcie_get_resources() leaves pci->num_lanes as 0 and
dw_pcie_link_set_max_link_width() skips programming PORT_LINK_CTRL,
LINK_WIDTH_SPEED_CTRL, and PCI_EXP_LNKCAP_MLW.
> +
> + 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>,
[Severity: Medium]
Should the addr_space size in pcie1_ep, pcie2_ep, and pcie3_ep be
0x0ff00000 (255 MB, matching pcie0_ep and the full outbound slave window in
nord.dtsi) instead of 0x00100000 (1 MB)?
dw_pcie_ep_init() passes the addr_space size to pci_epc_mem_init() as the
total outbound address pool, so a 1 MB size limits outbound iATU mappings on
pcie1_ep..pcie3_ep to 1020 KB after reserving ep->msi_mem.
> + <0x00 0x01b8c000 0x00 0x00001000>,
> + <0x00 0x50030000 0x00 0x00010000>;
> + reg-names = "parf",
> + "dbi",
> + "elbi",
> + "atu",
> + "addr_space",
> + "mmio",
> + "dma";
[Severity: High]
Does omitting the "msix" reg entry on pcie1_ep, pcie2_ep, and pcie3_ep
cause pci_epf_mhi_epc_init() to fail with -EINVAL on those instances?
In drivers/pci/controller/dwc/pcie-qcom-ep.c, "qcom,nord-pcie-ep" maps to
cfg_nord with .msix_capable = true, and qcom_pcie_epc_get_features()
unconditionally reports msix_capable = true without checking whether an
"msix" resource exists. When pci_epf_mhi is bound to pcie1_ep..pcie3_ep,
epf_mhi->msix_phys is 0 and pci_epf_mhi_epc_init() fails on PERST#
deassertion:
drivers/pci/endpoint/functions/pci-epf-mhi.c:pci_epf_mhi_epc_init() {
...
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;
}
...
}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com?part=11
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/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
` (10 preceding siblings ...)
2026-11-22 2:56 ` [PATCH 11/11] arm64: dts: qcom: nord: Add PCIe endpoint nodes Krishna Chaitanya Chundru
@ 2026-11-22 3:19 ` sashiko-bot
11 siblings, 0 replies; 19+ messages in thread
From: sashiko-bot @ 2026-11-22 3:19 UTC (permalink / raw)
To: Krishna Chaitanya Chundru; +Cc: linux-pci
Sashiko has finished reviewing this 11-patch series:
- Patches 4-7 and 9: no issues found.
- Patch 1 ("PCI: epf-mhi: Pass the actual number of MSI vectors..."): 1
potential issue (1 Low)
- Patch 2 ("PCI: qcom-ep: Add MSI-X support"): 1 potential issue (1
High)
- Patch 3 ("PCI: epf-mhi: Add MSI-X support"): 3 potential issues (1
High, 2 Medium)
- Patch 8 ("PCI: qcom-ep: Add Nord PCIe Endpoint controller support"): 1
potential issue (1 High)
- Patch 10 ("bus: mhi: host: pci_generic: Add support for Qualcom..."):
2 potential issues (1 Medium, 1 Low)
- Patch 11 ("arm64: dts: qcom: nord: Add PCIe endpoint nodes"): 6
potential issues (3 High, 2 Medium, 1 Low)
Detailed reviews have been sent as separate replies to patches 1-3, 8,
10, and 11.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261122-nord_ep-v1-0-6d8839ffa9aa@oss.qualcomm.com
^ permalink raw reply [flat|nested] 19+ messages in thread