aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/soc/fsl/qbman/qman_portal.c
diff options
context:
space:
mode:
authorClaudiu Manoil <claudiu.manoil@nxp.com>2016-11-16 16:40:21 +0200
committerScott Wood <oss@buserror.net>2016-11-23 01:23:44 -0600
commit0fbeac3b0f67a50d45e8a7d72ee3e0301ac7e9a9 (patch)
treed95578e2ba5a3a03bf8d84a0366e87392e3165cd /drivers/soc/fsl/qbman/qman_portal.c
parentsoc/qman: test: Fix implementation of fd_cmp() (diff)
downloadlinux-dev-0fbeac3b0f67a50d45e8a7d72ee3e0301ac7e9a9.tar.xz
linux-dev-0fbeac3b0f67a50d45e8a7d72ee3e0301ac7e9a9.zip
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.c11
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;