chimp.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2020 Broadcom.
  4. *
  5. */
  6. #ifndef __CHIMP_H__
  7. #define __CHIMP_H__
  8. #include <linux/compiler.h>
  9. /*
  10. * Chimp binary has health status like initialization complete,
  11. * crash or running fine
  12. */
  13. #define BCM_CHIMP_RUNNIG_GOOD 0x8000
  14. enum {
  15. CHIMP_HANDSHAKE_SUCCESS = 0,
  16. CHIMP_HANDSHAKE_WAIT_ERROR,
  17. CHIMP_HANDSHAKE_WAIT_TIMEOUT,
  18. };
  19. /**
  20. * chimp_fastboot_optee() - api to load bnxt firmware
  21. *
  22. * @return: 0 on success and -ve on failure
  23. */
  24. int chimp_fastboot_optee(void);
  25. /**
  26. * chimp_health_status_optee() - get chimp health status
  27. *
  28. * Chimp health status could be firmware is in good condition or
  29. * bad condition because of crash/hang.
  30. *
  31. * @status: pointer to get chimp health status
  32. *
  33. * @return: 0 on success and -ve on failure
  34. */
  35. int chimp_health_status_optee(u32 *status);
  36. /**
  37. * chimp_handshake_status_optee() - get chimp handshake status.
  38. *
  39. * To know firmware is loaded and running.
  40. *
  41. * @timeout: timeout value, if 0 then default timeout is considered by op-tee
  42. * @hstatus: pointer to chimp handshake status
  43. *
  44. * @return: 0 on success and -ve on failure
  45. */
  46. int chimp_handshake_status_optee(u32 timeout, u32 *hstatus);
  47. #endif