Skip to content
Snippets Groups Projects
Commit b4850e5a authored by Sylvain Garrigues's avatar Sylvain Garrigues Committed by Peter Maydell
Browse files

hw/arm/boot: always clear r0 when booting kernels


The 32-bit ARM Linux kernel booting ABI requires that r0 is 0
when calling the kernel image. A bug in commit 10b8ec73
meant that for boards which use the write_board_setup hook (which
means "highbank", "midway", "raspi2" and "xilinx-zynq-a9") we
were incorrectly skipping the "clear r0" instruction in the
mini-bootloader. Use the right offset in the "add lr, pc, #n"
instruction so that we return from the board-setup code to the
correct place.

Signed-off-by: default avatarSylvain Garrigues <sylvain@sylvaingarrigues.com>
[PMM: Expanded commit message]
Cc: qemu-stable@nongnu.org
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 81d9d186
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@ static const ARMInsnFixup bootloader_aarch64[] = {
*/
static const ARMInsnFixup bootloader[] = {
{ 0xe28fe008 }, /* add lr, pc, #8 */
{ 0xe28fe004 }, /* add lr, pc, #4 */
{ 0xe51ff004 }, /* ldr pc, [pc, #-4] */
{ 0, FIXUP_BOARD_SETUP },
#define BOOTLOADER_NO_BOARD_SETUP_OFFSET 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment