[U-Boot] [patch] Print image address the bootm command assumed when it complains about wrong image format.

If the error "Wrong Image Format for bootm command" is displayed, it helps debugging if the address is printed where it assumed the image to be.
Signed-off-by: Remy Bohmer linux@bohmer.net --- common/cmd_bootm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Index: u-boot-usb.new/common/cmd_bootm.c =================================================================== --- u-boot-usb.new.orig/common/cmd_bootm.c 2008-12-04 21:59:18.000000000 +0100 +++ u-boot-usb.new/common/cmd_bootm.c 2008-12-04 22:04:06.000000000 +0100 @@ -347,7 +347,8 @@ static int bootm_load_os(image_info_t os puts("OK\n"); break; case IH_COMP_GZIP: - printf (" Uncompressing %s ... ", type_name); + printf(" Uncompressing %s ... from:0x%x(0x%x) to 0x%lx", + type_name, (unsigned int)image_start, unc_len, load); if (gunzip ((void *)load, unc_len, (uchar *)image_start, &image_len) != 0) { puts ("GUNZIP: uncompress or overwrite error " @@ -900,7 +901,8 @@ static void *boot_get_kernel (cmd_tbl_t break; #endif default: - printf ("Wrong Image Format for %s command\n", cmdtp->name); + printf("Wrong Image Format at addr:0x%08lx for %s command\n", + img_addr, cmdtp->name); show_boot_progress (-108); return NULL; }

Dear Remy Bohmer,
In message 49384d33.130c420a.602f.ffff8592@mx.google.com you wrote:
If the error "Wrong Image Format for bootm command" is displayed, it helps debugging if the address is printed where it assumed the image to be.
Signed-off-by: Remy Bohmer linux@bohmer.net
common/cmd_bootm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Index: u-boot-usb.new/common/cmd_bootm.c
--- u-boot-usb.new.orig/common/cmd_bootm.c 2008-12-04 21:59:18.000000000 +0100 +++ u-boot-usb.new/common/cmd_bootm.c 2008-12-04 22:04:06.000000000 +0100 @@ -347,7 +347,8 @@ static int bootm_load_os(image_info_t os puts("OK\n"); break; case IH_COMP_GZIP:
printf (" Uncompressing %s ... ", type_name);
printf(" Uncompressing %s ... from:0x%x(0x%x) to 0x%lx",
Please do not change coding style within a file. All the rest of this file uses a space between the function name and the (, so please keep that.
Also, the "..." are intended to mean "this is running now, please wait", and thus should be at the end of the line.
type_name, (unsigned int)image_start, unc_len, load);
You mention that this is a debug help, so you probably want to make it depend of DEBUG ?
default:
printf ("Wrong Image Format for %s command\n", cmdtp->name);
printf("Wrong Image Format at addr:0x%08lx for %s command\n",
img_addr, cmdtp->name);
See above about coding style.
I don't really understand why this is needed. You know where your images are, don't you?
Best regards,
Wolfgang Denk
participants (2)
-
Remy Bohmer
-
Wolfgang Denk