blob: e274267196362759cc7638934bfa4fdd30a524bb [file] [log] [blame]
Bharat Kumar Reddy Gooty79e3e02a2020-08-20 20:41:06 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2020 Broadcom
4 */
5
Bharat Kumar Reddy Gooty79e3e02a2020-08-20 20:41:06 +05306#include <command.h>
7#include <broadcom/chimp.h>
8
9/* This command should be called after loading the nitro binaries */
10static 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
28U_BOOT_CMD
29 (chimp_hs, 1, 1, do_chimp_hs,
30 "Verify the Chimp handshake",
31 "chimp_hs\n"
32);