summaryrefslogtreecommitdiff
path: root/common/cmd_ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/cmd_ide.c')
-rw-r--r--common/cmd_ide.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index a3966435d..bef04db4f 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -446,25 +446,38 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
show_boot_progress (48);
- hdr = (image_header_t *)addr;
+ switch (gen_image_get_format ((void *)addr)) {
+ case IMAGE_FORMAT_LEGACY:
+ hdr = (image_header_t *)addr;
- if (!image_check_magic (hdr)) {
- printf("\n** Bad Magic Number **\n");
- show_boot_progress (-49);
- return 1;
- }
- show_boot_progress (49);
+ if (!image_check_magic (hdr)) {
+ printf("\n** Bad Magic Number **\n");
+ show_boot_progress (-49);
+ return 1;
+ }
+ show_boot_progress (49);
+
+ if (!image_check_hcrc (hdr)) {
+ puts ("\n** Bad Header Checksum **\n");
+ show_boot_progress (-50);
+ return 1;
+ }
+ show_boot_progress (50);
- if (!image_check_hcrc (hdr)) {
- puts ("\n** Bad Header Checksum **\n");
- show_boot_progress (-50);
+ image_print_contents (hdr);
+
+ cnt = image_get_image_size (hdr);
+ break;
+#if defined(CONFIG_FIT)
+ case IMAGE_FORMAT_FIT:
+ fit_unsupported ("diskboot");
+ return 1;
+#endif
+ default:
+ puts ("** Unknown image type\n");
return 1;
}
- show_boot_progress (50);
-
- image_print_contents (hdr);
- cnt = image_get_image_size (hdr);
cnt += info.blksz - 1;
cnt /= info.blksz;
cnt -= 1;