aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-21 01:54:31 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-21 01:54:31 -0500
commit3125ee72dca25fc2157dcddd07e2d740db921fc4 (patch)
treee6fdcea67ba6ebf9bf485b397f8488b15da1330d /arch/sh
parent2023b843d7b62d99e7356b872e99abc7d6667e49 (diff)
sh: Track the uncached mapping size.
This provides a variable for tracking the uncached mapping size, and uses it for pretty printing the uncached lowmem range. Beyond this, we'll also be building on top of this for figuring out from where the remainder of P2 becomes usable when constructing unrelated mappings. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/system.h1
-rw-r--r--arch/sh/kernel/head_32.S10
-rw-r--r--arch/sh/mm/init.c21
3 files changed, 24 insertions, 8 deletions
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
index de2fc3963c12..6442f1783fe0 100644
--- a/arch/sh/include/asm/system.h
+++ b/arch/sh/include/asm/system.h
@@ -137,6 +137,7 @@ extern unsigned int instruction_size(unsigned int insn);
137#endif 137#endif
138 138
139extern unsigned long cached_to_uncached; 139extern unsigned long cached_to_uncached;
140extern unsigned long uncached_size;
140 141
141extern struct dentry *sh_debugfs_root; 142extern struct dentry *sh_debugfs_root;
142 143
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
index e93320135cda..83f2b84b58da 100644
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -217,11 +217,18 @@ ENTRY(_stext)
217 __PMB_ITER_BY_SIZE(16) 217 __PMB_ITER_BY_SIZE(16)
218 218
219 /* 219 /*
220 * Now that we can access it, update cached_to_uncached. 220 * Now that we can access it, update cached_to_uncached and
221 * uncached_size.
221 */ 222 */
222 mov.l .Lcached_to_uncached, r0 223 mov.l .Lcached_to_uncached, r0
223 mov.l r7, @r0 224 mov.l r7, @r0
224 225
226 mov.l .Luncached_size, r0
227 mov #1, r7
228 shll16 r7
229 shll8 r7
230 mov.l r7, @r0
231
225 /* 232 /*
226 * Clear the remaining PMB entries. 233 * Clear the remaining PMB entries.
227 * 234 *
@@ -300,5 +307,6 @@ ENTRY(stack_start)
300.LFIRST_DATA_ENTRY: .long __MEMORY_START | PMB_V 307.LFIRST_DATA_ENTRY: .long __MEMORY_START | PMB_V
301.LMMUCR: .long MMUCR 308.LMMUCR: .long MMUCR
302.Lcached_to_uncached: .long cached_to_uncached 309.Lcached_to_uncached: .long cached_to_uncached
310.Luncached_size: .long uncached_size
303.LMEMORY_SIZE: .long __MEMORY_SIZE 311.LMEMORY_SIZE: .long __MEMORY_SIZE
304#endif 312#endif
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index f3e23ad075cb..a28ff63c17a6 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -27,15 +27,17 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD];
27 27
28#ifdef CONFIG_SUPERH32 28#ifdef CONFIG_SUPERH32
29/* 29/*
30 * Handle trivial transitions between cached and uncached
31 * segments, making use of the 1:1 mapping relationship in
32 * 512MB lowmem.
33 *
34 * This is the offset of the uncached section from its cached alias. 30 * This is the offset of the uncached section from its cached alias.
35 * Default value only valid in 29 bit mode, in 32bit mode will be 31 *
36 * overridden in pmb_init. 32 * Legacy platforms handle trivial transitions between cached and
33 * uncached segments by making use of the 1:1 mapping relationship in
34 * 512MB lowmem, others via a special uncached mapping.
35 *
36 * Default value only valid in 29 bit mode, in 32bit mode this will be
37 * updated by the early PMB initialization code.
37 */ 38 */
38unsigned long cached_to_uncached = P2SEG - P1SEG; 39unsigned long cached_to_uncached = P2SEG - P1SEG;
40unsigned long uncached_size = 0x20000000;
39#endif 41#endif
40 42
41#ifdef CONFIG_MMU 43#ifdef CONFIG_MMU
@@ -281,7 +283,8 @@ void __init mem_init(void)
281 " pkmap : 0x%08lx - 0x%08lx (%4ld kB)\n" 283 " pkmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
282#endif 284#endif
283 " vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n" 285 " vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
284 " lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n" 286 " lowmem : 0x%08lx - 0x%08lx (%4ld MB) (cached)\n"
287 " : 0x%08lx - 0x%08lx (%4ld MB) (uncached)\n"
285 " .init : 0x%08lx - 0x%08lx (%4ld kB)\n" 288 " .init : 0x%08lx - 0x%08lx (%4ld kB)\n"
286 " .data : 0x%08lx - 0x%08lx (%4ld kB)\n" 289 " .data : 0x%08lx - 0x%08lx (%4ld kB)\n"
287 " .text : 0x%08lx - 0x%08lx (%4ld kB)\n", 290 " .text : 0x%08lx - 0x%08lx (%4ld kB)\n",
@@ -299,6 +302,10 @@ void __init mem_init(void)
299 (unsigned long)memory_start, (unsigned long)high_memory, 302 (unsigned long)memory_start, (unsigned long)high_memory,
300 ((unsigned long)high_memory - (unsigned long)memory_start) >> 20, 303 ((unsigned long)high_memory - (unsigned long)memory_start) >> 20,
301 304
305 (unsigned long)memory_start + cached_to_uncached,
306 (unsigned long)memory_start + cached_to_uncached + uncached_size,
307 uncached_size >> 20,
308
302 (unsigned long)&__init_begin, (unsigned long)&__init_end, 309 (unsigned long)&__init_begin, (unsigned long)&__init_end,
303 ((unsigned long)&__init_end - 310 ((unsigned long)&__init_end -
304 (unsigned long)&__init_begin) >> 10, 311 (unsigned long)&__init_begin) >> 10,