Patrick Venture | 46470a3 | 2018-09-07 19:26:25 -0700 | [diff] [blame^] | 1 | #pragma once |
Tom | 9e5232e | 2016-11-07 12:14:51 +0530 | [diff] [blame] | 2 | |
| 3 | #include <stdint.h> |
| 4 | |
| 5 | // These are per skiboot ipmi-sel code |
| 6 | |
| 7 | // OEM_SEL type with Timestamp |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 8 | #define SEL_OEM_ID_0 0x55 |
Tom | 9e5232e | 2016-11-07 12:14:51 +0530 | [diff] [blame] | 9 | // SEL type is OEM and -not- general SEL |
| 10 | #define SEL_RECORD_TYPE_OEM 0xC0 |
| 11 | // Minor command for soft shurdown |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 12 | #define SOFT_OFF 0x00 |
Tom | 9e5232e | 2016-11-07 12:14:51 +0530 | [diff] [blame] | 13 | // Major command for Any kind of power ops |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 14 | #define CMD_POWER 0x04 |
Andrew Geissler | 1286637 | 2017-03-21 22:58:28 -0500 | [diff] [blame] | 15 | // Major command for the heartbeat operation (verify host is alive) |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 16 | #define CMD_HEARTBEAT 0xFF |
Tom | 9e5232e | 2016-11-07 12:14:51 +0530 | [diff] [blame] | 17 | |
| 18 | // IPMI commands used via System Interface functions. |
| 19 | enum ipmi_netfn_system_intf_cmds |
| 20 | { |
| 21 | IPMI_CMD_SET_BMC_GLOBAL_ENABLES = 0x2E, |
Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 22 | IPMI_CMD_GET_MSG_FLAGS = 0x31, |
| 23 | IPMI_CMD_READ_EVENT = 0x35, |
Tom | 9e5232e | 2016-11-07 12:14:51 +0530 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | // A Mechanism to tell host to shtudown hosts by sending this PEM SEL. Really |
| 27 | // the only used fields by skiboot are: |
| 28 | // id[0] / id[1] for ID_0 , ID_1 |
| 29 | // type : SEL_RECORD_TYPE_OEM as standard SELs are ignored by skiboot |
| 30 | // cmd : CMD_POWER for power functions |
| 31 | // data[0], specific commands. example Soft power off. power cycle, etc. |
| 32 | struct oem_sel_timestamped |
| 33 | { |
| 34 | /* SEL header */ |
| 35 | uint8_t id[2]; |
| 36 | uint8_t type; |
| 37 | uint8_t manuf_id[3]; |
| 38 | uint8_t timestamp[4]; |
| 39 | /* OEM SEL data (6 bytes) follows */ |
| 40 | uint8_t netfun; |
| 41 | uint8_t cmd; |
| 42 | uint8_t data[4]; |
| 43 | }; |