aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch')
-rw-r--r--package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch32
1 files changed, 15 insertions, 17 deletions
diff --git a/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch b/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
index a96345e6fe6..28175e02e87 100644
--- a/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
+++ b/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
@@ -1,9 +1,10 @@
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
-@@ -228,6 +228,65 @@ U_BOOT_CMD(
+@@ -245,6 +245,67 @@ U_BOOT_CMD(
/* iminfo - print header info for a requested image */
/*******************************************************************/
#if defined(CONFIG_CMD_IMI)
++#if defined(CONFIG_FIT)
+#define SECTOR_SHIFT 9
+static int image_totalsize(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[], short int in_blocks)
@@ -63,12 +64,13 @@
+ "addr [maxhdrlen] [varname]\n"
+);
+
++#endif
static int do_iminfo(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
---- a/common/image-fit.c
-+++ b/common/image-fit.c
-@@ -1970,6 +1970,51 @@ static const char *fit_get_image_type_pr
+--- a/boot/image-fit.c
++++ b/boot/image-fit.c
+@@ -2051,6 +2051,47 @@ static const char *fit_get_image_type_pr
return "unknown";
}
@@ -87,16 +89,12 @@
+
+ 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);
@@ -105,7 +103,7 @@
+ 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);
+
@@ -113,16 +111,16 @@
+ }
+ }
+
++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
-@@ -1041,6 +1041,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);