Lines Matching +full:cbom +full:- +full:block +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0-only
3 * RISC-V specific functions to support DMA for non-coherent devices
8 #include <linux/dma-direct.h>
9 #include <linux/dma-map-ops.h>
12 #include <asm/dma-noncoherent.h>
18 static inline void arch_dma_cache_wback(phys_addr_t paddr, size_t size) in arch_dma_cache_wback() argument
24 noncoherent_cache_ops.wback(paddr, size); in arch_dma_cache_wback()
28 ALT_CMO_OP(CLEAN, vaddr, size, riscv_cbom_block_size); in arch_dma_cache_wback()
31 static inline void arch_dma_cache_inv(phys_addr_t paddr, size_t size) in arch_dma_cache_inv() argument
37 noncoherent_cache_ops.inv(paddr, size); in arch_dma_cache_inv()
42 ALT_CMO_OP(INVAL, vaddr, size, riscv_cbom_block_size); in arch_dma_cache_inv()
45 static inline void arch_dma_cache_wback_inv(phys_addr_t paddr, size_t size) in arch_dma_cache_wback_inv() argument
51 noncoherent_cache_ops.wback_inv(paddr, size); in arch_dma_cache_wback_inv()
56 ALT_CMO_OP(FLUSH, vaddr, size, riscv_cbom_block_size); in arch_dma_cache_wback_inv()
69 void arch_sync_dma_for_device(phys_addr_t paddr, size_t size, in arch_sync_dma_for_device() argument
74 arch_dma_cache_wback(paddr, size); in arch_sync_dma_for_device()
79 arch_dma_cache_inv(paddr, size); in arch_sync_dma_for_device()
88 arch_dma_cache_wback(paddr, size); in arch_sync_dma_for_device()
90 arch_dma_cache_wback_inv(paddr, size); in arch_sync_dma_for_device()
98 void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size, in arch_sync_dma_for_cpu() argument
109 arch_dma_cache_inv(paddr, size); in arch_sync_dma_for_cpu()
117 void arch_dma_prep_coherent(struct page *page, size_t size) in arch_dma_prep_coherent() argument
123 noncoherent_cache_ops.wback_inv(page_to_phys(page), size); in arch_dma_prep_coherent()
128 ALT_CMO_OP(FLUSH, flush_addr, size, riscv_cbom_block_size); in arch_dma_prep_coherent()
131 void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, in arch_setup_dma_ops() argument
136 "%s %s: ARCH_DMA_MINALIGN smaller than riscv,cbom-block-size (%d < %d)", in arch_setup_dma_ops()
141 "%s %s: device non-coherent but no non-coherent operations supported", in arch_setup_dma_ops()
144 dev->dma_coherent = coherent; in arch_setup_dma_ops()
150 "Non-coherent DMA support enabled without a block size\n"); in riscv_noncoherent_supported()