aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-18 07:08:32 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-18 07:08:32 -0500
commitd9b9487af79955a8e8fcddc963f56697e020cfed (patch)
treefc04b367df0bf5c646f87237cd14173ffe868fea /arch/sh
parent0c54de146ef4303ed3c5879b043894c8db637507 (diff)
sh: Handle early ioremaps through fixed mappings.
This adds in a mem_init_done to work out when a standard ioremap() is possible, falling back to the fixmap based ioremap otherwise. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/processor.h3
-rw-r--r--arch/sh/mm/init.c4
-rw-r--r--arch/sh/mm/ioremap_32.c12
3 files changed, 16 insertions, 3 deletions
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 017e0c1807b2..a522e5d8f44f 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -101,6 +101,9 @@ struct seq_operations;
101 101
102extern struct pt_regs fake_swapper_regs; 102extern struct pt_regs fake_swapper_regs;
103 103
104/* arch/sh/mm/init.c */
105extern unsigned int mem_init_done;
106
104/* arch/sh/kernel/setup.c */ 107/* arch/sh/kernel/setup.c */
105const char *get_cpu_subtype(struct sh_cpuinfo *c); 108const char *get_cpu_subtype(struct sh_cpuinfo *c);
106extern const struct seq_operations cpuinfo_op; 109extern const struct seq_operations cpuinfo_op;
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 30a9b530d456..fe578a286fdd 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -237,6 +237,8 @@ static void __init iommu_init(void)
237 no_iommu_init(); 237 no_iommu_init();
238} 238}
239 239
240unsigned int mem_init_done = 0;
241
240void __init mem_init(void) 242void __init mem_init(void)
241{ 243{
242 int codesize, datasize, initsize; 244 int codesize, datasize, initsize;
@@ -287,6 +289,8 @@ void __init mem_init(void)
287 289
288 /* Initialize the vDSO */ 290 /* Initialize the vDSO */
289 vsyscall_init(); 291 vsyscall_init();
292
293 mem_init_done = 1;
290} 294}
291 295
292void free_initmem(void) 296void free_initmem(void)
diff --git a/arch/sh/mm/ioremap_32.c b/arch/sh/mm/ioremap_32.c
index c80a8166fbb0..24f6ba6bff71 100644
--- a/arch/sh/mm/ioremap_32.c
+++ b/arch/sh/mm/ioremap_32.c
@@ -1,13 +1,13 @@
1/* 1/*
2 * arch/sh/mm/ioremap.c 2 * arch/sh/mm/ioremap.c
3 * 3 *
4 * (C) Copyright 1995 1996 Linus Torvalds
5 * (C) Copyright 2005 - 2010 Paul Mundt
6 *
4 * Re-map IO memory to kernel address space so that we can access it. 7 * Re-map IO memory to kernel address space so that we can access it.
5 * This is needed for high PCI addresses that aren't mapped in the 8 * This is needed for high PCI addresses that aren't mapped in the
6 * 640k-1MB IO memory area on PC's 9 * 640k-1MB IO memory area on PC's
7 * 10 *
8 * (C) Copyright 1995 1996 Linus Torvalds
9 * (C) Copyright 2005, 2006 Paul Mundt
10 *
11 * This file is subject to the terms and conditions of the GNU General 11 * This file is subject to the terms and conditions of the GNU General
12 * Public License. See the file "COPYING" in the main directory of this 12 * Public License. See the file "COPYING" in the main directory of this
13 * archive for more details. 13 * archive for more details.
@@ -65,6 +65,12 @@ void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
65 size = PAGE_ALIGN(last_addr+1) - phys_addr; 65 size = PAGE_ALIGN(last_addr+1) - phys_addr;
66 66
67 /* 67 /*
68 * If we can't yet use the regular approach, go the fixmap route.
69 */
70 if (!mem_init_done)
71 return ioremap_fixed(phys_addr, size, __pgprot(flags));
72
73 /*
68 * Ok, go for it.. 74 * Ok, go for it..
69 */ 75 */
70 area = get_vm_area_caller(size, VM_IOREMAP, caller); 76 area = get_vm_area_caller(size, VM_IOREMAP, caller);