DMA: Support 36bit address when call getposition function.
authorJaejoon Yoo <joonyj7.yoo@samsung.com>
Tue, 10 Jan 2017 10:05:01 +0000 (19:05 +0900)
committerTaekki Kim <taekki.kim@samsung.com>
Mon, 14 May 2018 05:42:47 +0000 (14:42 +0900)
Change-Id: I542860611c550d25b014e6cb112e64edf94e4e02
Signed-off-by: Jaejoon Yoo <joonyj7.yoo@samsung.com>
drivers/dma/pl330.c

index b5268355ea9420534753bb991e9d032e23adbef1..98e16c4029f21f03118711d340216536a4e9e472 100644 (file)
@@ -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;