aboutsummaryrefslogtreecommitdiffstats
path: root/arch/nds32/kernel/dma.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-11-20dma-mapping: drop the dev argument to arch_sync_dma_for_*Christoph Hellwig1-4/+4
These are pure cache maintainance routines, so drop the unused struct device argument. Signed-off-by: Christoph Hellwig <hch@lst.de> Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2019-08-29dma-mapping: make dma_atomic_pool_init self-containedChristoph Hellwig1-6/+0
The memory allocated for the atomic pool needs to have the same mapping attributes that we use for remapping, so use pgprot_dmacoherent instead of open coding it. Also deduct a suitable zone to allocate the memory from based on the presence of the DMA zones. Signed-off-by: Christoph Hellwig <hch@lst.de>
2019-06-25nds32: use the generic remapping allocator for coherent DMA allocationsChristoph Hellwig1-314/+11
Replace the code that sets up uncached PTEs with the generic vmap based remapping code. It also provides an atomic pool for allocations from non-blocking context, which we not properly supported by the existing nds32 code. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Greentime Hu <greentime@andestech.com> Reviewed-by: Greentime Hu <greentime@andestech.com>
2018-05-29nds32: use generic dma_noncoherent_opsChristoph Hellwig1-102/+11
Switch to the generic noncoherent direct mapping implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Greentime Hu <greentime@andestech.com> Tested-by: Greentime Hu <greentime@andestech.com>
2018-05-29nds32: implement the unmap_sg DMA operationChristoph Hellwig1-0/+6
This matches the implementation of the more commonly used unmap_single routines and the sync_sg_for_cpu method which should provide equivalent cache maintainance. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Greentime Hu <greentime@andestech.com> Tested-by: Greentime Hu <greentime@andestech.com>
2018-05-29nds32: consolidate DMA cache maintainance routinesChristoph Hellwig1-94/+93
Make sure all other DMA methods call nds32_dma_sync_single_for_{device,cpu} to perform cache maintaince, and remove the consisteny_sync helper that implemented both with entirely separate code based off an argument. Also make sure these helpers handled highmem properly, for which code is copy and pasted from mips. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Greentime Hu <greentime@andestech.com> Tested-by: Greentime Hu <greentime@andestech.com>
2018-02-22nds32: DMA mapping APIGreentime Hu1-0/+477
This patch adds support for the DMA mapping API. It uses dma_map_ops for flexibility. Signed-off-by: Vincent Chen <vincentc@andestech.com> Signed-off-by: Greentime Hu <greentime@andestech.com> Acked-by: Arnd Bergmann <arnd@arndb.de>