2012-05-16 13:48:21 +00:00
|
|
|
#ifndef ASMARM_DMA_IOMMU_H
|
|
|
|
#define ASMARM_DMA_IOMMU_H
|
|
|
|
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
|
|
|
|
#include <linux/mm_types.h>
|
|
|
|
#include <linux/scatterlist.h>
|
|
|
|
#include <linux/dma-debug.h>
|
|
|
|
#include <linux/kmemcheck.h>
|
2012-12-16 12:32:03 +00:00
|
|
|
#include <linux/kref.h>
|
2012-05-16 13:48:21 +00:00
|
|
|
|
|
|
|
struct dma_iommu_mapping {
|
|
|
|
/* iommu specific data */
|
|
|
|
struct iommu_domain *domain;
|
|
|
|
|
2014-02-25 12:09:53 +00:00
|
|
|
unsigned long **bitmaps; /* array of bitmaps */
|
|
|
|
unsigned int nr_bitmaps; /* nr of elements in array */
|
|
|
|
unsigned int extensions;
|
|
|
|
size_t bitmap_size; /* size of a single bitmap */
|
|
|
|
size_t bits; /* per bitmap */
|
2012-05-16 13:48:21 +00:00
|
|
|
dma_addr_t base;
|
|
|
|
|
|
|
|
spinlock_t lock;
|
|
|
|
struct kref kref;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dma_iommu_mapping *
|
2015-04-29 10:29:19 +00:00
|
|
|
arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size);
|
2012-05-16 13:48:21 +00:00
|
|
|
|
|
|
|
void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping);
|
|
|
|
|
|
|
|
int arm_iommu_attach_device(struct device *dev,
|
|
|
|
struct dma_iommu_mapping *mapping);
|
2013-01-24 13:16:57 +00:00
|
|
|
void arm_iommu_detach_device(struct device *dev);
|
2012-05-16 13:48:21 +00:00
|
|
|
|
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
#endif
|