]> git.sur5r.net Git - u-boot/blobdiff - tools/mkimage.c
usb: move CONFIG_USB_EHCI_MX7 to Kconfig
[u-boot] / tools / mkimage.c
index b407aed742afc8a07637b9d08dad8185fbdfaa3e..ff3024a8f172c8557bfaa02612d995bdcdd04f2d 100644 (file)
@@ -93,11 +93,13 @@ static void usage(const char *msg)
                "          -f => input filename for FIT source\n");
 #ifdef CONFIG_FIT_SIGNATURE
        fprintf(stderr,
-               "Signing / verified boot options: [-k keydir] [-K dtb] [ -c <comment>] [-r]\n"
+               "Signing / verified boot options: [-E] [-k keydir] [-K dtb] [ -c <comment>] [-p addr] [-r]\n"
+               "          -E => place data outside of the FIT structure\n"
                "          -k => set directory containing private keys\n"
                "          -K => write public keys to this .dtb file\n"
                "          -c => add comment in signature node\n"
                "          -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");
 #else
        fprintf(stderr,
@@ -133,12 +135,10 @@ static void process_args(int argc, char **argv)
        char *ptr;
        int type = IH_TYPE_INVALID;
        char *datafile = NULL;
-       int expecting;
        int opt;
 
-       expecting = IH_TYPE_COUNT;      /* Unknown */
        while ((opt = getopt(argc, argv,
-                            "a:A:b:cC:d:D:e:Ef:Fk:K:ln:O:rR:sT:vVx")) != -1) {
+                            "a:A:b:cC:d:D:e:Ef:Fk:K:ln:p:O:rR:qsT:vVx")) != -1) {
                switch (opt) {
                case 'a':
                        params.addr = strtoull(optarg, &ptr, 16);
@@ -154,8 +154,7 @@ static void process_args(int argc, char **argv)
                                usage("Invalid architecture");
                        break;
                case 'b':
-                       expecting = IH_TYPE_FLATDT;
-                       if (add_content(expecting, optarg)) {
+                       if (add_content(IH_TYPE_FLATDT, optarg)) {
                                fprintf(stderr,
                                        "%s: Out of memory adding content '%s'",
                                        params.cmdname, optarg);
@@ -219,6 +218,16 @@ static void process_args(int argc, char **argv)
                        if (params.os < 0)
                                usage("Invalid operating system");
                        break;
+               case 'p':
+                       params.external_offset = strtoull(optarg, &ptr, 16);
+                       if (*ptr) {
+                               fprintf(stderr, "%s: invalid offset size %s\n",
+                                       params.cmdname, optarg);
+                               exit(EXIT_FAILURE);
+                       }
+               case 'q':
+                       params.quiet = 1;
+                       break;
                case 'r':
                        params.require_keys = 1;
                        break;
@@ -238,7 +247,6 @@ static void process_args(int argc, char **argv)
                                show_image_types();
                                usage("Invalid image type");
                        }
-                       expecting = type;
                        break;
                case 'v':
                        params.vflag++;
@@ -254,7 +262,8 @@ static void process_args(int argc, char **argv)
                }
        }
 
-       if (optind < argc && expecting == type)
+       /* The last parameter is expected to be the imagefile */
+       if (optind < argc)
                params.imagefile = argv[optind];
 
        /*