[PATCH v3 4/9] arm: armv7: save boot arguments

Ilias Apalodimas ilias.apalodimas at linaro.org
Wed Dec 27 09:29:59 CET 2023


Hi Raymond,

On Fri, 22 Dec 2023 at 23:31, Raymond Mao <raymond.mao at linaro.org> wrote:
>
> Save boot arguments r[0-3] into an array for handover of bloblist from
> previous boot stage.
>
> Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
> ---
> Changes in v2
> - New patch file created for v2.
> Changes in v3
> - Swap value of r0 with r2.
>
>  arch/arm/cpu/armv7/start.S | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
> index 69e281b086..2ca63ca32c 100644
> --- a/arch/arm/cpu/armv7/start.S
> +++ b/arch/arm/cpu/armv7/start.S
> @@ -152,9 +152,22 @@ ENDPROC(c_runtime_cpu_setup)
>   *
>   *************************************************************************/
>  WEAK(save_boot_params)
> +#if (IS_ENABLED(CONFIG_OF_BOARD) && IS_ENABLED(CONFIG_BLOBLIST))
> +       ldr r12, =saved_args
> +       /* Intentionally swapping r0 with r2 */

That isn't very helpful. It's obvious what the code does here. Add a
comment on *why* (to keep the c function simpler etc)

Thanks
/Ilias
> +       stm r12, {r2, r1, r0, r3}
> +#endif
>         b       save_boot_params_ret            @ back to my caller
>  ENDPROC(save_boot_params)
>
> +.section .data
> +.global saved_args
> +saved_args:
> +       .rept 4
> +       .word 0
> +       .endr
> +END(saved_args)
> +
>  #ifdef CONFIG_ARMV7_LPAE
>  WEAK(switch_to_hypervisor)
>         b       switch_to_hypervisor_ret
> --
> 2.25.1
>


More information about the U-Boot mailing list