uboot-mediatek: update to U-Boot 2024.01 release
[openwrt/staging/dangole.git] / package / boot / uboot-mediatek / patches / 200-cmd-add-imsz-and-imszb.patch
index d725920aff4bb2a54125abdb33eb10fdc688563d..28175e02e87fd0af464014ff993b98b4e4b62841 100644 (file)
@@ -1,6 +1,6 @@
 --- a/cmd/bootm.c
 +++ b/cmd/bootm.c
-@@ -256,6 +256,67 @@ U_BOOT_CMD(
+@@ -245,6 +245,67 @@ U_BOOT_CMD(
  /* iminfo - print header info for a requested image */
  /*******************************************************************/
  #if defined(CONFIG_CMD_IMI)
@@ -70,7 +70,7 @@
  {
 --- a/boot/image-fit.c
 +++ b/boot/image-fit.c
-@@ -2031,6 +2031,51 @@ static const char *fit_get_image_type_pr
+@@ -2051,6 +2051,47 @@ static const char *fit_get_image_type_pr
        return "unknown";
  }
  
 +
 +      hdrsize = fdt_totalsize(fit);
 +
-+      /* simple FIT with internal images */
-+      if (hdrsize > 0x1000)
-+              return hdrsize;
++      /* take care of simple FIT with internal images */
++      max_size = hdrsize;
 +
 +      images_noffset = fdt_path_offset(fit, FIT_IMAGES_PATH);
-+      if (images_noffset < 0) {
-+              printf("Can't find images parent node '%s' (%s)\n",
-+              FIT_IMAGES_PATH, fdt_strerror(images_noffset));
-+              return 0;
-+      }
++      if (images_noffset < 0)
++              goto out;
 +
 +      for (ndepth = 0,
 +           noffset = fdt_next_node(fit, images_noffset, &ndepth);
 +              if (ndepth == 1) {
 +                      ret = fit_image_get_data_and_size(fit, noffset, &data, &data_size);
 +                      if (ret)
-+                              return 0;
++                              goto out;
 +
 +                      img_total = data_size + (data - fit);
 +
 +              }
 +      }
 +
++out:
 +      return max_size;
 +}
 +
-+
- int fit_image_load(bootm_headers_t *images, ulong addr,
+ int fit_image_load(struct bootm_headers *images, ulong addr,
                   const char **fit_unamep, const char **fit_uname_configp,
-                  int arch, int image_type, int bootstage_id,
+                  int arch, int ph_type, int bootstage_id,
 --- a/include/image.h
 +++ b/include/image.h
-@@ -955,6 +955,7 @@ int fit_parse_subimage(const char *spec,
+@@ -1049,6 +1049,7 @@ int fit_parse_subimage(const char *spec,
                ulong *addr, const char **image_name);
  
  int fit_get_subimage_count(const void *fit, int images_noffset);