Commit 7c2527f0 authored by Tony Lindgren's avatar Tony Lindgren Committed by Nicolas Pitre

ARM: zImage: Fix bad SP address after relocating kernel

Otherwise cache_clean_flush can overwrite some of the relocated
area depending on where the kernel image gets loaded. This fixes
booting on n900 after commit 6d7d0ae5
(ARM: 6750/1: improvements to compressed/head.S).

Thanks to Aaro Koskinen <aaro.koskinen@nokia.com> for debugging
the address of the relocated area that gets corrupted, and to
Nicolas Pitre <nicolas.pitre@linaro.org> for the other uncompress
related fixes.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
parent 3bd2cbb9
...@@ -253,6 +253,11 @@ restart: adr r0, LC0 ...@@ -253,6 +253,11 @@ restart: adr r0, LC0
/* Preserve offset to relocated code. */ /* Preserve offset to relocated code. */
sub r6, r9, r6 sub r6, r9, r6
#ifndef CONFIG_ZBOOT_ROM
/* cache_clean_flush may use the stack, so relocate it */
add sp, sp, r6
#endif
bl cache_clean_flush bl cache_clean_flush
adr r0, BSYM(restart) adr r0, BSYM(restart)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment