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

Raymond Mao raymond.mao at linaro.org
Wed Dec 27 16:51:52 CET 2023


Hi Simon,

On Tue, 26 Dec 2023 at 04:48, Simon Glass <sjg at chromium.org> wrote:

> Hi Raymond,
>
> On Fri, Dec 22, 2023 at 9:31 PM 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 */
> > +       stm r12, {r2, r1, r0, r3}
>
> I thought the instruction was a bitmap, so what does the 'swapping'
> actually change?
>
> The swapping is due to different register conventions between aarch32 and
aarch64.
Actually swapping here is to avoid the complexity of swapping this in C
code.
I will update the comments here.

[...]

Regards,
Raymond


More information about the U-Boot mailing list