#include <common.h>
#include <bootm.h>
#include <command.h>
-#include <environment.h>
+#include <env.h>
#include <errno.h>
#include <image.h>
#include <malloc.h>
#include <linux/ctype.h>
#include <linux/err.h>
#include <u-boot/zlib.h>
+#include <mapmem.h>
DECLARE_GLOBAL_DATA_PTR;
char *local_args[2];
local_args[0] = (char *)cmd;
local_args[1] = NULL;
- printf("Automatic boot of image at addr 0x%08lX ...\n", load_addr);
+ printf("Automatic boot of image at addr 0x%08lX ...\n",
+ image_load_addr);
return do_bootm(cmdtp, 0, 1, local_args);
}
int rcode = 0;
if (argc < 2) {
- return image_info(load_addr);
+ return image_info(image_load_addr);
}
for (arg = 1; arg < argc; ++arg) {
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);
switch (genimg_get_format(hdr)) {
-#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
+#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
case IMAGE_FORMAT_LEGACY:
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;
}
goto next_sector;
switch (genimg_get_format(hdr)) {
-#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
+#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
case IMAGE_FORMAT_LEGACY:
if (!image_check_hcrc(hdr))
goto next_sector;
}
switch (genimg_get_format(buffer)) {
-#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
+#if defined(CONFIG_LEGACY_IMAGE_FORMAT)
case IMAGE_FORMAT_LEGACY:
header = (const image_header_t *)buffer;