sh: Track the uncached mapping size.
authorPaul Mundt <lethal@linux-sh.org>
Thu, 21 Jan 2010 06:54:31 +0000 (15:54 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 21 Jan 2010 06:54:31 +0000 (15:54 +0900)
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>
arch/sh/include/asm/system.h
arch/sh/kernel/head_32.S
arch/sh/mm/init.c

index de2fc3963c12f54174ebda7a0d53d77cd4dbc564..6442f1783fe01f4b75d7199b7bb7a68126ebac31 100644 (file)
@@ -137,6 +137,7 @@ extern unsigned int instruction_size(unsigned int insn);
 #endif
 
 extern unsigned long cached_to_uncached;
+extern unsigned long uncached_size;
 
 extern struct dentry *sh_debugfs_root;
 
index e93320135cda9b6177b53d7b733efc9e00b30d5e..83f2b84b58daca80056ca3549e8f3cdee719d5dd 100644 (file)
@@ -217,11 +217,18 @@ ENTRY(_stext)
        __PMB_ITER_BY_SIZE(16)
 
        /*
-        * Now that we can access it, update cached_to_uncached.
+        * Now that we can access it, update cached_to_uncached and
+        * uncached_size.
         */
        mov.l   .Lcached_to_uncached, r0
        mov.l   r7, @r0
 
+       mov.l   .Luncached_size, r0
+       mov     #1, r7
+       shll16  r7
+       shll8   r7
+       mov.l   r7, @r0
+
        /*
         * Clear the remaining PMB entries.
         *
@@ -300,5 +307,6 @@ ENTRY(stack_start)
 .LFIRST_DATA_ENTRY:    .long   __MEMORY_START | PMB_V
 .LMMUCR:               .long   MMUCR
 .Lcached_to_uncached:  .long   cached_to_uncached
+.Luncached_size:       .long   uncached_size
 .LMEMORY_SIZE:         .long   __MEMORY_SIZE
 #endif
index f3e23ad075cb65e00ddb8f7211629980bdd4a817..a28ff63c17a637f2105223d780030d492c06b0e3 100644 (file)
@@ -27,15 +27,17 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD];
 
 #ifdef CONFIG_SUPERH32
 /*
- * Handle trivial transitions between cached and uncached
- * segments, making use of the 1:1 mapping relationship in
- * 512MB lowmem.
- *
  * This is the offset of the uncached section from its cached alias.
- * Default value only valid in 29 bit mode, in 32bit mode will be
- * overridden in pmb_init.
+ *
+ * Legacy platforms handle trivial transitions between cached and
+ * uncached segments by making use of the 1:1 mapping relationship in
+ * 512MB lowmem, others via a special uncached mapping.
+ *
+ * Default value only valid in 29 bit mode, in 32bit mode this will be
+ * updated by the early PMB initialization code.
  */
 unsigned long cached_to_uncached = P2SEG - P1SEG;
+unsigned long uncached_size = 0x20000000;
 #endif
 
 #ifdef CONFIG_MMU
@@ -281,7 +283,8 @@ void __init mem_init(void)
                "    pkmap   : 0x%08lx - 0x%08lx   (%4ld kB)\n"
 #endif
                "    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
-               "    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
+               "    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB) (cached)\n"
+               "            : 0x%08lx - 0x%08lx   (%4ld MB) (uncached)\n"
                "      .init : 0x%08lx - 0x%08lx   (%4ld kB)\n"
                "      .data : 0x%08lx - 0x%08lx   (%4ld kB)\n"
                "      .text : 0x%08lx - 0x%08lx   (%4ld kB)\n",
@@ -299,6 +302,10 @@ void __init mem_init(void)
                (unsigned long)memory_start, (unsigned long)high_memory,
                ((unsigned long)high_memory - (unsigned long)memory_start) >> 20,
 
+               (unsigned long)memory_start + cached_to_uncached,
+               (unsigned long)memory_start + cached_to_uncached + uncached_size,
+               uncached_size >> 20,
+
                (unsigned long)&__init_begin, (unsigned long)&__init_end,
                ((unsigned long)&__init_end -
                 (unsigned long)&__init_begin) >> 10,