Skip to content

Commit

Permalink
xtensa: adjust boot parameters address when INITIALIZE_XTENSA_MMU_INS…
Browse files Browse the repository at this point in the history
…IDE_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>
  • Loading branch information
Max Filippov authored and Chris Zankel committed Jul 8, 2013
1 parent 661b40b commit c5a771d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions arch/xtensa/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ _SetupMMU:

#ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
initialize_mmu
#if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
rsr a2, excsave1
movi a3, 0x08000000
bgeu a2, a3, 1f
movi a3, 0xd0000000
add a2, a2, a3
wsr a2, excsave1
1:
#endif
#endif
.end no-absolute-literals

Expand Down
6 changes: 3 additions & 3 deletions arch/xtensa/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ static int __init parse_tag_initrd(const bp_tag_t* tag)
{
meminfo_t* mi;
mi = (meminfo_t*)(tag->data);
initrd_start = (void*)(mi->start);
initrd_end = (void*)(mi->end);
initrd_start = __va(mi->start);
initrd_end = __va(mi->end);

return 0;
}
Expand All @@ -164,7 +164,7 @@ __tagtable(BP_TAG_INITRD, parse_tag_initrd);

static int __init parse_tag_fdt(const bp_tag_t *tag)
{
dtb_start = (void *)(tag->data[0]);
dtb_start = __va(tag->data[0]);
return 0;
}

Expand Down

0 comments on commit c5a771d

Please sign in to comment.