From ef47683646516002694729986d19713e49b903e3 Mon Sep 17 00:00:00 2001 From: Hannes Schmelzer Date: Tue, 20 Sep 2016 18:10:43 +0200 Subject: cmd/fdt: add possibilty to have 'extrasize' on fdt resize Sometimes devicetree nodes and or properties are added out of the u-boot console, maybe through some script or manual interaction. The devicetree as loaded or embedded is quite small, so the devicetree has to be resized to take up those new nodes/properties. In original the devicetree was only extended by effective 4 * add_mem_rsv. With this commit we can add an argument to the "fdt resize" command, which takes the extrasize to be added. Signed-off-by: Hannes Schmelzer Signed-off-by: Hannes Schmelzer Acked-by: Simon Glass --- cmd/fdt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/fdt.c b/cmd/fdt.c index 58af7727ba0..b503357dc3a 100644 --- a/cmd/fdt.c +++ b/cmd/fdt.c @@ -662,7 +662,12 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #endif /* resize the fdt */ else if (strncmp(argv[1], "re", 2) == 0) { - fdt_shrink_to_minimum(working_fdt); + uint extrasize; + if (argc > 2) + extrasize = simple_strtoul(argv[2], NULL, 16); + else + extrasize = 0; + fdt_shrink_to_minimum(working_fdt, extrasize); } else { /* Unrecognized command */ @@ -1056,7 +1061,7 @@ static char fdt_help_text[] = "fdt systemsetup - Do system-specific set up\n" #endif "fdt move - Copy the fdt to and make it active\n" - "fdt resize - Resize fdt to size + padding to 4k addr\n" + "fdt resize [] - Resize fdt to size + padding to 4k addr + some optional if needed\n" "fdt print [] - Recursive print starting at \n" "fdt list [] - Print one level starting at \n" "fdt get value - Get and store in \n" -- cgit v1.2.3