@@ -3,4 +3,5 @@
obj-$(CONFIG_CMD_BCM_LOGSETUP) += logsetup.o
obj-y += chimp_boot.o
+obj-y += chimp_handshake.o
obj-y += nitro_image_load.o
new file mode 100644
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020 Broadcom
+ */
+
+#include <brcm/chimp.h>
+#include <common.h>
+
+/* This command should be called after loading the nitro binaries */
+static int do_chimp_hs(cmd_tbl_t *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) == BCM_CHIMP_SUCCESS)
+ 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,
+ "Command to verify the Chimp hand shake",
+ "chimp_hs\n"
+);
@@ -15,6 +15,12 @@
#define BCM_CHIMP_RUNNIG_GOOD 0x8000
+enum {
+ CHIMP_HANDSHAKE_SUCCESS = 0,
+ CHIMP_HANDSHAKE_WAIT_ERROR,
+ CHIMP_HANDSHAKE_WAIT_TIMEOUT,
+};
+
#ifdef CONFIG_CHIMP_OPTEE
int chimp_fastboot_optee(void);
int chimp_health_status_optee(u32 *status);