diff options
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r-- | arch/powerpc/mm/pgtable_64.c | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index ac64f4aaa509..16e4ee1c2318 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c | |||
@@ -113,7 +113,7 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags) | |||
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
116 | static void __iomem * __ioremap_com(unsigned long addr, unsigned long pa, | 116 | static void __iomem * __ioremap_com(phys_addr_t addr, unsigned long pa, |
117 | unsigned long ea, unsigned long size, | 117 | unsigned long ea, unsigned long size, |
118 | unsigned long flags) | 118 | unsigned long flags) |
119 | { | 119 | { |
@@ -129,22 +129,12 @@ static void __iomem * __ioremap_com(unsigned long addr, unsigned long pa, | |||
129 | return (void __iomem *) (ea + (addr & ~PAGE_MASK)); | 129 | return (void __iomem *) (ea + (addr & ~PAGE_MASK)); |
130 | } | 130 | } |
131 | 131 | ||
132 | 132 | void __iomem * __ioremap(phys_addr_t addr, unsigned long size, | |
133 | void __iomem * | ||
134 | ioremap(unsigned long addr, unsigned long size) | ||
135 | { | ||
136 | return __ioremap(addr, size, _PAGE_NO_CACHE | _PAGE_GUARDED); | ||
137 | } | ||
138 | |||
139 | void __iomem * __ioremap(unsigned long addr, unsigned long size, | ||
140 | unsigned long flags) | 133 | unsigned long flags) |
141 | { | 134 | { |
142 | unsigned long pa, ea; | 135 | unsigned long pa, ea; |
143 | void __iomem *ret; | 136 | void __iomem *ret; |
144 | 137 | ||
145 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | ||
146 | return (void __iomem *)addr; | ||
147 | |||
148 | /* | 138 | /* |
149 | * Choose an address to map it to. | 139 | * Choose an address to map it to. |
150 | * Once the imalloc system is running, we use it. | 140 | * Once the imalloc system is running, we use it. |
@@ -178,9 +168,28 @@ void __iomem * __ioremap(unsigned long addr, unsigned long size, | |||
178 | return ret; | 168 | return ret; |
179 | } | 169 | } |
180 | 170 | ||
171 | |||
172 | void __iomem * ioremap(phys_addr_t addr, unsigned long size) | ||
173 | { | ||
174 | unsigned long flags = _PAGE_NO_CACHE | _PAGE_GUARDED; | ||
175 | |||
176 | if (ppc_md.ioremap) | ||
177 | return ppc_md.ioremap(addr, size, flags); | ||
178 | return __ioremap(addr, size, flags); | ||
179 | } | ||
180 | |||
181 | void __iomem * ioremap_flags(phys_addr_t addr, unsigned long size, | ||
182 | unsigned long flags) | ||
183 | { | ||
184 | if (ppc_md.ioremap) | ||
185 | return ppc_md.ioremap(addr, size, flags); | ||
186 | return __ioremap(addr, size, flags); | ||
187 | } | ||
188 | |||
189 | |||
181 | #define IS_PAGE_ALIGNED(_val) ((_val) == ((_val) & PAGE_MASK)) | 190 | #define IS_PAGE_ALIGNED(_val) ((_val) == ((_val) & PAGE_MASK)) |
182 | 191 | ||
183 | int __ioremap_explicit(unsigned long pa, unsigned long ea, | 192 | int __ioremap_explicit(phys_addr_t pa, unsigned long ea, |
184 | unsigned long size, unsigned long flags) | 193 | unsigned long size, unsigned long flags) |
185 | { | 194 | { |
186 | struct vm_struct *area; | 195 | struct vm_struct *area; |
@@ -235,13 +244,10 @@ int __ioremap_explicit(unsigned long pa, unsigned long ea, | |||
235 | * | 244 | * |
236 | * XXX what about calls before mem_init_done (ie python_countermeasures()) | 245 | * XXX what about calls before mem_init_done (ie python_countermeasures()) |
237 | */ | 246 | */ |
238 | void iounmap(volatile void __iomem *token) | 247 | void __iounmap(volatile void __iomem *token) |
239 | { | 248 | { |
240 | void *addr; | 249 | void *addr; |
241 | 250 | ||
242 | if (firmware_has_feature(FW_FEATURE_ISERIES)) | ||
243 | return; | ||
244 | |||
245 | if (!mem_init_done) | 251 | if (!mem_init_done) |
246 | return; | 252 | return; |
247 | 253 | ||
@@ -250,6 +256,14 @@ void iounmap(volatile void __iomem *token) | |||
250 | im_free(addr); | 256 | im_free(addr); |
251 | } | 257 | } |
252 | 258 | ||
259 | void iounmap(volatile void __iomem *token) | ||
260 | { | ||
261 | if (ppc_md.iounmap) | ||
262 | ppc_md.iounmap(token); | ||
263 | else | ||
264 | __iounmap(token); | ||
265 | } | ||
266 | |||
253 | static int iounmap_subset_regions(unsigned long addr, unsigned long size) | 267 | static int iounmap_subset_regions(unsigned long addr, unsigned long size) |
254 | { | 268 | { |
255 | struct vm_struct *area; | 269 | struct vm_struct *area; |
@@ -268,7 +282,7 @@ static int iounmap_subset_regions(unsigned long addr, unsigned long size) | |||
268 | return 0; | 282 | return 0; |
269 | } | 283 | } |
270 | 284 | ||
271 | int iounmap_explicit(volatile void __iomem *start, unsigned long size) | 285 | int __iounmap_explicit(volatile void __iomem *start, unsigned long size) |
272 | { | 286 | { |
273 | struct vm_struct *area; | 287 | struct vm_struct *area; |
274 | unsigned long addr; | 288 | unsigned long addr; |
@@ -303,8 +317,10 @@ int iounmap_explicit(volatile void __iomem *start, unsigned long size) | |||
303 | } | 317 | } |
304 | 318 | ||
305 | EXPORT_SYMBOL(ioremap); | 319 | EXPORT_SYMBOL(ioremap); |
320 | EXPORT_SYMBOL(ioremap_flags); | ||
306 | EXPORT_SYMBOL(__ioremap); | 321 | EXPORT_SYMBOL(__ioremap); |
307 | EXPORT_SYMBOL(iounmap); | 322 | EXPORT_SYMBOL(iounmap); |
323 | EXPORT_SYMBOL(__iounmap); | ||
308 | 324 | ||
309 | void __iomem * reserve_phb_iospace(unsigned long size) | 325 | void __iomem * reserve_phb_iospace(unsigned long size) |
310 | { | 326 | { |