Add support to check chimp handshake status.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokata...@broadcom.com>
---
 board/broadcom/bcmns3/ns3.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/board/broadcom/bcmns3/ns3.c b/board/broadcom/bcmns3/ns3.c
index e8f1d1b199..791baa904e 100644
--- a/board/broadcom/bcmns3/ns3.c
+++ b/board/broadcom/bcmns3/ns3.c
@@ -12,6 +12,7 @@
 #include <asm/gic-v3.h>
 #include <asm/system.h>
 #include <dm/device.h>
+#include <brcm/chimp.h>
 #include <dm/uclass.h>
 #include <dt-bindings/memory/bcm-ns3-mc.h>
 #include <fdtdec.h>
@@ -240,10 +241,21 @@ static int start_wdt(void)
 
 int ft_board_setup(void *fdt, bd_t *bd)
 {
-       gic_lpi_tables_init(BCM_NS3_GIC_LPI_BASE, MAX_GIC_REDISTRIBUTORS);
+       u32 chimp_hs;
 
+       gic_lpi_tables_init(BCM_NS3_GIC_LPI_BASE, MAX_GIC_REDISTRIBUTORS);
        mem_info_parse_fixup(fdt);
 
+       /*
+        * check for chimp handshake status. 0 timeout value will actually
+        * fall to default timeout value
+        */
+       chimp_handshake_status_optee(0, &chimp_hs);
+       if (chimp_hs == CHIMP_HANDSHAKE_SUCCESS)
+               printf("ChiMP Handshake successful\n");
+       else
+               printf("ERROR: ChiMP Handshake status 0x%x\n", chimp_hs);
+
        start_wdt();
 
        return 0;
-- 
2.17.1

Reply via email to