mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 21:35:39 +07:00
faef87723a
The MIPS bmips platform needs a global flush when transferring ownership back to the CPU. Add a hook for that to the dma-noncoherent implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Patchwork: https://patchwork.linux-mips.org/patch/19549/ Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: David Daney <david.daney@cavium.com> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Tom Bogendoerfer <tsbogend@alpha.franken.de> Cc: Huacai Chen <chenhc@lemote.com> Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org
56 lines
1.7 KiB
C
56 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_DMA_NONCOHERENT_H
|
|
#define _LINUX_DMA_NONCOHERENT_H 1
|
|
|
|
#include <linux/dma-mapping.h>
|
|
|
|
void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
|
|
gfp_t gfp, unsigned long attrs);
|
|
void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
|
|
dma_addr_t dma_addr, unsigned long attrs);
|
|
|
|
#ifdef CONFIG_DMA_NONCOHERENT_MMAP
|
|
int arch_dma_mmap(struct device *dev, struct vm_area_struct *vma,
|
|
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
|
unsigned long attrs);
|
|
#else
|
|
#define arch_dma_mmap NULL
|
|
#endif /* CONFIG_DMA_NONCOHERENT_MMAP */
|
|
|
|
#ifdef CONFIG_DMA_NONCOHERENT_CACHE_SYNC
|
|
void arch_dma_cache_sync(struct device *dev, void *vaddr, size_t size,
|
|
enum dma_data_direction direction);
|
|
#else
|
|
#define arch_dma_cache_sync NULL
|
|
#endif /* CONFIG_DMA_NONCOHERENT_CACHE_SYNC */
|
|
|
|
#ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE
|
|
void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
|
|
size_t size, enum dma_data_direction dir);
|
|
#else
|
|
static inline void arch_sync_dma_for_device(struct device *dev,
|
|
phys_addr_t paddr, size_t size, enum dma_data_direction dir)
|
|
{
|
|
}
|
|
#endif /* ARCH_HAS_SYNC_DMA_FOR_DEVICE */
|
|
|
|
#ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU
|
|
void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
|
|
size_t size, enum dma_data_direction dir);
|
|
#else
|
|
static inline void arch_sync_dma_for_cpu(struct device *dev,
|
|
phys_addr_t paddr, size_t size, enum dma_data_direction dir)
|
|
{
|
|
}
|
|
#endif /* ARCH_HAS_SYNC_DMA_FOR_CPU */
|
|
|
|
#ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
|
|
void arch_sync_dma_for_cpu_all(struct device *dev);
|
|
#else
|
|
static inline void arch_sync_dma_for_cpu_all(struct device *dev)
|
|
{
|
|
}
|
|
#endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */
|
|
|
|
#endif /* _LINUX_DMA_NONCOHERENT_H */
|