aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorHiroshi DOYU <Hiroshi.DOYU@nokia.com>2009-01-28 14:32:08 -0500
committerHiroshi DOYU <Hiroshi.DOYU@nokia.com>2009-05-19 01:23:49 -0400
commit69d3a84a646d6ad6cd693a7a3d5b9af414113d2c (patch)
tree3fe2ec29cc83ff07ae0d07df6b51c52a59a3944e /arch/arm/mm
parent066aa9c1e3d0af52619fe26f05810990ff381d8c (diff)
omap iommu: simple virtual address space management
This patch provides a device drivers, which has a omap iommu, with address mapping APIs between device virtual address(iommu), physical address and MPU virtual address. There are 4 possible patterns for iommu virtual address(iova/da) mapping. |iova/ mapping iommu_ page | da pa va (d)-(p)-(v) function type --------------------------------------------------------------------------- 1 | c c c 1 - 1 - 1 _kmap() / _kunmap() s 2 | c c,a c 1 - 1 - 1 _kmalloc()/ _kfree() s 3 | c d c 1 - n - 1 _vmap() / _vunmap() s 4 | c d,a c 1 - n - 1 _vmalloc()/ _vfree() n* 'iova': device iommu virtual address 'da': alias of 'iova' 'pa': physical address 'va': mpu virtual address 'c': contiguous memory area 'd': dicontiguous memory area 'a': anonymous memory allocation '()': optional feature 'n': a normal page(4KB) size is used. 's': multiple iommu superpage(16MB, 1MB, 64KB, 4KB) size is used. '*': not yet, but feasible. Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/ioremap.c6
-rw-r--r--arch/arm/mm/mmu.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 9f88dd3be601..0ab75c60f7cf 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -110,6 +110,12 @@ static int remap_area_pages(unsigned long start, unsigned long pfn,
110 return err; 110 return err;
111} 111}
112 112
113int ioremap_page(unsigned long virt, unsigned long phys,
114 const struct mem_type *mtype)
115{
116 return remap_area_pages(virt, __phys_to_pfn(phys), PAGE_SIZE, mtype);
117}
118EXPORT_SYMBOL(ioremap_page);
113 119
114void __check_kvm_seq(struct mm_struct *mm) 120void __check_kvm_seq(struct mm_struct *mm)
115{ 121{
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index e6344ece00ce..70974d75a075 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -255,6 +255,7 @@ const struct mem_type *get_mem_type(unsigned int type)
255{ 255{
256 return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL; 256 return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL;
257} 257}
258EXPORT_SYMBOL(get_mem_type);
258 259
259/* 260/*
260 * Adjust the PMD section entries according to the CPU in use. 261 * Adjust the PMD section entries according to the CPU in use.