summaryrefslogtreecommitdiff
path: root/cmd/broadcom/chimp_handshake.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-09-10 14:37:45 -0400
committerTom Rini <trini@konsulko.com>2020-09-10 14:37:45 -0400
commit23e92c124b878e7c5d9a23c46f363874890260cf (patch)
treea8490efc9a8717fde72a1a458cfd306b4949aab5 /cmd/broadcom/chimp_handshake.c
parent2a9f9d633d2e069e5d5e7acde050b338ec803692 (diff)
parent0b65e494e98d645a500c0e378957e6dafbd3ab8f (diff)
Merge branch '2020-09-09-assorted-soc-updates' into next
- Assorted improvements for MediaTek, Broadcom NS3 and ASPEED SoCs.
Diffstat (limited to 'cmd/broadcom/chimp_handshake.c')
-rw-r--r--cmd/broadcom/chimp_handshake.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/cmd/broadcom/chimp_handshake.c b/cmd/broadcom/chimp_handshake.c
new file mode 100644
index 00000000000..a90a73a6d74
--- /dev/null
+++ b/cmd/broadcom/chimp_handshake.c
@@ -0,0 +1,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"
+);