aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-13 04:31:48 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-13 04:31:48 -0500
commita0ab36689a36e583b6e736f1c99ac8c9aebdad59 (patch)
tree3efc6236d7ec0b5dbeeb311b8cd923c8e1e7f88c /arch/sh/kernel
parent7f33306ee57bce9c79825e89c457a91025aa5aad (diff)
sh: fixed PMB mode refactoring.
This introduces some much overdue chainsawing of the fixed PMB support. fixed PMB was introduced initially to work around the fact that dynamic PMB mode was relatively broken, though they were never intended to converge. The main areas where there are differences are whether the system is booted in 29-bit mode or 32-bit mode, and whether legacy mappings are to be preserved. Any system booting in true 32-bit mode will not care about legacy mappings, so these are roughly decoupled. Regardless of the entry point, PMB and 32BIT are directly related as far as the kernel is concerned, so we also switch back to having one select the other. With legacy mappings iterated through and applied in the initialization path it's now possible to finally merge the two implementations and permit dynamic remapping overtop of remaining entries regardless of whether boot mappings are crafted by hand or inherited from the boot loader. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/head_32.S4
-rw-r--r--arch/sh/kernel/setup.c3
-rw-r--r--arch/sh/kernel/vmlinux.lds.S15
3 files changed, 10 insertions, 12 deletions
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
index 1151ecdffa71..e5d421db4c83 100644
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -13,6 +13,8 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/linkage.h> 14#include <linux/linkage.h>
15#include <asm/thread_info.h> 15#include <asm/thread_info.h>
16#include <asm/mmu.h>
17#include <cpu/mmu_context.h>
16 18
17#ifdef CONFIG_CPU_SH4A 19#ifdef CONFIG_CPU_SH4A
18#define SYNCO() synco 20#define SYNCO() synco
@@ -33,7 +35,7 @@ ENTRY(empty_zero_page)
33 .long 1 /* LOADER_TYPE */ 35 .long 1 /* LOADER_TYPE */
34 .long 0x00000000 /* INITRD_START */ 36 .long 0x00000000 /* INITRD_START */
35 .long 0x00000000 /* INITRD_SIZE */ 37 .long 0x00000000 /* INITRD_SIZE */
36#if defined(CONFIG_32BIT) && defined(CONFIG_PMB_FIXED) 38#ifdef CONFIG_32BIT
37 .long 0x53453f00 + 32 /* "SE?" = 32 bit */ 39 .long 0x53453f00 + 32 /* "SE?" = 32 bit */
38#else 40#else
39 .long 0x53453f00 + 29 /* "SE?" = 29 bit */ 41 .long 0x53453f00 + 29 /* "SE?" = 29 bit */
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 8b0e69792cf4..f79ebe32a24a 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -455,10 +455,7 @@ void __init setup_arch(char **cmdline_p)
455 sh_mv.mv_setup(cmdline_p); 455 sh_mv.mv_setup(cmdline_p);
456 456
457 paging_init(); 457 paging_init();
458
459#ifdef CONFIG_PMB_ENABLE
460 pmb_init(); 458 pmb_init();
461#endif
462 459
463#ifdef CONFIG_SMP 460#ifdef CONFIG_SMP
464 plat_smp_setup(); 461 plat_smp_setup();
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index a1e4ec24f1f5..9e5a5878eeae 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -14,17 +14,16 @@ OUTPUT_ARCH(sh)
14#include <asm/cache.h> 14#include <asm/cache.h>
15#include <asm/vmlinux.lds.h> 15#include <asm/vmlinux.lds.h>
16 16
17#if defined(CONFIG_32BIT) && !defined(CONFIG_PMB_LEGACY)
18#define MEMORY_OFFSET 0
19#else
20#define MEMORY_OFFSET (CONFIG_MEMORY_START & 0x1fffffff)
21#endif
22
17ENTRY(_start) 23ENTRY(_start)
18SECTIONS 24SECTIONS
19{ 25{
20#ifdef CONFIG_PMB_FIXED 26 . = CONFIG_PAGE_OFFSET + MEMORY_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
21 . = CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) +
22 CONFIG_ZERO_PAGE_OFFSET;
23#elif defined(CONFIG_32BIT)
24 . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
25#else
26 . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
27#endif
28 27
29 _text = .; /* Text and read-only data */ 28 _text = .; /* Text and read-only data */
30 29