2 * Copyright 2015 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <fsl_validate.h>
11 static int do_esbc_halt(cmd_tbl_t *cmdtp, int flag, int argc,
14 printf("Core is entering spin loop.\n");
21 static int do_esbc_validate(cmd_tbl_t *cmdtp, int flag, int argc,
24 char *hash_str = NULL;
29 return cmd_usage(cmdtp);
31 /* Second arg - Optional - Hash Str*/
34 /* First argument - header address -32/64bit */
35 haddr = (uintptr_t)simple_strtoul(argv[1], NULL, 16);
37 /* With esbc_validate command, Image address must be
38 * part of header. So, the function is called
39 * by passing this argument as 0.
41 ret = fsl_secboot_validate(haddr, hash_str, 0);
45 printf("esbc_validate command successful\n");
49 /***************************************************/
50 static char esbc_validate_help_text[] =
51 "esbc_validate hdr_addr <hash_val> - Validates signature using\n"
53 " $hdr_addr Address of header of the image\n"
55 " $hash_val -Optional\n"
56 " It provides Hash of public/srk key to be\n"
57 " used to verify signature.\n";
60 esbc_validate, 3, 0, do_esbc_validate,
61 "Validates signature on a given image using RSA verification",
62 esbc_validate_help_text
66 esbc_halt, 1, 0, do_esbc_halt,
67 "Put the core in spin loop ",