3 * DENX Software Engineering
4 * Heiko Schocher <hs@denx.de>
7 * (C) Copyright 2008 Semihalf
9 * (C) Copyright 2000-2004
10 * DENX Software Engineering
11 * Wolfgang Denk, wd@denx.de
13 * Updated-by: Prafulla Wadaskar <prafulla@marvell.com>
14 * FIT image specific code abstracted from mkimage.c
15 * some functions added to address abstraction
17 * All rights reserved.
19 * SPDX-License-Identifier: GPL-2.0+
23 #include "fit_common.h"
25 #include <u-boot/crc.h>
27 void usage(char *cmdname)
29 fprintf(stderr, "Usage: %s -f fit file -k key file\n"
30 " -f ==> set fit file which should be checked'\n"
31 " -k ==> set key file which contains the key'\n",
36 int main(int argc, char **argv)
50 strcpy(cmdname, *argv);
51 while ((c = getopt(argc, argv, "f:k:")) != -1)
64 ffd = mmap_fdt(cmdname, fdtfile, &fit_blob, &fsbuf, 0);
67 kfd = mmap_fdt(cmdname, keyfile, &key_blob, &ksbuf, 0);
71 image_set_host_blob(key_blob);
72 ret = fit_check_sign(fit_blob, key_blob);
79 (void) munmap((void *)fit_blob, fsbuf.st_size);
80 (void) munmap((void *)key_blob, ksbuf.st_size);