PCI: qcom-ep: Add eDMA support
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Mon, 17 Jul 2023 06:54:55 +0000 (12:24 +0530)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Sat, 26 Aug 2023 16:54:45 +0000 (16:54 +0000)
Qualcomm PCIe Endpoint controllers have the in-built Embedded DMA (eDMA)
peripheral for offloading the data transfer between the PCIe bus and
memory.

Let's add support for it by enabling the eDMA IRQ in the driver. The
eDMA DMA Engine driver will handle the rest of the functionality.

Since the eDMA on Qualcomm platforms only uses a single IRQ for all
channels, use 1 for edma.nr_irqs.

[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20230717065459.14138-4-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
drivers/pci/controller/dwc/pcie-qcom-ep.c

index 736be5bee45849f41c3bea11d6fcaf7ad9fcd2bc..1baec81183b6db627bddb8474f557db6b0c1e7df 100644 (file)
@@ -74,6 +74,7 @@
 #define PARF_INT_ALL_PLS_ERR                   BIT(15)
 #define PARF_INT_ALL_PME_LEGACY                        BIT(16)
 #define PARF_INT_ALL_PLS_PME                   BIT(17)
+#define PARF_INT_ALL_EDMA                      BIT(22)
 
 /* PARF_BDF_TO_SID_CFG register fields */
 #define PARF_BDF_TO_SID_BYPASS                 BIT(0)
@@ -395,7 +396,7 @@ static int qcom_pcie_perst_deassert(struct dw_pcie *pci)
        writel_relaxed(0, pcie_ep->parf + PARF_INT_ALL_MASK);
        val = PARF_INT_ALL_LINK_DOWN | PARF_INT_ALL_BME |
              PARF_INT_ALL_PM_TURNOFF | PARF_INT_ALL_DSTATE_CHANGE |
-             PARF_INT_ALL_LINK_UP;
+             PARF_INT_ALL_LINK_UP | PARF_INT_ALL_EDMA;
        writel_relaxed(val, pcie_ep->parf + PARF_INT_ALL_MASK);
 
        ret = dw_pcie_ep_init_complete(&pcie_ep->pci.ep);
@@ -744,6 +745,7 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev)
        pcie_ep->pci.dev = dev;
        pcie_ep->pci.ops = &pci_ops;
        pcie_ep->pci.ep.ops = &pci_ep_ops;
+       pcie_ep->pci.edma.nr_irqs = 1;
        platform_set_drvdata(pdev, pcie_ep);
 
        ret = qcom_pcie_ep_get_resources(pdev, pcie_ep);