Skip to content

Commit c94391b

Browse files
Mrinmay Sarkarbjorn-helgaas
authored andcommitted
PCI: qcom-ep: Add HDMA support for SA8775P SoC
SA8775P SoC supports the new Hyper DMA (HDMA) DMA Engine inside the DWC IP, so add support for it by passing the mapping format and the number of read/write channels count. The PCIe EP controller used on this SoC is of version 1.34.0, so a separate config struct is introduced for the sake of enabling HDMA conditionally. It should be noted that for the eDMA support (predecessor of HDMA), there are no mapping format and channels count specified. That is because eDMA supports auto detection of both parameters, whereas HDMA doesn't. [mani: reworded commit message, added kdoc, and minor cleanups] Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Mrinmay Sarkar <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Frank Li <[email protected]> Reviewed-by: Siddharth Vadapalli <[email protected]>
1 parent 0551abf commit c94391b

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

drivers/pci/controller/dwc/pcie-qcom-ep.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ enum qcom_pcie_ep_link_status {
149149
QCOM_PCIE_EP_LINK_DOWN,
150150
};
151151

152+
/**
153+
* struct qcom_pcie_ep_cfg - Per SoC config struct
154+
* @hdma_support: HDMA support on this SoC
155+
*/
156+
struct qcom_pcie_ep_cfg {
157+
bool hdma_support;
158+
};
159+
152160
/**
153161
* struct qcom_pcie_ep - Qualcomm PCIe Endpoint Controller
154162
* @pci: Designware PCIe controller struct
@@ -803,6 +811,7 @@ static const struct dw_pcie_ep_ops pci_ep_ops = {
803811

804812
static int qcom_pcie_ep_probe(struct platform_device *pdev)
805813
{
814+
const struct qcom_pcie_ep_cfg *cfg;
806815
struct device *dev = &pdev->dev;
807816
struct qcom_pcie_ep *pcie_ep;
808817
char *name;
@@ -816,6 +825,14 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev)
816825
pcie_ep->pci.ops = &pci_ops;
817826
pcie_ep->pci.ep.ops = &pci_ep_ops;
818827
pcie_ep->pci.edma.nr_irqs = 1;
828+
829+
cfg = of_device_get_match_data(dev);
830+
if (cfg && cfg->hdma_support) {
831+
pcie_ep->pci.edma.ll_wr_cnt = 8;
832+
pcie_ep->pci.edma.ll_rd_cnt = 8;
833+
pcie_ep->pci.edma.mf = EDMA_MF_HDMA_NATIVE;
834+
}
835+
819836
platform_set_drvdata(pdev, pcie_ep);
820837

821838
ret = qcom_pcie_ep_get_resources(pdev, pcie_ep);
@@ -874,8 +891,12 @@ static void qcom_pcie_ep_remove(struct platform_device *pdev)
874891
qcom_pcie_disable_resources(pcie_ep);
875892
}
876893

894+
static const struct qcom_pcie_ep_cfg cfg_1_34_0 = {
895+
.hdma_support = true,
896+
};
897+
877898
static const struct of_device_id qcom_pcie_ep_match[] = {
878-
{ .compatible = "qcom,sa8775p-pcie-ep", },
899+
{ .compatible = "qcom,sa8775p-pcie-ep", .data = &cfg_1_34_0},
879900
{ .compatible = "qcom,sdx55-pcie-ep", },
880901
{ .compatible = "qcom,sm8450-pcie-ep", },
881902
{ }

0 commit comments

Comments
 (0)