ulong offset = 0;
image_header_t *hdr;
int rcode = 0;
+#if defined(CONFIG_FIT)
+ const void *fit_hdr;
+#endif
show_boot_progress (34);
switch (argc) {
case IMAGE_FORMAT_LEGACY:
hdr = (image_header_t *)addr;
- if (image_check_magic (hdr)) {
+ image_print_contents (hdr);
- image_print_contents (hdr);
-
- cnt = image_get_image_size (hdr);
- cnt -= SECTORSIZE;
- } else {
- puts ("\n** Bad Magic Number **\n");
- show_boot_progress (-39);
- return 1;
- }
+ cnt = image_get_image_size (hdr);
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
- fit_unsupported ("docboot");
- return 1;
+ fit_hdr = (const void *)addr;
+ if (!fit_check_format (fit_hdr)) {
+ puts ("** Bad FIT image format\n");
+ return 1;
+ }
+ puts ("Fit image detected...\n");
+
+ cnt = fit_get_size (fit_hdr);
+ break;
#endif
default:
+ show_boot_progress (-39);
puts ("** Unknown image type\n");
return 1;
}
show_boot_progress (39);
+ cnt -= SECTORSIZE;
if (doc_rw (doc_dev_desc + dev, 1, offset + SECTORSIZE, cnt,
NULL, (u_char *)(addr+SECTORSIZE))) {
printf ("** Read error on %d\n", dev);
}
show_boot_progress (40);
+#if defined(CONFIG_FIT)
+ /* This cannot be done earlier, we need complete FIT image in RAM first */
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+ fit_print_contents ((const void *)addr);
+#endif
+
/* Loading ok, update default load address */
load_addr = addr;
int i,nrofblk;
char *ep;
int rcode = 0;
+#if defined(CONFIG_FIT)
+ const void *fit_hdr;
+#endif
switch (argc) {
case 1:
switch (genimg_get_format ((void *)addr)) {
case IMAGE_FORMAT_LEGACY:
hdr = (image_header_t *)addr;
- if (!image_check_magic (hdr)) {
- printf ("Bad Magic Number\n");
- return 1;
- }
image_print_contents (hdr);
imsize = image_get_image_size (hdr);
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
- fit_unsupported ("fdcboot");
- return 1;
+ fit_hdr = (const void *)addr;
+ if (!fit_check_format (fit_hdr)) {
+ puts ("** Bad FIT image format\n");
+ return 1;
+ }
+ puts ("Fit image detected...\n");
+
+ imsize = fit_get_size (fit_hdr);
+ break;
#endif
default:
puts ("** Unknown image type\n");
printf("OK %ld Bytes loaded.\n",imsize);
flush_cache (addr, imsize);
- /* Loading ok, update default load address */
+#if defined(CONFIG_FIT)
+ /* This cannot be done earlier, we need complete FIT image in RAM first */
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+ fit_print_contents ((const void *)addr);
+#endif
+
+ /* 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];
disk_partition_t info;
image_header_t *hdr;
int rcode = 0;
+#if defined(CONFIG_FIT)
+ const void *fit_hdr;
+#endif
show_boot_progress (41);
switch (argc) {
case IMAGE_FORMAT_LEGACY:
hdr = (image_header_t *)addr;
- if (!image_check_magic (hdr)) {
- printf("\n** Bad Magic Number **\n");
- show_boot_progress (-49);
- return 1;
- }
show_boot_progress (49);
if (!image_check_hcrc (hdr)) {
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
- fit_unsupported ("diskboot");
- return 1;
+ fit_hdr = (const void *)addr;
+ if (!fit_check_format (fit_hdr)) {
+ puts ("** Bad FIT image format\n");
+ return 1;
+ }
+ puts ("Fit image detected...\n");
+
+ cnt = fit_get_size (fit_hdr);
+ break;
#endif
default:
+ show_boot_progress (-49);
puts ("** Unknown image type\n");
return 1;
}
}
show_boot_progress (51);
+#if defined(CONFIG_FIT)
+ /* This cannot be done earlier, we need complete FIT image in RAM first */
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+ fit_print_contents ((const void *)addr);
+#endif
/* Loading ok, update default load address */
ulong cnt;
image_header_t *hdr;
int jffs2 = 0;
+#if defined(CONFIG_FIT)
+ const void *fit_hdr;
+#endif
s = strchr(cmd, '.');
if (s != NULL &&
case IMAGE_FORMAT_LEGACY:
hdr = (image_header_t *)addr;
- if (!image_check_magic (hdr)) {
- printf("\n** Bad Magic Number 0x%x **\n",
- image_get_magic (hdr));
- show_boot_progress (-57);
- return 1;
- }
show_boot_progress (57);
-
image_print_contents (hdr);
cnt = image_get_image_size (hdr);
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
- fit_unsupported ("nand_load_image");
- return 1;
+ fit_hdr = (const void *)addr;
+ if (!fit_check_format (fit_hdr)) {
+ puts ("** Bad FIT image format\n");
+ return 1;
+ }
+ puts ("Fit image detected...\n");
+
+ cnt = fit_get_size (fit_hdr);
+ break;
#endif
default:
+ show_boot_progress (-57);
puts ("** Unknown image type\n");
return 1;
}
}
show_boot_progress (58);
+#if defined(CONFIG_FIT)
+ /* This cannot be done earlier, we need complete FIT image in RAM first */
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+ fit_print_contents ((const void *)addr);
+#endif
+
/* Loading ok, update default load address */
load_addr = addr;
ulong offset = 0;
image_header_t *hdr;
int rcode = 0;
+#if defined(CONFIG_FIT)
+ const void *fit_hdr;
+#endif
+
show_boot_progress (52);
switch (argc) {
case 1:
switch (genimg_get_format ((void *)addr)) {
case IMAGE_FORMAT_LEGACY:
hdr = (image_header_t *)addr;
+ image_print_contents (hdr);
- 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;
- }
+ cnt = image_get_image_size (hdr);
+ cnt -= SECTORSIZE;
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
- fit_unsupported ("nboot");
- return 1;
+ fit_hdr = (const void *)addr;
+ if (!fit_check_format (fit_hdr)) {
+ puts ("** Bad FIT image format\n");
+ return 1;
+ }
+ puts ("Fit image detected...\n");
+
+ cnt = fit_get_size (fit_hdr);
+ break;
#endif
default:
+ show_boot_progress (-57);
puts ("** Unknown image type\n");
return 1;
}
}
show_boot_progress (58);
+#if defined(CONFIG_FIT)
+ /* This cannot be done earlier, we need complete FIT image in RAM first */
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+ fit_print_contents ((const void *)addr);
+#endif
+
/* Loading ok, update default load address */
load_addr = addr;
disk_partition_t info;
image_header_t *hdr;
int rcode = 0;
+#if defined(CONFIG_FIT)
+ const void *fit_hdr;
+#endif
switch (argc) {
case 1:
case IMAGE_FORMAT_LEGACY:
hdr = (image_header_t *)addr;
- if (!image_check_magic (hdr)) {
- printf("\n** Bad Magic Number **\n");
- return 1;
- }
-
if (!image_check_hcrc (hdr)) {
puts ("\n** Bad Header Checksum **\n");
return 1;
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
- fit_unsupported ("scsi");
- return 1;
+ fit_hdr = (const void *)addr;
+ if (!fit_check_format (fit_hdr)) {
+ puts ("** Bad FIT image format\n");
+ return 1;
+ }
+ puts ("Fit image detected...\n");
+
+ cnt = fit_get_size (fit_hdr);
+ break;
#endif
default:
puts ("** Unknown image type\n");
printf ("** Read error on %d:%d\n", dev, part);
return 1;
}
+
+#if defined(CONFIG_FIT)
+ /* This cannot be done earlier, we need complete FIT image in RAM first */
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+ fit_print_contents ((const void *)addr);
+#endif
+
/* Loading ok, update default load address */
load_addr = addr;
disk_partition_t info;
image_header_t *hdr;
block_dev_desc_t *stor_dev;
-
+#if defined(CONFIG_FIT)
+ const void *fit_hdr;
+#endif
switch (argc) {
case 1:
case IMAGE_FORMAT_LEGACY:
hdr = (image_header_t *)addr;
- if (!image_check_magic (hdr)) {
- printf("\n** Bad Magic Number **\n");
- return 1;
- }
-
if (!image_check_hcrc (hdr)) {
puts ("\n** Bad Header Checksum **\n");
return 1;
break;
#if defined(CONFIG_FIT)
case IMAGE_FORMAT_FIT:
- fit_unsupported ("usbboot");
- return 1;
+ fit_hdr = (const void *)addr;
+ if (!fit_check_format (fit_hdr)) {
+ puts ("** Bad FIT image format\n");
+ return 1;
+ }
+ puts ("Fit image detected...\n");
+
+ cnt = fit_get_size (fit_hdr);
+ break;
#endif
default:
puts ("** Unknown image type\n");
printf ("\n** Read error on %d:%d\n", dev, part);
return 1;
}
+
+#if defined(CONFIG_FIT)
+ /* This cannot be done earlier, we need complete FIT image in RAM first */
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+ fit_print_contents ((const void *)addr);
+#endif
+
/* Loading ok, update default load address */
load_addr = addr;