2 * Copyright 2015 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <fsl_validate.h>
11 int do_esbc_halt(cmd_tbl_t *cmdtp, int flag, int argc,
14 if (fsl_check_boot_mode_secure() == 0) {
15 printf("Boot Mode is Non-Secure. Not entering spin loop.\n");
19 printf("Core is entering spin loop.\n");
26 static int do_esbc_validate(cmd_tbl_t *cmdtp, int flag, int argc,
29 char *hash_str = NULL;
34 return cmd_usage(cmdtp);
36 /* Second arg - Optional - Hash Str*/
39 /* First argument - header address -32/64bit */
40 haddr = (uintptr_t)simple_strtoul(argv[1], NULL, 16);
42 /* With esbc_validate command, Image address must be
43 * part of header. So, the function is called
44 * by passing this argument as 0.
46 ret = fsl_secboot_validate(haddr, hash_str, 0);
50 printf("esbc_validate command successful\n");
54 /***************************************************/
55 static char esbc_validate_help_text[] =
56 "esbc_validate hdr_addr <hash_val> - Validates signature using\n"
58 " $hdr_addr Address of header of the image\n"
60 " $hash_val -Optional\n"
61 " It provides Hash of public/srk key to be\n"
62 " used to verify signature.\n";
65 esbc_validate, 3, 0, do_esbc_validate,
66 "Validates signature on a given image using RSA verification",
67 esbc_validate_help_text
71 esbc_halt, 1, 0, do_esbc_halt,
72 "Put the core in spin loop (Secure Boot Only)",