#include <linux/ctype.h>
#include <linux/err.h>
#include <u-boot/zlib.h>
+#include <mapmem.h>
DECLARE_GLOBAL_DATA_PTR;
static int image_info(ulong addr)
{
- void *hdr = (void *)addr;
+ void *hdr = (void *)map_sysmem(addr, 0);
printf("\n## Checking Image at %08lx ...\n", addr);
puts(" Legacy image found\n");
if (!image_check_magic(hdr)) {
puts(" Bad Magic Number\n");
+ unmap_sysmem(hdr);
return 1;
}
if (!image_check_hcrc(hdr)) {
puts(" Bad Header Checksum\n");
+ unmap_sysmem(hdr);
return 1;
}
puts(" Verifying Checksum ... ");
if (!image_check_dcrc(hdr)) {
puts(" Bad Data CRC\n");
+ unmap_sysmem(hdr);
return 1;
}
puts("OK\n");
+ unmap_sysmem(hdr);
return 0;
#endif
#if defined(CONFIG_ANDROID_BOOT_IMAGE)
case IMAGE_FORMAT_ANDROID:
puts(" Android image found\n");
android_print_contents(hdr);
+ unmap_sysmem(hdr);
return 0;
#endif
#if defined(CONFIG_FIT)
if (!fit_check_format(hdr)) {
puts("Bad FIT image format!\n");
+ unmap_sysmem(hdr);
return 1;
}
if (!fit_all_image_verify(hdr)) {
puts("Bad hash in FIT image!\n");
+ unmap_sysmem(hdr);
return 1;
}
+ unmap_sysmem(hdr);
return 0;
#endif
default:
break;
}
+ unmap_sysmem(hdr);
return 1;
}