diff options
author | Claudiu Manoil <claudiu.manoil@nxp.com> | 2016-11-16 16:40:21 +0200 |
---|---|---|
committer | Scott Wood <oss@buserror.net> | 2016-11-23 01:23:44 -0600 |
commit | 0fbeac3b0f67a50d45e8a7d72ee3e0301ac7e9a9 (patch) | |
tree | d95578e2ba5a3a03bf8d84a0366e87392e3165cd /drivers/soc/fsl/qbman/qman_portal.c | |
parent | 57e68a5e23570ff3ab76772a974724c226fcee7d (diff) | |
download | linux-0fbeac3b0f67a50d45e8a7d72ee3e0301ac7e9a9.tar.bz2 |
soc/qman: Don't add a new platform device for dma mapping
The qman portals are platform devices themselves, so they should
handle dma mappings. Creating a dummy platform device in order to
support dma mapping operations is not justified (and not portable).
Instead, do the mapping against the first portal that has been
initialised.
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Scott Wood <oss@buserror.net>
Diffstat (limited to 'drivers/soc/fsl/qbman/qman_portal.c')
-rw-r--r-- | drivers/soc/fsl/qbman/qman_portal.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c index 6651168333e1..e6da2ea78554 100644 --- a/drivers/soc/fsl/qbman/qman_portal.c +++ b/drivers/soc/fsl/qbman/qman_portal.c @@ -30,6 +30,8 @@ #include "qman_priv.h" +struct qman_portal *qman_dma_portal; + /* Enable portal interupts (as opposed to polling mode) */ #define CONFIG_FSL_DPA_PIRQ_SLOW 1 #define CONFIG_FSL_DPA_PIRQ_FAST 1 @@ -150,6 +152,10 @@ static struct qman_portal *init_pcfg(struct qm_portal_config *pcfg) /* all assigned portals are initialized now */ qman_init_cgr_all(); } + + if (!qman_dma_portal) + qman_dma_portal = p; + spin_unlock(&qman_lock); dev_info(pcfg->dev, "Portal initialised, cpu %d\n", pcfg->cpu); @@ -310,6 +316,11 @@ static int qman_portal_probe(struct platform_device *pdev) spin_unlock(&qman_lock); pcfg->cpu = cpu; + if (dma_set_mask(dev, DMA_BIT_MASK(40))) { + dev_err(dev, "dma_set_mask() failed\n"); + goto err_portal_init; + } + if (!init_pcfg(pcfg)) { dev_err(dev, "portal init failed\n"); goto err_portal_init; |