1 #ifndef _ESOC_CTRL_H_ 2 #define _ESOC_CTRL_H_ 3 4 #include <linux/types.h> 5 6 #define ESOC_CODE 0xCC 7 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) 12 #define ESOC_GET_ERR_FATAL _IOR(ESOC_CODE, 5, unsigned int) 13 #define ESOC_WAIT_FOR_CRASH _IOR(ESOC_CODE, 6, unsigned int) 14 #define ESOC_REG_REQ_ENG _IO(ESOC_CODE, 7) 15 #define ESOC_REG_CMD_ENG _IO(ESOC_CODE, 8) 16 #define ESOC_GET_LINK_ID _IOWR(ESOC_CODE, 9, __u64) 17 #define ESOC_SET_BOOT_FAIL_ACT _IOW(ESOC_CODE, 10, unsigned int) 18 #define ESOC_SET_N_PON_TRIES _IOW(ESOC_CODE, 11, unsigned int) 19 20 #define ESOC_REQ_SEND_SHUTDOWN ESOC_REQ_SEND_SHUTDOWN 21 #define ESOC_REQ_CRASH_SHUTDOWN ESOC_REQ_CRASH_SHUTDOWN 22 #define ESOC_PON_RETRY ESOC_PON_RETRY 23 #define ESOC_BOOT_FAIL_ACTION 24 #define ESOC_LINK_ID 25 26 enum esoc_boot_fail_action { 27 BOOT_FAIL_ACTION_RETRY, 28 BOOT_FAIL_ACTION_COLD_RESET, 29 BOOT_FAIL_ACTION_SHUTDOWN, 30 BOOT_FAIL_ACTION_PANIC, 31 BOOT_FAIL_ACTION_NOP, 32 BOOT_FAIL_ACTION_S3_RESET, 33 BOOT_FAIL_ACTION_LAST, 34 }; 35 36 enum esoc_evt { 37 ESOC_RUN_STATE = 0x1, 38 ESOC_UNEXPECTED_RESET, 39 ESOC_ERR_FATAL, 40 ESOC_IN_DEBUG, 41 ESOC_REQ_ENG_ON, 42 ESOC_REQ_ENG_OFF, 43 ESOC_CMD_ENG_ON, 44 ESOC_CMD_ENG_OFF, 45 ESOC_INVALID_STATE, 46 ESOC_RETRY_PON_EVT, 47 }; 48 49 enum esoc_cmd { 50 ESOC_PWR_ON = 1, 51 ESOC_PWR_OFF, 52 ESOC_FORCE_PWR_OFF, 53 ESOC_RESET, 54 ESOC_PREPARE_DEBUG, 55 ESOC_EXE_DEBUG, 56 ESOC_EXIT_DEBUG, 57 }; 58 59 enum esoc_notify { 60 ESOC_IMG_XFER_DONE = 1, 61 ESOC_BOOT_DONE, 62 ESOC_BOOT_FAIL, 63 ESOC_IMG_XFER_RETRY, 64 ESOC_IMG_XFER_FAIL, 65 ESOC_UPGRADE_AVAILABLE, 66 ESOC_DEBUG_DONE, 67 ESOC_DEBUG_FAIL, 68 ESOC_PRIMARY_CRASH, 69 ESOC_PRIMARY_REBOOT, 70 ESOC_PON_RETRY, 71 }; 72 73 enum esoc_req { 74 ESOC_REQ_IMG = 1, 75 ESOC_REQ_DEBUG, 76 ESOC_REQ_SHUTDOWN, 77 ESOC_REQ_SEND_SHUTDOWN, 78 ESOC_REQ_CRASH_SHUTDOWN, 79 }; 80 81 #endif 82