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