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
|
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,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 */
/** @file prdfCenMba.C
* @brief Contains all common plugin code for the Centaur MBA
*/
// Framework includes
#include <iipServiceDataCollector.h>
#include <prdfExtensibleChip.H>
#include <prdfPlatServices.H>
#include <prdfPluginMap.H>
// Pegasus includes
#include <prdfCalloutUtil.H>
#include <prdfCenMbaCaptureData.H>
#include <prdfCenMbaDataBundle.H>
using namespace TARGETING;
namespace PRDF
{
using namespace PlatServices;
namespace Mba
{
// Forward Declarations
int32_t CalloutMbaAndDimm( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & i_sc, uint32_t i_port );
//##############################################################################
//
// Special plugins
//
//##############################################################################
/**
* @brief Plugin that initializes the P8 Centaur MBA data bundle.
* @param i_mbaChip A Centaur MBA chip.
* @return SUCCESS
*/
int32_t Initialize( ExtensibleChip * i_mbaChip )
{
i_mbaChip->getDataBundle() = new CenMbaDataBundle( i_mbaChip );
return SUCCESS;
}
PRDF_PLUGIN_DEFINE( Mba, Initialize );
//##############################################################################
//
// MBASPA
//
//##############################################################################
/**
* @brief MBASPA[0] - Maintenance command complete.
* @param i_mbaChip A Centaur MBA chip.
* @param i_sc The step code data struct.
* @return SUCCESS
*/
int32_t MaintCmdComplete( ExtensibleChip * i_mbaChip,
STEP_CODE_DATA_STRUCT & i_sc )
{
#define PRDF_FUNC "[Mba::MaintCmdComplete] "
int32_t l_rc = SUCCESS;
CenMbaDataBundle * mbadb = getMbaDataBundle( i_mbaChip );
// Tell the TD controller that a maintenance command complete occurred.
l_rc = mbadb->iv_tdCtlr.handleCmdCompleteEvent( i_sc );
if ( SUCCESS != l_rc )
{
PRDF_ERR( PRDF_FUNC "Failed: i_mbaChip=0x%08x", i_mbaChip->GetId() );
CalloutUtil::defaultError( i_sc );
}
// Gather capture data even if something failed above.
// NOTE: There is no need to capture if the maintenance command complete was
// successful with no errors because the error log will not be
// committed.
if ( !i_sc.service_data->IsDontCommitErrl() )
CenMbaCaptureData::addMemEccData( i_mbaChip, i_sc );
return PRD_NO_CLEAR_FIR_BITS; // FIR bits are cleared by this plugin
#undef PRDF_FUNC
}
PRDF_PLUGIN_DEFINE( Mba, MaintCmdComplete );
/**
* @brief Plugin to add MBA and Dimms behind port 0 to callout list.
* @param i_chip mba chip
* @param i_sc The step code data struct.
* @return SUCCESS
*/
int32_t CalloutMbaAndDimmOnPort0( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & i_sc )
{
return CalloutMbaAndDimm( i_chip, i_sc, 0);
}
PRDF_PLUGIN_DEFINE( Mba, CalloutMbaAndDimmOnPort0 );
/**
* @brief Plugin to add MBA and Dimms behind port 1 to callout list.
* @param i_chip mba chip
* @param i_sc The step code data struct.
* @return SUCCESS
*/
int32_t CalloutMbaAndDimmOnPort1( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & i_sc )
{
return CalloutMbaAndDimm( i_chip, i_sc, 1);
}
PRDF_PLUGIN_DEFINE( Mba, CalloutMbaAndDimmOnPort1 );
/**
* @brief Plugin to add MBA and Dimms behind given port to callout list.
* @param i_chip mba chip
* @param i_sc The step code data struct.
* @param i_port Port Number.
* @return SUCCESS
*/
int32_t CalloutMbaAndDimm( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & i_sc, uint32_t i_port )
{
using namespace TARGETING;
using namespace CalloutUtil;
int32_t o_rc = SUCCESS;
TargetHandle_t mbaTarget = i_chip->GetChipHandle();
TargetHandleList calloutList = getConnectedDimms( mbaTarget, i_port );
i_sc.service_data->SetCallout( mbaTarget, MRU_LOW );
for ( TargetHandleList::iterator it = calloutList.begin();
it != calloutList.end(); it++)
{
i_sc.service_data->SetCallout( *it,MRU_HIGH );
}
return o_rc;
}
/**
* @brief Plugin to mask the side effects of an RCD parity error
* @param i_mbaChip A Centaur MBA chip.
* @param i_sc The step code data struct.
* @return SUCCESS
*/
int32_t maskRcdParitySideEffects( ExtensibleChip * i_mbaChip,
STEP_CODE_DATA_STRUCT & i_sc )
{
#define PRDF_FUNC "[maskRcdParitySideEffects] "
int32_t l_rc = SUCCESS;
do
{
//use a data bundle to get the membuf chip
CenMbaDataBundle * mbadb = getMbaDataBundle( i_mbaChip );
ExtensibleChip * membChip = mbadb->getMembChip();
if (NULL == membChip)
{
PRDF_ERR(PRDF_FUNC "getMembChip() failed");
break;
}
//get the masks for each FIR
SCAN_COMM_REGISTER_CLASS * mbsFirMaskOr =
membChip->getRegister("MBSFIR_MASK_OR");
SCAN_COMM_REGISTER_CLASS * mbaCalMaskOr =
i_mbaChip->getRegister("MBACALFIR_MASK_OR");
SCAN_COMM_REGISTER_CLASS * mbaFirMaskOr =
i_mbaChip->getRegister("MBAFIR_MASK_OR");
mbaFirMaskOr->SetBit(2);
mbaCalMaskOr->SetBit(2);
mbaCalMaskOr->SetBit(17);
mbsFirMaskOr->SetBit(4);
l_rc = mbaFirMaskOr->Write();
l_rc |= mbaCalMaskOr->Write();
l_rc |= mbsFirMaskOr->Write();
if (SUCCESS != l_rc)
{
PRDF_ERR(PRDF_FUNC "MBAFIR_MASK_OR/MBACALFIR_MASK_OR/MBSFIR_MASK_OR"
" write failed for 0x%08x", i_mbaChip->GetId());
break;
}
}while(0);
return SUCCESS;
#undef PRDF_FUNC
}
PRDF_PLUGIN_DEFINE( Mba, maskRcdParitySideEffects );
//------------------------------------------------------------------------------
/**
* @brief When not in MNFG mode, clear the service call flag so that
* thresholding will still be done, but no visible error log committed.
* @param i_chip MBA chip
* @param i_sc Step code data struct
* @returns SUCCESS always
*/
int32_t ClearServiceCallFlag( ExtensibleChip * i_chip,
STEP_CODE_DATA_STRUCT & i_sc )
{
if ( i_sc.service_data->IsAtThreshold() && !mfgMode() )
{
i_sc.service_data->ClearFlag(ServiceDataCollector::SERVICE_CALL);
}
return SUCCESS;
}
PRDF_PLUGIN_DEFINE( Mba, ClearServiceCallFlag );
} // end namespace Mba
} // end namespace PRDF
|