summaryrefslogtreecommitdiffstats
path: root/cmd/broadcom/chimp_handshake.c
blob: a90a73a6d749077628a11ee6c3bea5e625146d28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright 2020 Broadcom
 */

#include <common.h>
#include <command.h>
#include <broadcom/chimp.h>

/* This command should be called after loading the nitro binaries */
static int do_chimp_hs(struct cmd_tbl *cmdtp, int flag, int argc,
		       char *const argv[])
{
	int ret = CMD_RET_USAGE;
	u32 hstatus;

	/* Returns 1, if handshake call is success */
	if (chimp_handshake_status_optee(0, &hstatus))
		ret = CMD_RET_SUCCESS;

	if (hstatus == CHIMP_HANDSHAKE_SUCCESS)
		printf("ChiMP Handshake successful\n");
	else
		printf("ERROR: ChiMP Handshake status 0x%x\n", hstatus);

	return ret;
}

U_BOOT_CMD
	(chimp_hs, 1, 1, do_chimp_hs,
	 "Verify the Chimp handshake",
	 "chimp_hs\n"
);