]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
b2e3e0ab74d48bdb16927fd2f9b40a1e3289cb1d
[thirdparty/kernel/stable-queue.git] /
1 From c5a771d0678f9613e9f89cf1a5bdcfa5b08b225b Mon Sep 17 00:00:00 2001
2 From: Max Filippov <jcmvbkbc@gmail.com>
3 Date: Sun, 9 Jun 2013 04:52:11 +0400
4 Subject: xtensa: adjust boot parameters address when INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX is selected
5
6 From: Max Filippov <jcmvbkbc@gmail.com>
7
8 commit c5a771d0678f9613e9f89cf1a5bdcfa5b08b225b upstream.
9
10 The virtual address of boot parameters chain is passed to the kernel via
11 a2 register. Adjust it in case it is remapped during MMUv3 -> MMUv2
12 mapping change, i.e. when it is in the first 128M.
13
14 Also fix interpretation of initrd and FDT addresses passed in the boot
15 parameters: these are physical addresses.
16
17 Reported-by: Baruch Siach <baruch@tkos.co.il>
18 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
19 Signed-off-by: Chris Zankel <chris@zankel.net>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22 ---
23 arch/xtensa/kernel/head.S | 9 +++++++++
24 arch/xtensa/kernel/setup.c | 6 +++---
25 2 files changed, 12 insertions(+), 3 deletions(-)
26
27 --- a/arch/xtensa/kernel/head.S
28 +++ b/arch/xtensa/kernel/head.S
29 @@ -68,6 +68,15 @@ _SetupMMU:
30
31 #ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
32 initialize_mmu
33 +#if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
34 + rsr a2, excsave1
35 + movi a3, 0x08000000
36 + bgeu a2, a3, 1f
37 + movi a3, 0xd0000000
38 + add a2, a2, a3
39 + wsr a2, excsave1
40 +1:
41 +#endif
42 #endif
43 .end no-absolute-literals
44
45 --- a/arch/xtensa/kernel/setup.c
46 +++ b/arch/xtensa/kernel/setup.c
47 @@ -152,8 +152,8 @@ static int __init parse_tag_initrd(const
48 {
49 meminfo_t* mi;
50 mi = (meminfo_t*)(tag->data);
51 - initrd_start = (void*)(mi->start);
52 - initrd_end = (void*)(mi->end);
53 + initrd_start = __va(mi->start);
54 + initrd_end = __va(mi->end);
55
56 return 0;
57 }
58 @@ -164,7 +164,7 @@ __tagtable(BP_TAG_INITRD, parse_tag_init
59
60 static int __init parse_tag_fdt(const bp_tag_t *tag)
61 {
62 - dtb_start = (void *)(tag->data[0]);
63 + dtb_start = __va(tag->data[0]);
64 return 0;
65 }
66