From 702b7249592fe90953900fb5309f0d79f2f202d8 Mon Sep 17 00:00:00 2001 From: Jaejoon Yoo Date: Tue, 10 Jan 2017 19:05:01 +0900 Subject: [PATCH] DMA: Support 36bit address when call getposition function. Change-Id: I542860611c550d25b014e6cb112e64edf94e4e02 Signed-off-by: Jaejoon Yoo --- drivers/dma/pl330.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index b5268355ea94..98e16c4029f2 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -3018,6 +3018,9 @@ int pl330_dma_getposition(struct dma_chan *chan, *src = readl(regs + SA(thrd->id)); *dst = readl(regs + DA(thrd->id)); + *src |= (dma_addr_t)readl(thrd->ar_wrapper) << 32; + *dst |= (dma_addr_t)readl(thrd->aw_wrapper) << 32; + return 0; } EXPORT_SYMBOL(pl330_dma_getposition); @@ -3107,7 +3110,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) int num_chan; struct device_node *np = adev->dev.of_node; +#ifdef CONFIG_ZONE_DMA + ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(32)); +#else ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(36)); +#endif if (ret) return ret; -- 2.20.1