diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2013-06-08 20:52:11 -0400 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2013-07-08 04:18:56 -0400 |
commit | c5a771d0678f9613e9f89cf1a5bdcfa5b08b225b (patch) | |
tree | c0d5ae3d94a0edb6edf9f1896ecb31666035d280 | |
parent | 661b40b0362c16b9969bf018636fb60454f62ee5 (diff) |
xtensa: adjust boot parameters address when INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX is selected
The virtual address of boot parameters chain is passed to the kernel via
a2 register. Adjust it in case it is remapped during MMUv3 -> MMUv2
mapping change, i.e. when it is in the first 128M.
Also fix interpretation of initrd and FDT addresses passed in the boot
parameters: these are physical addresses.
Cc: stable@vger.kernel.org
Reported-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
-rw-r--r-- | arch/xtensa/kernel/head.S | 9 | ||||
-rw-r--r-- | arch/xtensa/kernel/setup.c | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/arch/xtensa/kernel/head.S b/arch/xtensa/kernel/head.S index ef12c0e6fa25..7d740ebbe198 100644 --- a/arch/xtensa/kernel/head.S +++ b/arch/xtensa/kernel/head.S | |||
@@ -68,6 +68,15 @@ _SetupMMU: | |||
68 | 68 | ||
69 | #ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX | 69 | #ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX |
70 | initialize_mmu | 70 | initialize_mmu |
71 | #if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY | ||
72 | rsr a2, excsave1 | ||
73 | movi a3, 0x08000000 | ||
74 | bgeu a2, a3, 1f | ||
75 | movi a3, 0xd0000000 | ||
76 | add a2, a2, a3 | ||
77 | wsr a2, excsave1 | ||
78 | 1: | ||
79 | #endif | ||
71 | #endif | 80 | #endif |
72 | .end no-absolute-literals | 81 | .end no-absolute-literals |
73 | 82 | ||
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 6dd25ecde3f5..14c6c3a6f04b 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c | |||
@@ -152,8 +152,8 @@ static int __init parse_tag_initrd(const bp_tag_t* tag) | |||
152 | { | 152 | { |
153 | meminfo_t* mi; | 153 | meminfo_t* mi; |
154 | mi = (meminfo_t*)(tag->data); | 154 | mi = (meminfo_t*)(tag->data); |
155 | initrd_start = (void*)(mi->start); | 155 | initrd_start = __va(mi->start); |
156 | initrd_end = (void*)(mi->end); | 156 | initrd_end = __va(mi->end); |
157 | 157 | ||
158 | return 0; | 158 | return 0; |
159 | } | 159 | } |
@@ -164,7 +164,7 @@ __tagtable(BP_TAG_INITRD, parse_tag_initrd); | |||
164 | 164 | ||
165 | static int __init parse_tag_fdt(const bp_tag_t *tag) | 165 | static int __init parse_tag_fdt(const bp_tag_t *tag) |
166 | { | 166 | { |
167 | dtb_start = (void *)(tag->data[0]); | 167 | dtb_start = __va(tag->data[0]); |
168 | return 0; | 168 | return 0; |
169 | } | 169 | } |
170 | 170 | ||