Hi Stefano,

On 28/04/2025 23:55, Andrei Cherechesu wrote:
> From: Andrei Cherechesu <andrei.cherech...@oss.nxp.com>
>
> Normally, the Imagebuilder would precompute the sizes of the loaded
> binaries and addresses where they are loaded before generating the
> script, and the sizes and addresses that needed to be provided to
> Xen via /chosen would be hardcoded in the boot script.
>
> Added an option via "-s" parameter to avoid hardcoding any
> address in the boot script, and dynamically compute the
> loading addresses for binaries. The first loading address is based
> on the MEMORY_START parameter and after loading each binary,
> the loading address and the size of the binary are stored in
> variables with corresponding names. Then, the loading address
> for the next binary is computed and aligned to 0x200000.
>
> If the "-s" parameter is not used, the normal flow is executed,
> where the loading addresses and sizes for each binaries are
> precomputed and hardcoded inside the script, but the loading
> addresses and sizes for each binary are now also stored for eventual
> later use.
>
> Reserved memory regions are left TBD in the -s case.
>
> Link: 
> https://lists.xenproject.org/archives/html/xen-devel/2022-09/msg01862.html
> Signed-off-by: Andrei Cherechesu <andrei.cherech...@nxp.com>
> Signed-off-by: Stefano Stabellini <stefano.stabell...@amd.com>
> Reviewed-by: Andrei Cherechesu <andrei.cherech...@nxp.com>
> Reviewed-by: Denis Mukhin <dmuk...@ford.com>
> ---
> Changes in v8:
> - remove quotes in heredoc
> - change memaddr to hex for readability
>
> Changes in v7:
> - use $()
> - better description and alphabetical order
> - use heredoc
>
> Changes in v6:
> - make initial ${memaddr} setting depending on CALC
>
> This patch adds quite a bit of complexity which is the reason why I
> didn't originally commit it. Now that we are enabling ImageBuilder in
> Yocto, it turns out this patch is required because Yocto invokes
> ImageBuilder before all the binaries are ready and available.
>
> Andrei, sorry for taking so long to realize why it is essential, but we
> are getting there now.
>
> The changes I made to the original patch are purely to make it simpler
> to maintain.
> ---
>  README.md                |   2 +
>  scripts/uboot-script-gen | 181 ++++++++++++++++++++++++++++++++-------
>  2 files changed, 152 insertions(+), 31 deletions(-)

Everything looks good to me, briefly tested it locally as well.

Regards,
Andrei Cherechesu



Reply via email to