summaryrefslogtreecommitdiff
path: root/tools/default_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/default_image.c')
-rw-r--r--tools/default_image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/default_image.c b/tools/default_image.c
index 4b7d1ed4a1..f7990e28c0 100644
--- a/tools/default_image.c
+++ b/tools/default_image.c
@@ -19,6 +19,7 @@
#include <image.h>
#include <tee/optee.h>
#include <u-boot/crc.h>
+#include <imximage.h>
static image_header_t header;
@@ -106,7 +107,9 @@ static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
if (params->type == IH_TYPE_FIRMWARE_IVT)
/* Add size of CSF minus IVT */
- imagesize = sbuf->st_size - sizeof(image_header_t) + 0x1FE0;
+ imagesize = sbuf->st_size - sizeof(image_header_t)
+ + 0x2060 - sizeof(flash_header_v2_t);
+
else
imagesize = sbuf->st_size - sizeof(image_header_t);