Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1ae659b authored by Laura Abbott's avatar Laura Abbott Committed by Liam Mark
Browse files

arm64: Add dma mapping APIs for other memory types



Users of dma on arm may call dma_*_writecombine and dma_*_nonconsistent.
Add these functions for arm64 as well.

Change-Id: I983043f34e6fe01defc1901e036cf1c17f985bda
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent dbb06ec2
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -802,6 +802,29 @@ static inline int dma_mmap_wc(struct device *dev,
#define dma_mmap_writecombine dma_mmap_wc
#endif

static inline void *dma_alloc_nonconsistent(struct device *dev, size_t size,
					dma_addr_t *dma_handle, gfp_t flag)
{
	unsigned long attrs = DMA_ATTR_NON_CONSISTENT;

	return dma_alloc_attrs(dev, size, dma_handle, flag, attrs);
}

static inline void dma_free_nonconsistent(struct device *dev, size_t size,
					void *cpu_addr, dma_addr_t dma_handle)
{
	unsigned long attrs = DMA_ATTR_NON_CONSISTENT;

	return dma_free_attrs(dev, size, cpu_addr, dma_handle, attrs);
}

static inline int dma_mmap_nonconsistent(struct device *dev,
		struct vm_area_struct *vma, void *cpu_addr,
		dma_addr_t dma_addr, size_t size)
{
	return -ENODEV;
}

#if defined(CONFIG_NEED_DMA_MAP_STATE) || defined(CONFIG_DMA_API_DEBUG)
#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)        dma_addr_t ADDR_NAME
#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)          __u32 LEN_NAME