]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mvebu: Fix return_to_bootrom()
authorPali Rohár <pali@kernel.org>
Fri, 23 Jul 2021 09:14:23 +0000 (11:14 +0200)
committerStefan Roese <sr@denx.de>
Sat, 31 Jul 2021 07:49:32 +0000 (09:49 +0200)
Register r0 should be set to return value 0x0 - NO_ERR.

Set r0 with return value after all registers are restored from the
stack, so that the return value is always correct.

Signed-off-by: Pali Rohár <pali@kernel.org>
Fixes: 944c7a317675 ("arm: mvebu: Add option to use UART xmodem protocol via kwboot")
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Tested-by: Chris Packham <judge.packham@gmail.com>
arch/arm/mach-mvebu/lowlevel_spl.S

index 8718d7a43e11c852a082a84f4de6ef19ca073bbc..dde77b765214dac504d68fec25d77453a4cd8161 100644 (file)
@@ -13,8 +13,9 @@ ENDPROC(save_boot_params)
 ENTRY(return_to_bootrom)
        ldr     r12, =CONFIG_SPL_BOOTROM_SAVE
        ldr     sp, [r12]
+       ldmfd   sp!, {r0 - r12, lr}     /* @ restore registers from stack */
        mov     r0, #0x0                /* @ return value: 0x0 NO_ERR */
-       ldmfd   sp!, {r0 - r12, pc}     /* @ restore regs and return */
+       bx      lr                      /* @ return to bootrom */
 ENDPROC(return_to_bootrom)
 
 /*