cmd: add resize for FDT in bootelf
PATCH 1/1 cmd: add resize for FDT in bootelf
In some FDTs, there is not enough free memory to add nodes, so this operation fails.
--- cmd/elf.c | 2 ++ 1 file changed, 2 insertions(+)
cmd/elf.c +2 -0
@@ -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 ; }
Signature · 1 line
2.39.2
Hi Maxim,
Quoted 23 lines · Maxim Moskalets
In some FDTs, there is not enough free memory to add nodes, so this operation fails.
Signed-off-by Maxim Moskalets <[email protected]>--- cmd/elf.c | 2 ++ 1 file changed, 2 insertions(+)cmd/elf.c +2
-1@@ -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 ; } --
Quoted 2 lines
2.39.2
Would you mind adding some docs for this comment in doc/usage/cmd/elf.rst ?
You can also use the 'fdt addr <addr> <size>' to expand the FDT.
Regards,
Simon
Hi Simon,
Quoted 29 lines · Simon Glass
Hi Maxim,
Quoted 22 lines · Maxim Moskalets
In some FDTs, there is not enough free memory to add nodes, so this operation fails.
Signed-off-by Maxim Moskalets <[email protected]>--- cmd/elf.c | 2 ++ 1 file changed, 2 insertions(+)cmd/elf.c +2
-1@@ -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 ; } --Quoted 2 lines
2.39.2
Reviewed-by Simon Glass <[email protected]>
Quoted 1 line
Would you mind adding some docs for this comment in
doc/usage/cmd/elf.rst?
I added the documentation, but since it's not relevant to this patch, it's in the [PATCH] doc: add bootelf command documentation
Regards,
Maxim
Quoted 4 lines
You can also use the 'fdt addr <addr> <size>' to expand the FDT.
Regards,
Simon
Quoted 4 lines · Maxim Moskalets
In some FDTs, there is not enough free memory to add nodes, so this operation fails.
Applied to u-boot/master, thanks!
Signature · 1 line
Tom