aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/Kconfig8
-rw-r--r--arch/arm/mm/ioremap.c49
2 files changed, 33 insertions, 24 deletions
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index e84fdde6edf8..3b79d0e23455 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -62,8 +62,8 @@ config CPU_ARM720T
62# ARM920T 62# ARM920T
63config CPU_ARM920T 63config CPU_ARM920T
64 bool "Support ARM920T processor" if !ARCH_S3C2410 64 bool "Support ARM920T processor" if !ARCH_S3C2410
65 depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX || ARCH_AAEC2000 65 depends on ARCH_INTEGRATOR || ARCH_S3C2410 || ARCH_IMX || ARCH_AAEC2000 || ARCH_AT91RM9200
66 default y if ARCH_S3C2410 66 default y if ARCH_S3C2410 || ARCH_AT91RM9200
67 select CPU_32v4 67 select CPU_32v4
68 select CPU_ABRT_EV4T 68 select CPU_ABRT_EV4T
69 select CPU_CACHE_V4WT 69 select CPU_CACHE_V4WT
@@ -83,8 +83,8 @@ config CPU_ARM920T
83# ARM922T 83# ARM922T
84config CPU_ARM922T 84config CPU_ARM922T
85 bool "Support ARM922T processor" if ARCH_INTEGRATOR 85 bool "Support ARM922T processor" if ARCH_INTEGRATOR
86 depends on ARCH_CAMELOT || ARCH_LH7A40X || ARCH_INTEGRATOR 86 depends on ARCH_LH7A40X || ARCH_INTEGRATOR
87 default y if ARCH_CAMELOT || ARCH_LH7A40X 87 default y if ARCH_LH7A40X
88 select CPU_32v4 88 select CPU_32v4
89 select CPU_ABRT_EV4T 89 select CPU_ABRT_EV4T
90 select CPU_CACHE_V4WT 90 select CPU_CACHE_V4WT
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 10901398e4a2..de3ce1eec2ec 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -86,11 +86,12 @@ remap_area_pmd(pmd_t * pmd, unsigned long address, unsigned long size,
86} 86}
87 87
88static int 88static int
89remap_area_pages(unsigned long start, unsigned long phys_addr, 89remap_area_pages(unsigned long start, unsigned long pfn,
90 unsigned long size, unsigned long flags) 90 unsigned long size, unsigned long flags)
91{ 91{
92 unsigned long address = start; 92 unsigned long address = start;
93 unsigned long end = start + size; 93 unsigned long end = start + size;
94 unsigned long phys_addr = __pfn_to_phys(pfn);
94 int err = 0; 95 int err = 0;
95 pgd_t * dir; 96 pgd_t * dir;
96 97
@@ -130,36 +131,44 @@ remap_area_pages(unsigned long start, unsigned long phys_addr,
130 * mapping. See include/asm-arm/proc-armv/pgtable.h for more information. 131 * mapping. See include/asm-arm/proc-armv/pgtable.h for more information.
131 */ 132 */
132void __iomem * 133void __iomem *
134__ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
135 unsigned long flags)
136{
137 unsigned long addr;
138 struct vm_struct * area;
139
140 area = get_vm_area(size, VM_IOREMAP);
141 if (!area)
142 return NULL;
143 addr = (unsigned long)area->addr;
144 if (remap_area_pages(addr, pfn, size, flags)) {
145 vfree(addr);
146 return NULL;
147 }
148 return (void __iomem *) (offset + (char *)addr);
149}
150EXPORT_SYMBOL(__ioremap_pfn);
151
152void __iomem *
133__ioremap(unsigned long phys_addr, size_t size, unsigned long flags) 153__ioremap(unsigned long phys_addr, size_t size, unsigned long flags)
134{ 154{
135 void * addr; 155 unsigned long last_addr;
136 struct vm_struct * area; 156 unsigned long offset = phys_addr & ~PAGE_MASK;
137 unsigned long offset, last_addr; 157 unsigned long pfn = __phys_to_pfn(phys_addr);
138 158
139 /* Don't allow wraparound or zero size */ 159 /*
160 * Don't allow wraparound or zero size
161 */
140 last_addr = phys_addr + size - 1; 162 last_addr = phys_addr + size - 1;
141 if (!size || last_addr < phys_addr) 163 if (!size || last_addr < phys_addr)
142 return NULL; 164 return NULL;
143 165
144 /* 166 /*
145 * Mappings have to be page-aligned 167 * Page align the mapping size
146 */ 168 */
147 offset = phys_addr & ~PAGE_MASK;
148 phys_addr &= PAGE_MASK;
149 size = PAGE_ALIGN(last_addr + 1) - phys_addr; 169 size = PAGE_ALIGN(last_addr + 1) - phys_addr;
150 170
151 /* 171 return __ioremap_pfn(pfn, offset, size, flags);
152 * Ok, go for it..
153 */
154 area = get_vm_area(size, VM_IOREMAP);
155 if (!area)
156 return NULL;
157 addr = area->addr;
158 if (remap_area_pages((unsigned long) addr, phys_addr, size, flags)) {
159 vfree(addr);
160 return NULL;
161 }
162 return (void __iomem *) (offset + (char *)addr);
163} 172}
164EXPORT_SYMBOL(__ioremap); 173EXPORT_SYMBOL(__ioremap);
165 174