[PATCH u-boot-mvebu 18/31] arm: mvebu: Fix return_to_bootrom()

Stefan Roese sr at denx.de
Thu Jul 15 10:42:49 CEST 2021


On 08.07.21 19:30, Marek Behún wrote:
> From: Pali Rohár <pali at kernel.org>
> 
> 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 at kernel.org>
> Fixes: 944c7a317675 ("arm: mvebu: Add option to use UART xmodem protocol via kwboot")
> Reviewed-by: Marek Behún <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   arch/arm/mach-mvebu/lowlevel_spl.S | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-mvebu/lowlevel_spl.S b/arch/arm/mach-mvebu/lowlevel_spl.S
> index 8718d7a43e..dde77b7652 100644
> --- a/arch/arm/mach-mvebu/lowlevel_spl.S
> +++ b/arch/arm/mach-mvebu/lowlevel_spl.S
> @@ -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)
>   
>   /*
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list