[PATCH v2] spl: bootstage: move bootstage_stash before jumping to image
Chanho Park
chanho61.park at samsung.com
Wed Aug 30 07:10:12 CEST 2023
Hi Simon,
> -----Original Message-----
> From: Simon Glass <sjg at chromium.org>
> Sent: Wednesday, August 30, 2023 1:38 AM
> To: Chanho Park <chanho61.park at samsung.com>
> Cc: Nikhil M Jain <n-jain1 at ti.com>; Marek Vasut <marex at denx.de>; u-
> boot at lists.denx.de
> Subject: Re: [PATCH v2] spl: bootstage: move bootstage_stash before
> jumping to image
>
> Hi Chanho,
>
> On Mon, 28 Aug 2023 at 22:28, Chanho Park <chanho61.park at samsung.com>
> wrote:
> >
> > Regarding IH_OS_OPENSBI, IH_OS_LINUX and IH_OS_TEE, there is no chance
> > to stash bootstage record because they do not return to SPL after
> > jumping to the image.
> > Hence, this patch separates the final stage bootstage code into
> > spl_bootstage_finish and call the function before jumping to the image.
> >
> > Signed-off-by: Chanho Park <chanho61.park at samsung.com>
> > ---
> > Changes from v1
> > - Separate the final stage bootstage code into spl_bootstage_finish.
> > - As Simon suggests, call the function before jumping to the image.
>
> I think you misunderstood me here. I mean, you cannot jump off somewhere
> in your board code. You must change it so it returns correctly, and the
> jump happens from spl.c's board_init_r() function.
> The way it works is you set up the spl_image structure, then it SPL jumps
> to it at the end of the functions.
I feel like I'm still not clear on what you mean. Sorry.
switch (spl_image.os) {
case IH_OS_U_BOOT:
case IH_OS_ARM_TRUSTED_FIRMWARE:
case IH_OS_TEE:
case IH_OS_OPENSBI:
case IH_OS_LINUX:
}
Regarding ATF/TEE/OPENSBI and Linux, they need different number of arguments and formats to jump to the image, respectively.
I think that's why they can't go to the final stage and can't use jump_to_image_no_args.
Do you want to move jump codes at the end of the board_init_r function?
The easiest way is that we just move the whole switch statements to the final stage of the function.
Otherwise, the arguments can be prepared from switch statement and make jump_to_image function to support variable length of arguments.
(Or we can put switch statement there to support various jump of the image)
Can you elaborate a bit more?
Best Regards,
Chanho Park
More information about the U-Boot
mailing list