summaryrefslogtreecommitdiffstats
path: root/src/include/usr/errl/errlipmi.H
blob: 836b0d1a10c9764a8ec82d767a235bb4d744728a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/include/usr/errl/errlipmi.H $                             */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2014,2015                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#ifndef ERRLIPMI_H
#define ERRLIPMI_H
/**
 *  @file errlipmi.H
 *
 *  @brief  Error Log for IPMI SEL/eSEL formats
 *
 *  This header file contains the definition of error structures for ipmi
 *
 */

/*****************************************************************************/
// I n c l u d e s
/*****************************************************************************/
#include <stdint.h>

namespace ERRORLOG
{

// per MegaRAC SP-X spec
// The size of the eSEL is configurable via PRJ
//  it can be set to 2KB per eSEL packet.
static const uint32_t ESEL_MAX_SIZE = 2 * KILOBYTE;

// per MegaRAC SP-X spec
static const uint8_t SEL_RECORD_TYPE = 0xDE;
static const uint8_t ESEL_RECORD_TYPE = 0xDF;

// per MegaRAC SP-X spec
static const uint8_t ESEL_EVENT_DATA_1 = 0xAA;


// per MegaRAC SP-X spec
static const uint16_t SEL_GENERATOR_ID = 0x2000;

// per MegaRAC SP-X spec
static const uint8_t SEL_FORMAT_VERSION = 0x04;


// per IPMI Spec, section 32.1 SEL Event Records
struct selRecord
{

    // ID used for SEL Record access. The Record ID values 0000h and FFFFh
    // have special meaning in the Event Access commands and must not be
    // used as Record ID values for stored SEL Event Records.
    uint16_t recordID;

    // [7:0] - Record Type
    //  02h     = system event record
    //  C0h-DFh = OEM timestamped, bytes 8-16 OEM defined
    //  E0h-FFh = OEM non-timestamped, bytes 4-16 OEM defined
    uint8_t record_type;

    // Time when event was logged. LS byte first.
    uint32_t timestamp;

    // RqSA & LUN if event was generated from IPMB. Software ID if event was
    // generated from system software.
    //   Byte 1
    //   [7:1] - 7-bit I2C. Slave Address, or 7-bit system software ID
    //   [0]    0b = ID is IPMB Slave Address
    //          1b = system software ID
    //   Byte 2
    //   [7:4] - Channel number. Channel that event message was received over.
    //      0h if the event message was received via the system interface,
    //      primary IPMB, or internally generated by the BMC.
    //   [3:2] - reserved. Write as 00b.
    //   [1:0] - IPMB device LUN if byte 1 holds Slave Address. 00b otherwise.
    uint16_t generator_id;

    // Event Message format version
    //  (=04h for events in this specification,
    //    03h for IPMI v1.0 Event Messages.)
    uint8_t evm_format_version;

    // Sensor Type Code for sensor that generated the event
    uint8_t sensor_type;

    // Number of sensor that generated the event
    uint8_t sensor_number;

    // Event Dir
    //   [7 ]   0b = Assertion event.
    //          1b = Deassertion event.
    // Event Type
    //      Type of trigger for the event, e.g. critical threshold going high,
    //      state asserted, etc. Also indicates class of the event. E.g.
    //      discrete, threshold, or OEM. The Event Type field is encoded
    //      using the Event/Reading Type Code.
    //   [6:0] - Event Type Code

    uint8_t event_dir_type;

    uint8_t event_data1;
    uint8_t event_data2;
    uint8_t event_data3;

    // ctor
    selRecord():
        recordID(0),
        record_type(0),
        timestamp(0),
        generator_id(SEL_GENERATOR_ID),
        evm_format_version(SEL_FORMAT_VERSION),
        sensor_type(0),
        sensor_number(0),
        event_dir_type(0),
        event_data1(0),
        event_data2(0),
        event_data3(0)
        { };

} PACKED;

} // End namespace

#endif //ERRLIPMI_H
OpenPOWER on IntegriCloud