summaryrefslogtreecommitdiffstats
path: root/arch/csky/mm/dma-mapping.c
AgeCommit message (Collapse)AuthorFilesLines
2019-08-06csky: Optimize arch_sync_dma_for_cpu/device with dma_inv_rangeGuo Ren1-3/+2
DMA_FROM_DEVICE only need to read dma data of memory into CPU cache, so there is no need to clear cache before. Also clear + inv for DMA_FROM_DEVICE won't cause problem, because the memory range for dma won't be touched by software during dma working. Changes for V2: - Remove clr cache and ignore the DMA_TO_DEVICE in _for_cpu. - Change inv to wbinv cache with DMA_FROM_DEVICE in _for_device. Signed-off-by: Guo Ren <ren_guo@c-sky.com> Cc: Arnd Bergmann <arnd@arndb.de>
2019-08-06csky/dma: Fixup cache_op failed when cross memory ZONEsGuo Ren1-45/+26
If the paddr and size are cross between NORMAL_ZONE and HIGHMEM_ZONE memory range, cache_op will panic in do_page_fault with bad_area. Optimize the code to support the range which cross memory ZONEs. Changes for V2: - Revert back to postcore_initcall Signed-off-by: Guo Ren <ren_guo@c-sky.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Arnd Bergmann <arnd@arndb.de>
2018-12-01csky: use the generic remapping dma alloc implementationChristoph Hellwig1-140/+2
The csky code was largely copied from arm/arm64, so switch to the generic arm64-based implementation instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Guo Ren <ren_guo@c-sky.com>
2018-12-01csky: don't use GFP_DMA in atomic_pool_initChristoph Hellwig1-1/+1
csky does not implement ZONE_DMA, which means passing GFP_DMA is a no-op. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Guo Ren <ren_guo@c-sky.com>
2018-10-25csky: MMU and page table managementGuo Ren1-0/+254
This patch adds files related to memory management and here is our memory-layout: Fixmap : 0xffc02000 – 0xfffff000 (4 MB - 12KB) Pkmap : 0xff800000 – 0xffc00000 (4 MB) Vmalloc : 0xf0200000 – 0xff000000 (238 MB) Lowmem : 0x80000000 – 0xc0000000 (1GB) abiv1 CPU (CK610) is VIPT cache and it doesn't support highmem. abiv2 CPUs are all PIPT cache and they could support highmem. Lowmem is directly mapped by msa0 & msa1 reg, and we needn't setup memory page table for it. Link:https://lore.kernel.org/lkml/20180518215548.GH17671@n2100.armlinux.org.uk/ Signed-off-by: Guo Ren <ren_guo@c-sky.com> Cc: Christoph Hellwig <hch@infradead.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de>