[RFC 0/5] ARM: dma-mapping: New dma_map_ops to control IOVA more precisely

2012-08-29 Thread Hiroshi Doyu
Hi, The following APIs are needed for us to support the legacy Tegra memory manager for devices(NvMap) with *DMA mapping API*. New API: -iova_alloc(): To allocate IOVA area. -iova_alloc_at(): To allocate IOVA area at specific address. -iova_free(): To free IOVA area. -map_page_at(): To

[RFC 1/5] ARM: dma-mapping: New dma_map_ops-iova_get_free_{total, max} functions

2012-08-29 Thread Hiroshi Doyu
-iova_get_free_total() returns the sum of available free areas. -iova_get_free_max() returns the largest available free area size. Signed-off-by: Hiroshi Doyu hd...@nvidia.com --- arch/arm/include/asm/dma-mapping.h | 16 ++ arch/arm/mm/dma-mapping.c | 54

[RFC 2/5] ARM: dma-mapping: New dma_map_ops-iova_{alloc, free}() functions

2012-08-29 Thread Hiroshi Doyu
There are some cases that IOVA allocation and mapping have to be done seperately, especially for perf optimization reasons. This patch allows client modules to {alloc,free} IOVA space without backing up actual pages for that area. Signed-off-by: Hiroshi Doyu hd...@nvidia.com ---

[RFC 5/5] ARM: dma-mapping: Introduce dma_map_linear_attrs() for IOVA linear map

2012-08-29 Thread Hiroshi Doyu
Introduce a helper function, dma_map_linear(_attrs)() to create IOVA linear map, where IOVA and kernel virtual addresses are mapped at the same address linearly. This is useful to support legacy device drivers which expects no IOMMU. Signed-off-by: Hiroshi Doyu hd...@nvidia.com ---

[RFC 3/5] ARM: dma-mapping: New dma_map_ops-iova_alloc*_at* function

2012-08-29 Thread Hiroshi Doyu
To allocate IOVA area at specified address Signed-off-by: Hiroshi Doyu hd...@nvidia.com --- arch/arm/include/asm/dma-mapping.h |9 + arch/arm/mm/dma-mapping.c | 35 +++ include/linux/dma-mapping.h|2 ++ 3 files changed, 46

[RFC 4/5] ARM: dma-mapping: New dma_map_ops-map_page*_at* function

2012-08-29 Thread Hiroshi Doyu
Signed-off-by: Hiroshi Doyu hd...@nvidia.com --- arch/arm/mm/dma-mapping.c| 18 ++ include/asm-generic/dma-mapping-common.h | 19 +++ include/linux/dma-mapping.h |7 +++ 3 files changed, 44 insertions(+), 0 deletions(-)