-
-static int image_info (ulong addr)
-{
- void *hdr = (void *)addr;
-
- printf ("\n## Checking Image at %08lx ...\n", addr);
-
- switch (genimg_get_format (hdr)) {
- case IMAGE_FORMAT_LEGACY:
- puts (" Legacy image found\n");
- if (!image_check_magic (hdr)) {
- puts (" Bad Magic Number\n");
- return 1;
- }
-
- if (!image_check_hcrc (hdr)) {
- puts (" Bad Header Checksum\n");
- return 1;
- }
-
- image_print_contents (hdr);
-
- puts (" Verifying Checksum ... ");
- if (!image_check_dcrc (hdr)) {
- puts (" Bad Data CRC\n");
- return 1;
- }
- puts ("OK\n");
- return 0;
-#if defined(CONFIG_FIT)
- case IMAGE_FORMAT_FIT:
- puts (" FIT image found\n");
-
- if (!fit_check_format (hdr)) {
- puts ("Bad FIT image format!\n");
- return 1;
- }
-
- fit_print_contents (hdr);
-
- if (!fit_all_image_check_hashes (hdr)) {
- puts ("Bad hash in FIT image!\n");
- return 1;
- }
-
- return 0;
-#endif
- default:
- puts ("Unknown image format!\n");
- break;
- }
-
- return 1;
-}
-