video: add guards around 16bpp/32bbp code
[oweals/u-boot.git] / tools / default_image.c
index c67f66b2552eadf6dd6692a029884aeb7682f823..e164c0c27d1a757e32e0c877d2abbfed787f3ca4 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2008 Semihalf
  *
  *             some functions added to address abstraction
  *
  * All rights reserved.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include "imagetool.h"
 #include "mkimage.h"
+#include <u-boot/crc.h>
 
 #include <image.h>
 #include <tee/optee.h>
 #include <u-boot/crc.h>
+#include <imximage.h>
 
 static image_header_t header;
 
@@ -101,13 +102,15 @@ static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
                                sizeof(image_header_t)),
                        sbuf->st_size - sizeof(image_header_t));
 
-       time = imagetool_get_source_date(params, sbuf->st_mtime);
+       time = imagetool_get_source_date(params->cmdname, sbuf->st_mtime);
        ep = params->ep;
        addr = params->addr;
 
        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);