Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
iovmm.h File Reference
#include <linux/iommu.h>

Go to the source code of this file.

Data Structures

struct  iovm_struct
 

Macros

#define IOVMF_SW_SHIFT   16
 
#define IOVMF_CAM_MASK   (~((1 << 10) - 1))
 
#define IOVMF_RAM_MASK   (~IOVMF_CAM_MASK)
 
#define IOVMF_PGSZ_MASK   (3 << 0)
 
#define IOVMF_PGSZ_1M   MMU_CAM_PGSZ_1M
 
#define IOVMF_PGSZ_64K   MMU_CAM_PGSZ_64K
 
#define IOVMF_PGSZ_4K   MMU_CAM_PGSZ_4K
 
#define IOVMF_PGSZ_16M   MMU_CAM_PGSZ_16M
 
#define IOVMF_ENDIAN_MASK   (1 << 9)
 
#define IOVMF_ENDIAN_BIG   MMU_RAM_ENDIAN_BIG
 
#define IOVMF_ENDIAN_LITTLE   MMU_RAM_ENDIAN_LITTLE
 
#define IOVMF_ELSZ_MASK   (3 << 7)
 
#define IOVMF_ELSZ_8   MMU_RAM_ELSZ_8
 
#define IOVMF_ELSZ_16   MMU_RAM_ELSZ_16
 
#define IOVMF_ELSZ_32   MMU_RAM_ELSZ_32
 
#define IOVMF_ELSZ_NONE   MMU_RAM_ELSZ_NONE
 
#define IOVMF_MIXED_MASK   (1 << 6)
 
#define IOVMF_MIXED   MMU_RAM_MIXED
 
#define IOVMF_MMIO   (1 << IOVMF_SW_SHIFT)
 
#define IOVMF_ALLOC   (2 << IOVMF_SW_SHIFT)
 
#define IOVMF_ALLOC_MASK   (3 << IOVMF_SW_SHIFT)
 
#define IOVMF_DISCONT   (1 << (2 + IOVMF_SW_SHIFT))
 
#define IOVMF_LINEAR   (2 << (2 + IOVMF_SW_SHIFT))
 
#define IOVMF_LINEAR_MASK   (3 << (2 + IOVMF_SW_SHIFT))
 
#define IOVMF_DA_FIXED   (1 << (4 + IOVMF_SW_SHIFT))
 

Functions

struct iovm_structomap_find_iovm_area (struct device *dev, u32 da)
 
u32 omap_iommu_vmap (struct iommu_domain *domain, struct device *dev, u32 da, const struct sg_table *sgt, u32 flags)
 
struct sg_tableomap_iommu_vunmap (struct iommu_domain *domain, struct device *dev, u32 da)
 
u32 omap_iommu_vmalloc (struct iommu_domain *domain, struct device *dev, u32 da, size_t bytes, u32 flags)
 
void omap_iommu_vfree (struct iommu_domain *domain, struct device *dev, const u32 da)
 
voidomap_da_to_va (struct device *dev, u32 da)
 

Macro Definition Documentation

#define IOVMF_ALLOC   (2 << IOVMF_SW_SHIFT)

Definition at line 64 of file iovmm.h.

#define IOVMF_ALLOC_MASK   (3 << IOVMF_SW_SHIFT)

Definition at line 65 of file iovmm.h.

#define IOVMF_CAM_MASK   (~((1 << 10) - 1))

Definition at line 38 of file iovmm.h.

#define IOVMF_DA_FIXED   (1 << (4 + IOVMF_SW_SHIFT))

Definition at line 72 of file iovmm.h.

#define IOVMF_DISCONT   (1 << (2 + IOVMF_SW_SHIFT))

Definition at line 68 of file iovmm.h.

#define IOVMF_ELSZ_16   MMU_RAM_ELSZ_16

Definition at line 53 of file iovmm.h.

#define IOVMF_ELSZ_32   MMU_RAM_ELSZ_32

Definition at line 54 of file iovmm.h.

#define IOVMF_ELSZ_8   MMU_RAM_ELSZ_8

Definition at line 52 of file iovmm.h.

#define IOVMF_ELSZ_MASK   (3 << 7)

Definition at line 51 of file iovmm.h.

#define IOVMF_ELSZ_NONE   MMU_RAM_ELSZ_NONE

Definition at line 55 of file iovmm.h.

#define IOVMF_ENDIAN_BIG   MMU_RAM_ENDIAN_BIG

Definition at line 48 of file iovmm.h.

#define IOVMF_ENDIAN_LITTLE   MMU_RAM_ENDIAN_LITTLE

Definition at line 49 of file iovmm.h.

#define IOVMF_ENDIAN_MASK   (1 << 9)

Definition at line 47 of file iovmm.h.

#define IOVMF_LINEAR   (2 << (2 + IOVMF_SW_SHIFT))

Definition at line 69 of file iovmm.h.

#define IOVMF_LINEAR_MASK   (3 << (2 + IOVMF_SW_SHIFT))

Definition at line 70 of file iovmm.h.

#define IOVMF_MIXED   MMU_RAM_MIXED

Definition at line 58 of file iovmm.h.

#define IOVMF_MIXED_MASK   (1 << 6)

Definition at line 57 of file iovmm.h.

#define IOVMF_MMIO   (1 << IOVMF_SW_SHIFT)

Definition at line 63 of file iovmm.h.

#define IOVMF_PGSZ_16M   MMU_CAM_PGSZ_16M

Definition at line 45 of file iovmm.h.

#define IOVMF_PGSZ_1M   MMU_CAM_PGSZ_1M

Definition at line 42 of file iovmm.h.

#define IOVMF_PGSZ_4K   MMU_CAM_PGSZ_4K

Definition at line 44 of file iovmm.h.

#define IOVMF_PGSZ_64K   MMU_CAM_PGSZ_64K

Definition at line 43 of file iovmm.h.

#define IOVMF_PGSZ_MASK   (3 << 0)

Definition at line 41 of file iovmm.h.

#define IOVMF_RAM_MASK   (~IOVMF_CAM_MASK)

Definition at line 39 of file iovmm.h.

#define IOVMF_SW_SHIFT   16

Definition at line 33 of file iovmm.h.

Function Documentation

void* omap_da_to_va ( struct device dev,
u32  da 
)

omap_da_to_va - convert (d) to (v) : client device : iommu device virtual address : mpu virtual address

Returns mpu virtual addr which corresponds to a given device virtual addr

Definition at line 354 of file omap-iovmm.c.

struct iovm_struct* omap_find_iovm_area ( struct device dev,
u32  da 
)
read

omap_find_iovm_area - find iovma which includes : client device : iommu device virtual address

Find the existing iovma starting at

Definition at line 239 of file omap-iovmm.c.

void omap_iommu_vfree ( struct iommu_domain domain,
struct device dev,
const u32  da 
)

omap_iommu_vfree - release memory allocated by 'omap_iommu_vmalloc()' : client device : iommu device virtual address

Frees the iommu virtually continuous memory area starting at , as obtained from 'omap_iommu_vmalloc()'.

Definition at line 710 of file omap-iovmm.c.

u32 omap_iommu_vmalloc ( struct iommu_domain domain,
struct device dev,
u32  da,
size_t  bytes,
u32  flags 
)

omap_iommu_vmalloc - (d)-(p)-(v) address allocator and mapper : client device : contiguous iommu virtual memory : allocation size : iovma and page property

Allocate linearly and creates 1-n-1 mapping and returns again, which might be adjusted if 'IOVMF_DA_FIXED' is not set.

Definition at line 661 of file omap-iovmm.c.

u32 omap_iommu_vmap ( struct iommu_domain domain,
struct device dev,
u32  da,
const struct sg_table sgt,
u32  flags 
)

omap_iommu_vmap - (d)-(p)-(v) address mapper : iommu domain : client device : address of scatter gather table : iovma and page property

Creates 1-n-1 mapping with given and returns . All element must be io page size aligned.

Definition at line 591 of file omap-iovmm.c.

struct sg_table* omap_iommu_vunmap ( struct iommu_domain domain,
struct device dev,
u32  da 
)
read

omap_iommu_vunmap - release virtual mapping obtained by 'omap_iommu_vmap()' : iommu domain : client device : iommu device virtual address

Free the iommu virtually contiguous memory area starting at , which was returned by 'omap_iommu_vmap()'.

Definition at line 633 of file omap-iovmm.c.