blob: 738f73eefd354b15b3c47b540d07534ebe0ae192 [file] [log] [blame]
Vikas Gupta8ed63732020-07-15 22:57:19 +05301/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright 2020 Broadcom.
4 *
5 */
6
7#ifndef __CHIMP_H__
8#define __CHIMP_H__
9
10#include <linux/compiler.h>
11
Trac Hoang186879c2020-08-20 20:41:04 +053012/*
13 * Chimp binary has health status like initialization complete,
14 * crash or running fine
15 */
16#define BCM_CHIMP_RUNNIG_GOOD 0x8000
17
Bharat Kumar Reddy Gootya09ca682020-08-20 20:41:06 +053018enum {
19 CHIMP_HANDSHAKE_SUCCESS = 0,
20 CHIMP_HANDSHAKE_WAIT_ERROR,
21 CHIMP_HANDSHAKE_WAIT_TIMEOUT,
22};
23
Vikas Gupta8ed63732020-07-15 22:57:19 +053024/**
25 * chimp_fastboot_optee() - api to load bnxt firmware
26 *
27 * @return: 0 on success and -ve on failure
28 */
29int chimp_fastboot_optee(void);
30
31/**
32 * chimp_health_status_optee() - get chimp health status
33 *
34 * Chimp health status could be firmware is in good condition or
35 * bad condition because of crash/hang.
36 *
37 * @status: pointer to get chimp health status
38 *
39 * @return: 0 on success and -ve on failure
40 */
41int chimp_health_status_optee(u32 *status);
42
43/**
44 * chimp_handshake_status_optee() - get chimp handshake status.
45 *
46 * To know firmware is loaded and running.
47 *
48 * @timeout: timeout value, if 0 then default timeout is considered by op-tee
49 * @hstatus: pointer to chimp handshake status
50 *
51 * @return: 0 on success and -ve on failure
52 */
53int chimp_handshake_status_optee(u32 timeout, u32 *hstatus);
54
55#endif