#include <command.h>
#include <malloc.h>
#include <asm/io.h>
-
-#if (CONFIG_COMMANDS & CFG_CMD_DOC)
-
#include <linux/mtd/nftl.h>
#include <linux/mtd/doc2000.h>
}
show_boot_progress (38);
- hdr = (image_header_t *)addr;
+ switch (genimg_get_format ((void *)addr)) {
+ case IMAGE_FORMAT_LEGACY:
+ hdr = (image_header_t *)addr;
- if (hdr->ih_magic == IH_MAGIC) {
+ if (image_check_magic (hdr)) {
- print_image_hdr (hdr);
+ image_print_contents (hdr);
- cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
- cnt -= SECTORSIZE;
- } else {
- puts ("\n** Bad Magic Number **\n");
- show_boot_progress (-39);
+ cnt = image_get_image_size (hdr);
+ cnt -= SECTORSIZE;
+ } else {
+ puts ("\n** Bad Magic Number **\n");
+ show_boot_progress (-39);
+ return 1;
+ }
+ break;
+#if defined(CONFIG_FIT)
+ case IMAGE_FORMAT_FIT:
+ fit_unsupported ("docboot");
+ return 1;
+#endif
+ default:
+ puts ("** Unknown image type\n");
return 1;
}
show_boot_progress (39);
puts ("No DiskOnChip found\n");
}
}
-
-#endif /* (CONFIG_COMMANDS & CFG_CMD_DOC) */