travis: Split bcm SoCs into their own build job
[oweals/u-boot.git] / tools / mkimage.c
index 38805f0c9263773419eefa51207f94b6f8c1b88d..42171883109480524c4d0d8c4ffd2f2be5d12359 100644 (file)
@@ -105,7 +105,7 @@ static void usage(const char *msg)
                "          -F => re-sign existing FIT image\n"
                "          -p => place external data at a static position\n"
                "          -r => mark keys used as 'required' in dtb\n"
-               "          -N => engine to use for signing (pkcs11)\n");
+               "          -N => openssl engine to use for signing\n");
 #else
        fprintf(stderr,
                "Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)\n");
@@ -403,14 +403,21 @@ int main(int argc, char **argv)
                        exit (EXIT_FAILURE);
                }
 
-               /*
-                * scan through mkimage registry for all supported image types
-                * and verify the input image file header for match
-                * Print the image information for matched image type
-                * Returns the error code if not matched
-                */
-               retval = imagetool_verify_print_header(ptr, &sbuf,
-                               tparams, &params);
+               if (params.fflag) {
+                       /*
+                        * Verifies the header format based on the expected header for image
+                        * type in tparams
+                        */
+                       retval = imagetool_verify_print_header_by_type(ptr, &sbuf,
+                                       tparams, &params);
+               } else {
+                       /**
+                        * When listing the image, we are not given the image type. Simply check all
+                        * image types to find one that matches our header
+                        */
+                       retval = imagetool_verify_print_header(ptr, &sbuf,
+                                       tparams, &params);
+               }
 
                (void) munmap((void *)ptr, sbuf.st_size);
                (void) close (ifd);
@@ -530,6 +537,13 @@ int main(int argc, char **argv)
                        ret = imx8image_copy_image(ifd, &params);
                        if (ret)
                                return ret;
+               } else if (params.type == IH_TYPE_IMX8MIMAGE) {
+                       /* i.MX8M has special Image format */
+                       int ret;
+
+                       ret = imx8mimage_copy_image(ifd, &params);
+                       if (ret)
+                               return ret;
                } else {
                        copy_file(ifd, params.datafile, pad_len);
                }