|
@@ -484,7 +484,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
|
|
image_header_t *hdr;
|
|
image_header_t *hdr;
|
|
int jffs2 = 0;
|
|
int jffs2 = 0;
|
|
#if defined(CONFIG_FIT)
|
|
#if defined(CONFIG_FIT)
|
|
- const void *fit_hdr;
|
|
|
|
|
|
+ const void *fit_hdr = NULL;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
s = strchr(cmd, '.');
|
|
s = strchr(cmd, '.');
|
|
@@ -526,12 +526,6 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
|
|
#if defined(CONFIG_FIT)
|
|
#if defined(CONFIG_FIT)
|
|
case IMAGE_FORMAT_FIT:
|
|
case IMAGE_FORMAT_FIT:
|
|
fit_hdr = (const void *)addr;
|
|
fit_hdr = (const void *)addr;
|
|
- if (!fit_check_format (fit_hdr)) {
|
|
|
|
- show_boot_progress (-150);
|
|
|
|
- puts ("** Bad FIT image format\n");
|
|
|
|
- return 1;
|
|
|
|
- }
|
|
|
|
- show_boot_progress (151);
|
|
|
|
puts ("Fit image detected...\n");
|
|
puts ("Fit image detected...\n");
|
|
|
|
|
|
cnt = fit_get_size (fit_hdr);
|
|
cnt = fit_get_size (fit_hdr);
|
|
@@ -564,8 +558,15 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
|
|
|
|
|
|
#if defined(CONFIG_FIT)
|
|
#if defined(CONFIG_FIT)
|
|
/* This cannot be done earlier, we need complete FIT image in RAM first */
|
|
/* 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);
|
|
|
|
|
|
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
|
|
|
|
+ if (!fit_check_format (fit_hdr)) {
|
|
|
|
+ show_boot_progress (-150);
|
|
|
|
+ puts ("** Bad FIT image format\n");
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+ show_boot_progress (151);
|
|
|
|
+ fit_print_contents (fit_hdr);
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/* Loading ok, update default load address */
|
|
/* Loading ok, update default load address */
|
|
@@ -952,7 +953,7 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
image_header_t *hdr;
|
|
image_header_t *hdr;
|
|
int rcode = 0;
|
|
int rcode = 0;
|
|
#if defined(CONFIG_FIT)
|
|
#if defined(CONFIG_FIT)
|
|
- const void *fit_hdr;
|
|
|
|
|
|
+ const void *fit_hdr = NULL;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
show_boot_progress (52);
|
|
show_boot_progress (52);
|
|
@@ -1021,12 +1022,6 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
#if defined(CONFIG_FIT)
|
|
#if defined(CONFIG_FIT)
|
|
case IMAGE_FORMAT_FIT:
|
|
case IMAGE_FORMAT_FIT:
|
|
fit_hdr = (const void *)addr;
|
|
fit_hdr = (const void *)addr;
|
|
- if (!fit_check_format (fit_hdr)) {
|
|
|
|
- show_boot_progress (-150);
|
|
|
|
- puts ("** Bad FIT image format\n");
|
|
|
|
- return 1;
|
|
|
|
- }
|
|
|
|
- show_boot_progress (151);
|
|
|
|
puts ("Fit image detected...\n");
|
|
puts ("Fit image detected...\n");
|
|
|
|
|
|
cnt = fit_get_size (fit_hdr);
|
|
cnt = fit_get_size (fit_hdr);
|
|
@@ -1050,8 +1045,15 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
|
|
|
|
#if defined(CONFIG_FIT)
|
|
#if defined(CONFIG_FIT)
|
|
/* This cannot be done earlier, we need complete FIT image in RAM first */
|
|
/* 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);
|
|
|
|
|
|
+ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
|
|
|
|
+ if (!fit_check_format (fit_hdr)) {
|
|
|
|
+ show_boot_progress (-150);
|
|
|
|
+ puts ("** Bad FIT image format\n");
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+ show_boot_progress (151);
|
|
|
|
+ fit_print_contents (fit_hdr);
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
|
|
|
|
/* Loading ok, update default load address */
|
|
/* Loading ok, update default load address */
|