Lines Matching +full:dw +full:- +full:pcie
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2018-2019 Synopsys, Inc. and/or its affiliates.
4 * Synopsys DesignWare eDMA PCIe driver
14 #include <linux/pci-epf.h>
17 #include "dw-edma-core.h"
69 const struct dw_edma_pcie_data *pdata = (void *)pid->driver_data; in dw_edma_pcie_probe()
70 struct device *dev = &pdev->dev; in dw_edma_pcie_probe()
73 struct dw_edma *dw; in dw_edma_pcie_probe() local
83 err = pcim_iomap_regions(pdev, BIT(pdata->rg_bar) | in dw_edma_pcie_probe()
84 BIT(pdata->ll_bar) | in dw_edma_pcie_probe()
85 BIT(pdata->dt_bar), in dw_edma_pcie_probe()
121 return -ENOMEM; in dw_edma_pcie_probe()
123 dw = devm_kzalloc(dev, sizeof(*dw), GFP_KERNEL); in dw_edma_pcie_probe()
124 if (!dw) in dw_edma_pcie_probe()
125 return -ENOMEM; in dw_edma_pcie_probe()
128 nr_irqs = pci_alloc_irq_vectors(pdev, 1, pdata->irqs, in dw_edma_pcie_probe()
133 return -EPERM; in dw_edma_pcie_probe()
137 chip->dw = dw; in dw_edma_pcie_probe()
138 chip->dev = dev; in dw_edma_pcie_probe()
139 chip->id = pdev->devfn; in dw_edma_pcie_probe()
140 chip->irq = pdev->irq; in dw_edma_pcie_probe()
142 dw->rg_region.vaddr = pcim_iomap_table(pdev)[pdata->rg_bar]; in dw_edma_pcie_probe()
143 dw->rg_region.vaddr += pdata->rg_off; in dw_edma_pcie_probe()
144 dw->rg_region.paddr = pdev->resource[pdata->rg_bar].start; in dw_edma_pcie_probe()
145 dw->rg_region.paddr += pdata->rg_off; in dw_edma_pcie_probe()
146 dw->rg_region.sz = pdata->rg_sz; in dw_edma_pcie_probe()
148 dw->ll_region.vaddr = pcim_iomap_table(pdev)[pdata->ll_bar]; in dw_edma_pcie_probe()
149 dw->ll_region.vaddr += pdata->ll_off; in dw_edma_pcie_probe()
150 dw->ll_region.paddr = pdev->resource[pdata->ll_bar].start; in dw_edma_pcie_probe()
151 dw->ll_region.paddr += pdata->ll_off; in dw_edma_pcie_probe()
152 dw->ll_region.sz = pdata->ll_sz; in dw_edma_pcie_probe()
154 dw->dt_region.vaddr = pcim_iomap_table(pdev)[pdata->dt_bar]; in dw_edma_pcie_probe()
155 dw->dt_region.vaddr += pdata->dt_off; in dw_edma_pcie_probe()
156 dw->dt_region.paddr = pdev->resource[pdata->dt_bar].start; in dw_edma_pcie_probe()
157 dw->dt_region.paddr += pdata->dt_off; in dw_edma_pcie_probe()
158 dw->dt_region.sz = pdata->dt_sz; in dw_edma_pcie_probe()
160 dw->version = pdata->version; in dw_edma_pcie_probe()
161 dw->mode = pdata->mode; in dw_edma_pcie_probe()
162 dw->nr_irqs = nr_irqs; in dw_edma_pcie_probe()
163 dw->ops = &dw_edma_pcie_core_ops; in dw_edma_pcie_probe()
166 pci_dbg(pdev, "Version:\t%u\n", dw->version); in dw_edma_pcie_probe()
169 dw->mode == EDMA_MODE_LEGACY ? "Legacy" : "Unroll"); in dw_edma_pcie_probe()
172 pdata->rg_bar, pdata->rg_off, pdata->rg_sz, in dw_edma_pcie_probe()
173 dw->rg_region.vaddr, &dw->rg_region.paddr); in dw_edma_pcie_probe()
176 pdata->ll_bar, pdata->ll_off, pdata->ll_sz, in dw_edma_pcie_probe()
177 dw->ll_region.vaddr, &dw->ll_region.paddr); in dw_edma_pcie_probe()
180 pdata->dt_bar, pdata->dt_off, pdata->dt_sz, in dw_edma_pcie_probe()
181 dw->dt_region.vaddr, &dw->dt_region.paddr); in dw_edma_pcie_probe()
183 pci_dbg(pdev, "Nr. IRQs:\t%u\n", dw->nr_irqs); in dw_edma_pcie_probe()
188 return -EPERM; in dw_edma_pcie_probe()
191 dw->irq = devm_kcalloc(dev, nr_irqs, sizeof(*dw->irq), GFP_KERNEL); in dw_edma_pcie_probe()
192 if (!dw->irq) in dw_edma_pcie_probe()
193 return -ENOMEM; in dw_edma_pcie_probe()
229 .name = "dw-edma-pcie",
238 MODULE_DESCRIPTION("Synopsys DesignWare eDMA PCIe driver");