summaryrefslogtreecommitdiffstats
path: root/src/include/usr/hwas/common/hwasCallout.H
blob: 24f8c2adce13c49e2fe9bae5572ed538c65be833 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/include/usr/hwas/common/hwasCallout.H $                   */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2012,2013              */
/*                                                                        */
/* p1                                                                     */
/*                                                                        */
/* Object Code Only (OCO) source materials                                */
/* Licensed Internal Code Source Materials                                */
/* IBM HostBoot Licensed Internal Code                                    */
/*                                                                        */
/* The source code for this program is not published or otherwise         */
/* divested of its trade secrets, irrespective of what has been           */
/* deposited with the U.S. Copyright Office.                              */
/*                                                                        */
/* Origin: 30                                                             */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#ifndef  __HWAS_HWASCALLOUT_H
#define __HWAS_HWASCALLOUT_H
/**
 *  @file hwasCallout.H
 *
 *  HardWare Availability Service Callout prototypes.
 */


/******************************************************************************/
// Includes
/******************************************************************************/
#ifndef PARSER
#include <targeting/common/target.H>
#endif // not PARSER

namespace HWAS
{
// from hwsv/server/hwsvTypes.H:
// Legacy HOM deconfig enum
enum DeconfigEnum
{
    NO_DECONFIG,
    DECONFIG,
    DELAYED_DECONFIG,
};

// from gard/fsp/GardExtIntData.H
typedef enum {
    GARD_NULL                   = 0x00,
    GARD_Pending                = 0xE1,
    GARD_PendingCmplt           = 0xEE,
    GARD_Unrecoverable          = 0xE2,
    GARD_Fatal                  = 0xE3,
    GARD_Fabric                 = 0xE4,
    GARD_Computation            = 0xE5,
    GARD_ComputationCmplt       = 0xEC,
    GARD_Predictive             = 0xE6,
    GARD_PredictiveCmplt        = 0xE9,
    GARD_ByAssociation          = 0xE8,
    GARD_ResourceRecovery       = 0xEA,
    GARD_Cmplt                  = 0xEF,
    GARD_Func                   = 0xE7,
    GARD_FuncCmplt              = 0xEB,
    GARD_DmaRecoverable         = 0xE0,
    GARD_DmaUnrecoverable       = 0xED,
    GARD_Tod                    = 0xD0,
    GARD_TodCmplt               = 0xD1,
    GARD_Slb                    = 0xD2,
    GARD_SlbCmplt               = 0xD3,
    GARD_ProcRecoverable        = 0xD4,
    GARD_ProcRecoverableCmplt   = 0xD5,
    GARD_TimeFac                = 0xD6,
    GARD_TimeFacCmplt           = 0xD7,
    GARD_GxBusError             = 0xD8,
    GARD_PowerBusError          = 0xDA,
    GARD_Withheld               = 0xD9,
    GARD_PoreError              = 0xDC,
    GARD_NxError                = 0xDB,
    GARD_Void                   = 0xFF
} GARD_ErrorType;

// from src/epub/fsp/epub_service_codes.H
// nuVersionSID  1.24.14.36                  versionSID    1.24.14.36
    /** @enum epubProcedureID
     *  This enumeration contains all the Procedures to be used with a callout
     *  in an SRC.
     */
enum epubProcedureID
{
    EPUB_PRC_NONE                   = 0x00,
    EPUB_PRC_FIND_DECONFIGURED_PART = 0x01,
    EPUB_PRC_SP_CODE                = 0x04,
    EPUB_PRC_PHYP_CODE              = 0x05,
    EPUB_PRC_ALL_PROCS              = 0x08,
    EPUB_PRC_ALL_MEMCRDS            = 0x09,
    EPUB_PRC_INVALID_PART           = 0x0A,
    EPUB_PRC_LVL_SUPP               = 0x10,
    EPUB_PRC_PROCPATH               = 0x16,
    EPUB_PRC_NO_VPD_FOR_FRU         = 0x1C,
    EPUB_PRC_MEMORY_PLUGGING_ERROR  = 0x22,
    EPUB_PRC_FSI_PATH               = 0x2D,
    EPUB_PRC_PROC_AB_BUS            = 0x30,
    EPUB_PRC_PROC_XYZ_BUS           = 0x31,
    EPUB_PRC_MEMBUS_ERROR           = 0x34,
    EPUB_PRC_EIBUS_ERROR            = 0x37,
    EPUB_PRC_POWER_ERROR            = 0x3F,
    EPUB_PRC_PERFORMANCE_DEGRADED   = 0x4D,
    EPUB_PRC_HB_CODE                = 0x51
};

// from srci/fsp/srci.H
enum callOutPriority
{
    SRCI_PRIORITY_LOW   = 1,
    SRCI_PRIORITY_MEDC  = 2,
    SRCI_PRIORITY_MEDB  = 3,
    SRCI_PRIORITY_MEDA  = 4,
    SRCI_PRIORITY_MED   = 5,
    SRCI_PRIORITY_HIGH  = 6
};

#ifndef PARSER

/**
 *  @brief processCallout process the userdetail for a callout, calling
 *              the deconfigure and/or GARD funcationality as appropriate
 *
 *  @param[in]  i_errl Error log handle
 *  @param[in]  i_pData  Pointer to the callout bundle
 *  @param[in]  i_Size  size of the data in the callout bundle
 *
 */
void processCallout(errlHndl_t i_errl,
        uint8_t *i_pData,
        uint64_t i_Size);

// typedef for function pointer that the errlog class will use.
typedef bool (*processCalloutFn)(errlHndl_t, uint8_t *, uint64_t);
#endif // not PARSER

//
const uint8_t HW_CALLOUT        = 0x01;
const uint8_t PROCEDURE_CALLOUT = 0x02;

const uint8_t TARGET_IS_SENTINEL = 0xF0;

typedef struct callout_ud
{
    uint8_t             type;
    uint8_t             pad[3];
    callOutPriority     priority; // uint32_t
    union {
        struct {    // deconfigure / gard
            DeconfigEnum    deconfigState; // uint32_t
            GARD_ErrorType  gardErrorType; // uint32_t
            uint32_t        cpuid;
        };
        struct {    // callout
            epubProcedureID procedure;  // uint32_t
        };
    };
} callout_ud_t;

/**
 * @brief platform specific code to handle a procedure callout that has been
 *  found in an errlog
 *
 * @param[in]  i_errl       errlHndl for this errlog.
 * @param[in]  i_procedure  Enum indicating which procedure to add to the
 *                          error log
 * @param[in]  i_priority   Enum indicating the priority of the callout
 *
 * @return errlHndl_t       valid errlHndl_t handle if there was an error,
 *                          NULL if no errors;
 */
errlHndl_t platHandleProcedureCallout(errlHndl_t i_errl,
        epubProcedureID i_procedure,
        callOutPriority i_priority);

/**
 * @brief platform specific code to handle a hardware callout that has been
 *  found in an errlog
 *
 * @param[in]  i_pTarget        target
 * @param[in]  i_priority       Enum indicating the priority of the callout
 * @param[in]  i_deconfigState  Enum indicating whether to deconfig or not
 * @param[in]  i_errl           errlHnld for this errlog
 * @param[in]  i_gardErrType    Enum indicating the type of failure
 *
 * @return errlHndl_t       valid errlHndl_t handle if there was an error,
 *                          NULL if no errors;
 */
errlHndl_t platHandleHWCallout(
        TARGETING::Target *i_pTarget,
        callOutPriority i_priority,
        DeconfigEnum    i_deconfigState,
        errlHndl_t i_errl,
        GARD_ErrorType  i_gardErrorType);

};   // end namespace

#endif
OpenPOWER on IntegriCloud