blob: 4201c956362ea96c44ee88041d11419065faa22d [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)
12#define ESOC_WAIT_FOR_CRASH _IOR(ESOC_CODE, 6, unsigned int)
Abhimanyu Kapurc75b2e12016-02-22 18:15:13 -080013#define ESOC_REG_REQ_ENG _IO(ESOC_CODE, 7)
14#define ESOC_REG_CMD_ENG _IO(ESOC_CODE, 8)
15
16/*Link types for communication with external SOCs*/
17#define HSIC "HSIC"
18#define HSICPCIe "HSIC+PCIe"
19#define PCIe "PCIe"
20
21enum esoc_evt {
22 ESOC_RUN_STATE = 0x1,
23 ESOC_UNEXPECTED_RESET,
24 ESOC_ERR_FATAL,
25 ESOC_IN_DEBUG,
26 ESOC_REQ_ENG_ON,
27 ESOC_REQ_ENG_OFF,
28 ESOC_CMD_ENG_ON,
29 ESOC_CMD_ENG_OFF,
30 ESOC_INVALID_STATE,
31};
32
33enum esoc_cmd {
34 ESOC_PWR_ON = 1,
35 ESOC_PWR_OFF,
36 ESOC_FORCE_PWR_OFF,
37 ESOC_RESET,
38 ESOC_PREPARE_DEBUG,
39 ESOC_EXE_DEBUG,
40 ESOC_EXIT_DEBUG,
41};
42
43enum esoc_notify {
44 ESOC_IMG_XFER_DONE = 1,
45 ESOC_BOOT_DONE,
46 ESOC_BOOT_FAIL,
47 ESOC_IMG_XFER_RETRY,
48 ESOC_IMG_XFER_FAIL,
49 ESOC_UPGRADE_AVAILABLE,
50 ESOC_DEBUG_DONE,
51 ESOC_DEBUG_FAIL,
52 ESOC_PRIMARY_CRASH,
53 ESOC_PRIMARY_REBOOT,
54};
55
56enum esoc_req {
57 ESOC_REQ_IMG = 1,
58 ESOC_REQ_DEBUG,
59 ESOC_REQ_SHUTDOWN,
60};
61
62#ifdef __KERNEL__
63/**
64 * struct esoc_handle: Handle for clients of esoc
65 * @name: name of the external soc.
66 * @link: link of external soc.
67 * @id: id of external soc.
68 */
69struct esoc_handle {
70 const char *name;
71 const char *link;
72 unsigned int id;
73};
74#endif
75#endif