summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/plugins/prdfPfa5Data.h
blob: a26c86ca5ec3bc917a37590ddfbc59832f0baff6 (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/common/plugins/prdfPfa5Data.h $             */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2013,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                                                     */

#if !defined(prdfPfa5Data_h)
#define prdfPfa5Data_h
/**
 @file prdfPfa5Data.h
 @brief Version 5 format of the Pfa Data
*/

#include <iipconst.h>
#include <utilstream.H>
#include <string.h>

namespace PRDF
{
#ifdef PRDF_HOSTBOOT_ERRL_PLUGIN
namespace HOSTBOOT
{
#endif

#ifdef PRDF_FSP_ERRL_PLUGIN
namespace FSP
{
#endif

const uint32_t PFA5_Format = 0x50464135;

const uint32_t MruListLIMIT  = 8;
const uint32_t SigListLIMIT  = 8;

// Size of PRD Capture Data
#ifdef __HOSTBOOT_MODULE
// Total error log size for Hostboot error logs is 4K.
const uint32_t CaptureDataSize = 2048;
#else
const uint32_t CaptureDataSize = 4096*2;
#endif
enum ErrlVersion
{
    ErrlVer1    = 1,
    ErrlVer2    = 2,
};

enum ErrlSubsect
{
    ErrlSectPFA5_1   = 51,
    ErrlSectPFA5_2   = 52,
    ErrlCapData_1    = 1,
    ErrlCapData_2    = 2,
    ErrlMruData_1    = 61, // This will only be used in non-attenion code when
                           // we want to add MRU.
    ErrlMruData_2    = 62, // For the 80 byte centaur DQ pin map
    ErrlString       = 10,
};

struct MsDumpStruct
{
    int32_t content;
    HUID    id;

    friend UtilStream& operator<<( UtilStream& i_left, MsDumpStruct& i_right )
    {
        i_left << i_right.content << i_right.id;
        return i_left;
    };

    friend UtilStream& operator>>( UtilStream& i_left, MsDumpStruct& i_right )
    {
        i_left >> i_right.content >>i_right.id;
        return i_left;
    };
};

struct PfaMruListStruct
{
    uint32_t callout;  // 32-bit representation of HUID, MemoryMru, symbolic FRU
    uint8_t  type;     // See enum PRDcallout::MruType
    uint8_t  priority; // See enum srciPriority (in srci/fsp/srci.H)
    uint8_t  gardState;

    friend UtilStream& operator<<( UtilStream& i_left,
                                   PfaMruListStruct& i_right )
    {
        i_left << i_right.callout << i_right.type << i_right.priority
               << i_right.gardState;

        return i_left;
    };

    friend UtilStream& operator>>( UtilStream& i_left,
                                   PfaMruListStruct& i_right )
    {
        i_left >> i_right.callout >> i_right.type >> i_right.priority
               >> i_right.gardState;

        return i_left;
    };
};

struct PfaSigListStruct
{
    HUID     chipId;
    uint32_t signature;

    friend UtilStream& operator<<( UtilStream& i_left,
                                   PfaSigListStruct& i_right )
    {
        i_left << i_right.chipId << i_right.signature;
        return i_left;
    };

    friend UtilStream& operator>>( UtilStream& i_left,
                                   PfaSigListStruct& i_right )
    {
        i_left >> i_right.chipId >> i_right.signature;
        return i_left;
    };
};

struct PfaData
{
    // Dump info
    // NOTE: The msDumpLabel and its information must be first in this
    //       structure. ATTN handling is dependent on this ordering.
    uint32_t     msDumpLabel[2];
    MsDumpStruct msDumpInfo;

    // Error log actions and severity
    uint32_t errlActions          :16, // See enum errlActions (in errltypes.H)
             errlSeverity         : 8, // See enum errlSeverity (in errltypes.H)
             serviceActionCounter : 8; // Number of service actions requested
                                       // by PRD.

    // PRD Service Data Collector Flags (1:true, 0:false)
    uint32_t DUMP                 :1,
             UERE                 :1,
             SUE                  :1,
             AT_THRESHOLD         :1,
             DEGRADED             :1,
             SERVICE_CALL         :1,
             TRACKIT              :1,
             TERMINATE            :1,
             LOGIT                :1,
             UNIT_CHECKSTOP       :1,
             USING_SAVED_SDC      :1,
             LAST_CORE_TERMINATE  :1,
             DEFER_DECONFIG       :1,
             SECONDARY_ERROR      :1,
             Reserved             :18;

    // Thresholding
    uint32_t errorCount :16, // Number of occurrences of this attention
             threshold  :16; // Threshold for this attention

    // Attention types and GARD state.
    uint32_t priAttnType    : 8, // primary attention type
             secAttnType    : 8, // secondary attention type
             prdGardErrType : 8, // See enum GardResolution::ErrorType
             unUsed         : 8;

    uint32_t mruListCount;                  // Total number of MRUs.
    PfaMruListStruct mruList[MruListLIMIT]; // Full list of MRUs.

    uint32_t sigListCount;                  // Total number of multi-signatures.
    PfaSigListStruct sigList[SigListLIMIT]; // Full list of multi-signatures.

    /**
     * @brief Default constructor
     */
    PfaData()
    {
        memset( &mruList[0],  0x00, sizeof(PfaMruListStruct)  * MruListLIMIT  );
        memset( &sigList[0],  0x00, sizeof(PfaSigListStruct)  * SigListLIMIT  );
    }

    friend UtilStream& operator<<(UtilStream& i_left, PfaData& i_right)
    {
        i_left << i_right.msDumpLabel[0] << i_right.msDumpLabel[1]
               << i_right.msDumpInfo;

        i_left << ( (i_right.errlActions          << 16) |
                    (i_right.errlSeverity         <<  8) |
                    (i_right.serviceActionCounter      ) );

        i_left << ( (i_right.DUMP                 << 31) |
                    (i_right.UERE                 << 30) |
                    (i_right.SUE                  << 29) |
                    (i_right.AT_THRESHOLD         << 28) |
                    (i_right.DEGRADED             << 27) |
                    (i_right.SERVICE_CALL         << 26) |
                    (i_right.TRACKIT              << 25) |
                    (i_right.TERMINATE            << 24) |
                    (i_right.LOGIT                << 23) |
                    // FYI, two deprecated entries were removed. To make the
                    // parser compatible with older or newer error logs, these
                    // bits must remain a hole (i.e. it can be reused, but
                    // subsequent data must remain in the bit positions that
                    // they are currently in).
                    (i_right.UNIT_CHECKSTOP       << 20) |
                    (i_right.USING_SAVED_SDC      << 19) |
                    (i_right.LAST_CORE_TERMINATE  << 18) |
                    (i_right.DEFER_DECONFIG       << 17) |
                    (i_right.SECONDARY_ERROR      << 16) |
                    (i_right.Reserved                  ) );

        i_left << ( (i_right.errorCount << 16) |
                    (i_right.threshold       ) );

        i_left << ( (i_right.priAttnType    << 24) |
                    (i_right.secAttnType    << 16) |
                    (i_right.prdGardErrType <<  8) |
                    (i_right.unUsed              ) );

        i_left << i_right.mruListCount;
        for ( uint32_t i = 0; i < i_right.mruListCount; i++ )
            i_left << i_right.mruList[i];

        i_left << i_right.sigListCount;
        for ( uint32_t i = 0; i < i_right.sigListCount; i++ )
            i_left << i_right.sigList[i];

        return i_left;
    };

    friend UtilStream& operator>>(UtilStream& i_left, PfaData& i_right)
    {
        uint32_t l_tmp[5];
        i_left >> i_right.msDumpLabel[0] >> i_right.msDumpLabel[1]
               >> i_right.msDumpInfo
               >> l_tmp[1]
               >> l_tmp[2]
               >> l_tmp[3]
               >> l_tmp[4];

        i_right.errlActions          = (l_tmp[1] >> 16) & 0xFFFF;
        i_right.errlSeverity         = (l_tmp[1] >>  8) & 0xFF;
        i_right.serviceActionCounter = (l_tmp[1]      ) & 0xFF;

        i_right.DUMP                = (l_tmp[2] >> 31) & 0x01;
        i_right.UERE                = (l_tmp[2] >> 30) & 0x01;
        i_right.SUE                 = (l_tmp[2] >> 29) & 0x01;
        i_right.AT_THRESHOLD        = (l_tmp[2] >> 28) & 0x01;
        i_right.DEGRADED            = (l_tmp[2] >> 27) & 0x01;
        i_right.SERVICE_CALL        = (l_tmp[2] >> 26) & 0x01;
        i_right.TRACKIT             = (l_tmp[2] >> 25) & 0x01;
        i_right.TERMINATE           = (l_tmp[2] >> 24) & 0x01;
        i_right.LOGIT               = (l_tmp[2] >> 23) & 0x01;
        // FYI, two deprecated entries were removed. To make the parser
        // compatible with older or newer error logs, these bits must remain a
        // hole (i.e. it can be reused, but subsequent data must remain in the
        // bit positions that they are currently in).
        i_right.UNIT_CHECKSTOP      = (l_tmp[2] >> 20) & 0x01;
        i_right.USING_SAVED_SDC     = (l_tmp[2] >> 19) & 0x01;
        i_right.LAST_CORE_TERMINATE = (l_tmp[2] >> 18) & 0x01;
        i_right.DEFER_DECONFIG      = (l_tmp[2] >> 17) & 0x01;
        i_right.SECONDARY_ERROR     = (l_tmp[2] >> 16) & 0x01;

        i_right.errorCount = (l_tmp[3] >> 16) & 0xFFFF;
        i_right.threshold  = (l_tmp[3]      ) & 0xFFFF;

        i_right.priAttnType    = (l_tmp[4] >> 24) & 0xFF;
        i_right.secAttnType    = (l_tmp[4] >> 16) & 0xFF;
        i_right.prdGardErrType = (l_tmp[4] >>  8) & 0xFF;

        i_left >> i_right.mruListCount;
        for ( uint32_t i = 0; i < i_right.mruListCount; i++ )
            i_left >> i_right.mruList[i];

        i_left >> i_right.sigListCount;
        for ( uint32_t i = 0; i < i_right.sigListCount; i++ )
            i_left >> i_right.sigList[i];

        return i_left;
    };

};

struct CaptureDataClass
{
  uint32_t PfaCaptureDataSize;
  uint8_t CaptureData[CaptureDataSize]; // MAKMAK Can this be variable size?
};

#ifdef PRDF_HOSTBOOT_ERRL_PLUGIN
} // end namespace HOSTBOOT
#endif

#ifdef PRDF_FSP_ERRL_PLUGIN
} // end namespace FSP
#endif
} // end namespace PRDF

#endif // prdfPfa5Data_h
OpenPOWER on IntegriCloud