Abhimanyu Kapur | c75b2e1 | 2016-02-22 18:15:13 -0800 | [diff] [blame] | 1 | #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 KS | 7bffb1f | 2017-02-07 18:41:25 +0530 | [diff] [blame] | 8 | #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 KS | 55b33a4 | 2017-01-16 15:27:48 +0530 | [diff] [blame] | 12 | #define ESOC_GET_ERR_FATAL _IOR(ESOC_CODE, 5, unsigned int) |
Arun KS | 7bffb1f | 2017-02-07 18:41:25 +0530 | [diff] [blame] | 13 | #define ESOC_WAIT_FOR_CRASH _IOR(ESOC_CODE, 6, unsigned int) |
Abhimanyu Kapur | c75b2e1 | 2016-02-22 18:15:13 -0800 | [diff] [blame] | 14 | #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 KS | 35fa160 | 2017-03-02 18:12:54 +0530 | [diff] [blame] | 21 | #define ESOC_REQ_SEND_SHUTDOWN ESOC_REQ_SEND_SHUTDOWN |
Abhimanyu Kapur | c75b2e1 | 2016-02-22 18:15:13 -0800 | [diff] [blame] | 22 | |
| 23 | enum 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 | |
| 35 | enum 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 | |
| 45 | enum 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 | |
| 58 | enum esoc_req { |
| 59 | ESOC_REQ_IMG = 1, |
| 60 | ESOC_REQ_DEBUG, |
| 61 | ESOC_REQ_SHUTDOWN, |
Arun KS | 35fa160 | 2017-03-02 18:12:54 +0530 | [diff] [blame] | 62 | ESOC_REQ_SEND_SHUTDOWN, |
Abhimanyu Kapur | c75b2e1 | 2016-02-22 18:15:13 -0800 | [diff] [blame] | 63 | }; |
| 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 | */ |
| 72 | struct esoc_handle { |
| 73 | const char *name; |
| 74 | const char *link; |
| 75 | unsigned int id; |
| 76 | }; |
| 77 | #endif |
| 78 | #endif |