]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: add resize for FDT in bootelf
authorMaxim Moskalets <maximmosk4@gmail.com>
Fri, 28 Jun 2024 08:34:11 +0000 (11:34 +0300)
committerTom Rini <trini@konsulko.com>
Wed, 10 Jul 2024 19:36:16 +0000 (13:36 -0600)
In some FDTs, there is not enough free memory to add nodes, so this
operation fails.

Signed-off-by: Maxim Moskalets <maximmosk4@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/elf.c

index 32b7462f92aff4325e2cafc64a2eb5d01b66bfac..673c6c30511c2310e1b5c6a7a152d0db8aceebf4 100644 (file)
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -68,6 +68,8 @@ int do_bootelf(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
                log_debug("Setting up FDT at 0x%08lx ...\n", fdt_addr);
                flush();
 
+               fdt_set_totalsize((void *)fdt_addr,
+                               fdt_totalsize(fdt_addr) + CONFIG_SYS_FDT_PAD);
                if (image_setup_libfdt(&img, (void *)fdt_addr, NULL))
                        return 1;
        }