vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 1 | #ifndef __HOST_IPMI_APP_HANDLER_H__ |
| 2 | #define __HOST_IPMI_APP_HANDLER_H__ |
| 3 | |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 4 | #include <stdint.h> |
| 5 | |
| 6 | // These are per skiboot ipmi-sel code |
| 7 | |
| 8 | // OEM_SEL type with Timestamp |
| 9 | #define SEL_OEM_ID_0 0x55 |
| 10 | // SEL type is OEM and -not- general SEL |
| 11 | #define SEL_RECORD_TYPE_OEM 0xC0 |
| 12 | // Minor command for soft shurdown |
| 13 | #define SOFT_OFF 0x00 |
| 14 | // Major command for Any kind of power ops |
| 15 | #define CMD_POWER 0x04 |
| 16 | |
Adriana Kobylak | dfc8d77 | 2015-10-20 09:34:48 -0500 | [diff] [blame] | 17 | // IPMI commands for App net functions. |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 18 | enum ipmi_netfn_app_cmds |
| 19 | { |
| 20 | // Get capability bits |
Adriana Kobylak | dfc8d77 | 2015-10-20 09:34:48 -0500 | [diff] [blame] | 21 | IPMI_CMD_GET_DEVICE_ID = 0x01, |
| 22 | IPMI_CMD_SET_ACPI = 0x06, |
Adriana Kobylak | d100ee5 | 2015-10-20 17:02:37 -0500 | [diff] [blame] | 23 | IPMI_CMD_GET_DEVICE_GUID = 0x08, |
Adriana Kobylak | dfc8d77 | 2015-10-20 09:34:48 -0500 | [diff] [blame] | 24 | IPMI_CMD_RESET_WD = 0x22, |
| 25 | IPMI_CMD_SET_WD = 0x24, |
| 26 | IPMI_CMD_SET_BMC_GLOBAL_ENABLES = 0x2E, |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 27 | IPMI_CMD_GET_MSG_FLAGS = 0x31, |
Adriana Kobylak | dfc8d77 | 2015-10-20 09:34:48 -0500 | [diff] [blame] | 28 | IPMI_CMD_READ_EVENT = 0x35, |
| 29 | IPMI_CMD_GET_CAP_BIT = 0x36, |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 30 | }; |
| 31 | |
vishwa | 3699327 | 2015-11-20 12:43:49 -0600 | [diff] [blame] | 32 | // A Mechanism to tell host to shtudown hosts by sending this PEM SEL. Really |
| 33 | // the only used fields by skiboot are: |
| 34 | // id[0] / id[1] for ID_0 , ID_1 |
| 35 | // type : SEL_RECORD_TYPE_OEM as standard SELs are ignored by skiboot |
| 36 | // cmd : CMD_POWER for power functions |
| 37 | // data[0], specific commands. example Soft power off. power cycle, etc. |
| 38 | struct oem_sel_timestamped |
| 39 | { |
| 40 | /* SEL header */ |
| 41 | uint8_t id[2]; |
| 42 | uint8_t type; |
| 43 | uint8_t manuf_id[3]; |
| 44 | uint8_t timestamp[4]; |
| 45 | /* OEM SEL data (6 bytes) follows */ |
| 46 | uint8_t netfun; |
| 47 | uint8_t cmd; |
| 48 | uint8_t data[4]; |
| 49 | }; |
vishwabmc | ba0bd5f | 2015-09-30 16:50:23 +0530 | [diff] [blame] | 50 | #endif |