From 5e218862b78068e32955e5b17b8dbbc941d71054 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Fri, 22 Feb 2019 16:28:06 +0800 Subject: Support boot Android image without address on bootm command It works perfectly fine to boot an Android boot.img with bootm command followed by an explicit address argument that holds the image. But if we have boot.img downloaded into default 'loadaddr', and then boot it using bootm command without the address argument, we will run into problem, because U-Boot fails to find ramdisk and fdt (second area) in boot.img. The current Android image support assumes there is always an address argument on bootm command. However just like booting any other images, 'loadaddr' should be used when address argument is missing from bootm command. It patches boot_get_ramdisk() and boot_get_fdt() a bit to support this quite common usage of bootm command for Android image. Signed-off-by: Shawn Guo Reviewed-by: Tom Rini --- common/image-fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/image-fdt.c') diff --git a/common/image-fdt.c b/common/image-fdt.c index 01186ae..9ed00b7 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -284,7 +284,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, *of_flat_tree = NULL; *of_size = 0; - img_addr = simple_strtoul(argv[0], NULL, 16); + img_addr = (argc == 0) ? load_addr : simple_strtoul(argv[0], NULL, 16); buf = map_sysmem(img_addr, 0); if (argc > 2) -- cgit v1.1