blob: 45f3222e238248ff747fc71c7289f5277573f6fb [file] [log] [blame]
Abhimanyu Kapurc75b2e12016-02-22 18:15:13 -08001#ifndef _UAPI_ESOC_CTRL_H_
2#define _UAPI_ESOC_CTRL_H_
3
4#include <linux/types.h>
5
6#define ESOC_CODE 0xCC
7
Arun KS7bffb1f2017-02-07 18:41:25 +05308#define ESOC_CMD_EXE _IOW(ESOC_CODE, 1, unsigned int)
9#define ESOC_WAIT_FOR_REQ _IOR(ESOC_CODE, 2, unsigned int)
10#define ESOC_NOTIFY _IOW(ESOC_CODE, 3, unsigned int)
11#define ESOC_GET_STATUS _IOR(ESOC_CODE, 4, unsigned int)
Arun KS55b33a42017-01-16 15:27:48 +053012#define ESOC_GET_ERR_FATAL _IOR(ESOC_CODE, 5, unsigned int)
Arun KS7bffb1f2017-02-07 18:41:25 +053013#define ESOC_WAIT_FOR_CRASH _IOR(ESOC_CODE, 6, unsigned int)
Abhimanyu Kapurc75b2e12016-02-22 18:15:13 -080014#define ESOC_REG_REQ_ENG _IO(ESOC_CODE, 7)
15#define ESOC_REG_CMD_ENG _IO(ESOC_CODE, 8)
16
17/*Link types for communication with external SOCs*/
18#define HSIC "HSIC"
19#define HSICPCIe "HSIC+PCIe"
20#define PCIe "PCIe"
Arun KS35fa1602017-03-02 18:12:54 +053021#define ESOC_REQ_SEND_SHUTDOWN ESOC_REQ_SEND_SHUTDOWN
Abhimanyu Kapurc75b2e12016-02-22 18:15:13 -080022
23enum esoc_evt {
24 ESOC_RUN_STATE = 0x1,
25 ESOC_UNEXPECTED_RESET,
26 ESOC_ERR_FATAL,
27 ESOC_IN_DEBUG,
28 ESOC_REQ_ENG_ON,
29 ESOC_REQ_ENG_OFF,
30 ESOC_CMD_ENG_ON,
31 ESOC_CMD_ENG_OFF,
32 ESOC_INVALID_STATE,
33};
34
35enum esoc_cmd {
36 ESOC_PWR_ON = 1,
37 ESOC_PWR_OFF,
38 ESOC_FORCE_PWR_OFF,
39 ESOC_RESET,
40 ESOC_PREPARE_DEBUG,
41 ESOC_EXE_DEBUG,
42 ESOC_EXIT_DEBUG,
43};
44
45enum esoc_notify {
46 ESOC_IMG_XFER_DONE = 1,
47 ESOC_BOOT_DONE,
48 ESOC_BOOT_FAIL,
49 ESOC_IMG_XFER_RETRY,
50 ESOC_IMG_XFER_FAIL,
51 ESOC_UPGRADE_AVAILABLE,
52 ESOC_DEBUG_DONE,
53 ESOC_DEBUG_FAIL,
54 ESOC_PRIMARY_CRASH,
55 ESOC_PRIMARY_REBOOT,
56};
57
58enum esoc_req {
59 ESOC_REQ_IMG = 1,
60 ESOC_REQ_DEBUG,
61 ESOC_REQ_SHUTDOWN,
Arun KS35fa1602017-03-02 18:12:54 +053062 ESOC_REQ_SEND_SHUTDOWN,
Abhimanyu Kapurc75b2e12016-02-22 18:15:13 -080063};
64
65#ifdef __KERNEL__
66/**
67 * struct esoc_handle: Handle for clients of esoc
68 * @name: name of the external soc.
69 * @link: link of external soc.
70 * @id: id of external soc.
71 */
72struct esoc_handle {
73 const char *name;
74 const char *link;
75 unsigned int id;
76};
77#endif
78#endif