diff options
author | Simon Glass <sjg@chromium.org> | 2016-02-22 22:55:36 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-03-14 14:19:11 -0400 |
commit | b0a487a4eb6c1e2214022f927cb3229f2323db44 (patch) | |
tree | d9b3f105f624af457037d16610bb71e24e4fef84 | |
parent | 0745008145e0a30db06b21533512893ba0f706a2 (diff) | |
download | u-boot-imx-b0a487a4eb6c1e2214022f927cb3229f2323db44.zip u-boot-imx-b0a487a4eb6c1e2214022f927cb3229f2323db44.tar.gz u-boot-imx-b0a487a4eb6c1e2214022f927cb3229f2323db44.tar.bz2 |
mkimage: Move usage() up to the top
To avoid a forward declaration, move the usage() function higher in the
file.
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | tools/mkimage.c | 81 |
1 files changed, 42 insertions, 39 deletions
diff --git a/tools/mkimage.c b/tools/mkimage.c index 89d3c97..1cc3a63 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -13,7 +13,6 @@ #include <version.h> static void copy_file(int, const char *, int); -static void usage(void); /* parameters initialized by core will be used by the image type code */ struct image_tool_params params = { @@ -67,6 +66,48 @@ static void show_image_types(void) fprintf(stderr, "\n"); } +static void usage(void) +{ + fprintf(stderr, "Usage: %s -l image\n" + " -l ==> list image header information\n", + params.cmdname); + fprintf(stderr, + " %s [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image\n" + " -A ==> set architecture to 'arch'\n" + " -O ==> set operating system to 'os'\n" + " -T ==> set image type to 'type'\n" + " -C ==> set compression type 'comp'\n" + " -a ==> set load address to 'addr' (hex)\n" + " -e ==> set entry point to 'ep' (hex)\n" + " -n ==> set image name to 'name'\n" + " -d ==> use image data from 'datafile'\n" + " -x ==> set XIP (execute in place)\n", + params.cmdname); + fprintf(stderr, + " %s [-D dtc_options] [-f fit-image.its|-F] fit-image\n", + params.cmdname); + fprintf(stderr, + " -D => set all options for device tree compiler\n" + " -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" + " -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" + " -r => mark keys used as 'required' in dtb\n"); +#else + fprintf(stderr, + "Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)\n"); +#endif + fprintf(stderr, " %s -V ==> print version information and exit\n", + params.cmdname); + fprintf(stderr, "Use -T to see a list of available image types\n"); + + exit(EXIT_FAILURE); +} + static void process_args(int argc, char **argv) { char *ptr; @@ -556,41 +597,3 @@ copy_file (int ifd, const char *datafile, int pad) (void) munmap((void *)ptr, sbuf.st_size); (void) close (dfd); } - -static void usage(void) -{ - fprintf (stderr, "Usage: %s -l image\n" - " -l ==> list image header information\n", - params.cmdname); - fprintf (stderr, " %s [-x] -A arch -O os -T type -C comp " - "-a addr -e ep -n name -d data_file[:data_file...] image\n" - " -A ==> set architecture to 'arch'\n" - " -O ==> set operating system to 'os'\n" - " -T ==> set image type to 'type'\n" - " -C ==> set compression type 'comp'\n" - " -a ==> set load address to 'addr' (hex)\n" - " -e ==> set entry point to 'ep' (hex)\n" - " -n ==> set image name to 'name'\n" - " -d ==> use image data from 'datafile'\n" - " -x ==> set XIP (execute in place)\n", - params.cmdname); - fprintf(stderr, " %s [-D dtc_options] [-f fit-image.its|-F] fit-image\n", - params.cmdname); - fprintf(stderr, " -D => set all options for device tree compiler\n" - " -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" - " -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" - " -r => mark keys used as 'required' in dtb\n"); -#else - fprintf(stderr, "Signing / verified boot not supported (CONFIG_FIT_SIGNATURE undefined)\n"); -#endif - fprintf (stderr, " %s -V ==> print version information and exit\n", - params.cmdname); - fprintf(stderr, "Use -T to see a list of available image types\n"); - - exit (EXIT_FAILURE); -} |