1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright 2020 Broadcom
4  */
5 
6 #include <command.h>
7 #include <broadcom/chimp.h>
8 
9 /* This command should be called after loading the nitro binaries */
do_chimp_hs(struct cmd_tbl * cmdtp,int flag,int argc,char * const argv[])10 static int do_chimp_hs(struct cmd_tbl *cmdtp, int flag, int argc,
11 		       char *const argv[])
12 {
13 	int ret = CMD_RET_USAGE;
14 	u32 hstatus;
15 
16 	/* Returns 1, if handshake call is success */
17 	if (chimp_handshake_status_optee(0, &hstatus))
18 		ret = CMD_RET_SUCCESS;
19 
20 	if (hstatus == CHIMP_HANDSHAKE_SUCCESS)
21 		printf("ChiMP Handshake successful\n");
22 	else
23 		printf("ERROR: ChiMP Handshake status 0x%x\n", hstatus);
24 
25 	return ret;
26 }
27 
28 U_BOOT_CMD
29 	(chimp_hs, 1, 1, do_chimp_hs,
30 	 "Verify the Chimp handshake",
31 	 "chimp_hs\n"
32 );
33