[PATCH 08/10] Use the correct ramdisk address
Simon Glass
sjg at chromium.org
Sun Dec 1 17:14:18 CET 2024
On Sat, 23 Nov 2024 at 12:57, Matthew Garrett <mjg59 at srcf.ucam.org> wrote:
>
> From: Matthew Garrett <mgarrett at aurora.tech>
>
> CONFIG_SYS_BOOT_RAMDISK_HIGH copies the initrd out of the FIT and into
> correctly aligned RAM, but the addresses used for this are then discarded
> by the x86 bootm code. Fix that.
>
> Signed-off-by: Matthew Garrett <mgarrett at aurora.tech>
> ---
>
> arch/x86/lib/bootm.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
>
> diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
> index c4446b1f9c6..cabf18fccb7 100644
> --- a/arch/x86/lib/bootm.c
> +++ b/arch/x86/lib/bootm.c
> @@ -72,6 +72,7 @@ int arch_fixup_memory_node(void *blob)
> /* Subcommand: PREP */
> static int boot_prep_linux(struct bootm_headers *images)
> {
> + ulong initrd_start, initrd_size;
> char *cmd_line_dest = NULL;
> struct legacy_img_hdr *hdr;
> int is_zimage = 0;
> @@ -134,10 +135,16 @@ static int boot_prep_linux(struct bootm_headers *images)
> goto error;
> }
>
> + if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH)) {
> + initrd_start = images->initrd_start;
> + initrd_size = images->initrd_end - images->initrd_start;
> + } else {
> + initrd_start = images->rd_start;
> + initrd_size = images->rd_end - images->rd_start;
> + }
> printf("Setup at %#08lx\n", images->ep);
> ret = setup_zimage((void *)images->ep, cmd_line_dest,
> - 0, images->rd_start,
> - images->rd_end - images->rd_start, 0);
> + 0, initrd_start, initrd_size, 0);
>
> if (ret) {
> printf("## Setting up boot parameters failed ...\n");
> --
> 2.47.0
>
More information about the U-Boot
mailing list