chimp_handshake.c 727 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright 2020 Broadcom
  4. */
  5. #include <common.h>
  6. #include <command.h>
  7. #include <broadcom/chimp.h>
  8. /* This command should be called after loading the nitro binaries */
  9. static int do_chimp_hs(struct cmd_tbl *cmdtp, int flag, int argc,
  10. char *const argv[])
  11. {
  12. int ret = CMD_RET_USAGE;
  13. u32 hstatus;
  14. /* Returns 1, if handshake call is success */
  15. if (chimp_handshake_status_optee(0, &hstatus))
  16. ret = CMD_RET_SUCCESS;
  17. if (hstatus == CHIMP_HANDSHAKE_SUCCESS)
  18. printf("ChiMP Handshake successful\n");
  19. else
  20. printf("ERROR: ChiMP Handshake status 0x%x\n", hstatus);
  21. return ret;
  22. }
  23. U_BOOT_CMD
  24. (chimp_hs, 1, 1, do_chimp_hs,
  25. "Verify the Chimp handshake",
  26. "chimp_hs\n"
  27. );