Newer
Older
if (image_check_magic (hdr)) {
image_print_contents (hdr);
cnt = image_get_image_size (hdr);
cnt -= SECTORSIZE;
} else {
printf ("\n** Bad Magic Number 0x%x **\n",
image_get_magic (hdr));
show_boot_progress (-57);
return 1;
}
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
fit_unsupported ("nboot");
return 1;
#endif
default:
puts ("** Unknown image type\n");
Bartlomiej Sieka
committed
if (nand_legacy_rw (nand_dev_desc + dev, NANDRW_READ,
offset + SECTORSIZE, cnt, NULL,
(u_char *)(addr+SECTORSIZE))) {
printf ("** Read error on %d\n", dev);
/* Loading ok, update default load address */
load_addr = addr;
/* Check if we should attempt an auto-start */
if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) {
char *local_args[2];
extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
local_args[0] = argv[0];
local_args[1] = NULL;
printf ("Automatic boot of image at addr 0x%08lx ...\n", addr);
do_bootm (cmdtp, 0, 1, local_args);
rcode = 1;
}
return rcode;
}
U_BOOT_CMD(
nboot, 4, 1, do_nandboot,
"nboot - boot from NAND device\n",
"loadAddr dev\n"
);
#endif
Bartlomiej Sieka
committed
#endif /* CFG_NAND_LEGACY */