summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/plat/p9/prdfP9Obus.C
blob: 6117c6edc7a4b641e9d9cd05a62de555c688012d (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/common/plat/p9/prdfP9Obus.C $               */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2019                             */
/* [+] 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                                                     */


// Framework includes
#include <iipServiceDataCollector.h>
#include <prdfExtensibleChip.H>
#include <prdfPluginMap.H>

// Platform includes
#include <prdfPlatServices.H>

using namespace TARGETING;

namespace PRDF
{

using namespace PlatServices;

namespace obus
{

//##############################################################################
//
//                               IOOLFIR
//
//##############################################################################

/**
 * @brief If OBUS is in SMP mode, does defaultMaskedError actions and returns
 *        SUCCESS. Otherwise, returns PRD_SCAN_COMM_REGISTER_ZERO.
 */
int32_t smp_masked( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc )
{
    if ( obusInSmpMode(i_chip->getTrgt()) )
    {
        // SMP mode: This attention should be masked.
        io_sc.service_data->SetCallout( LEVEL2_SUPPORT, MRU_MED, NO_GARD );
        io_sc.service_data->setFlag( ServiceDataCollector::AT_THRESHOLD );
        io_sc.service_data->setFlag( ServiceDataCollector::SERVICE_CALL );
        return SUCCESS;
    }
    else
    {
        // Non-SMP mode: Try some other action.
        return PRD_SCAN_COMM_REGISTER_ZERO;
    }
}
PRDF_PLUGIN_DEFINE_NS( nimbus_obus,  obus, smp_masked );
PRDF_PLUGIN_DEFINE_NS( cumulus_obus, obus, smp_masked );
PRDF_PLUGIN_DEFINE_NS( axone_obus,   obus, smp_masked );

//------------------------------------------------------------------------------

/**
 * @brief If OBUS is NOT in SMP mode, does defaultMaskedError actions and
 *        returns SUCCESS. Otherwise, returns PRD_SCAN_COMM_REGISTER_ZERO.
 */
int32_t non_smp_masked( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc )
{
    if ( obusInSmpMode(i_chip->getTrgt()) )
    {
        // SMP mode: Try some other action.
        return PRD_SCAN_COMM_REGISTER_ZERO;
    }
    else
    {
        // Non-SMP mode: This attention should be masked.
        io_sc.service_data->SetCallout( LEVEL2_SUPPORT, MRU_MED, NO_GARD );
        io_sc.service_data->setFlag( ServiceDataCollector::AT_THRESHOLD );
        io_sc.service_data->setFlag( ServiceDataCollector::SERVICE_CALL );
        return SUCCESS;
    }
}
PRDF_PLUGIN_DEFINE_NS( nimbus_obus,  obus, non_smp_masked );
PRDF_PLUGIN_DEFINE_NS( cumulus_obus, obus, non_smp_masked );
PRDF_PLUGIN_DEFINE_NS( axone_obus,   obus, non_smp_masked );

//------------------------------------------------------------------------------

/**
 * @brief If OBUS is NOT in SMP mode, calls out this bus on first occurrence and
 *        returns SUCCESS. Otherwise, returns PRD_SCAN_COMM_REGISTER_ZERO.
 */
int32_t non_smp_callout_bus_th_1( ExtensibleChip * i_chip,
                                 STEP_CODE_DATA_STRUCT & io_sc )
{
    if ( obusInSmpMode(i_chip->getTrgt()) )
    {
        // SMP mode: Try some other action.
        return PRD_SCAN_COMM_REGISTER_ZERO;
    }
    else
    {
        // Non-SMP mode: Callout this bus. Note that Hostboot does not know what
        // is on the other side of this bus and does not have any control over
        // garding/deconfiguring. Therefore, we cannot gard since we will never
        // know if the other side of the bus has been replaced. Also, there is
        // a small probability that the fault could be between the two
        // endpoints. Usually, we would do a procedure callout or call some HWP
        // that would take care of the "everything in between" scenario.
        // However, there is no existing mechanism. For now callout level 2
        // support at low priority.
        io_sc.service_data->SetCallout( i_chip->getTrgt(), MRU_MED, NO_GARD );
        io_sc.service_data->SetCallout( LEVEL2_SUPPORT,    MRU_LOW, NO_GARD );
        io_sc.service_data->setFlag( ServiceDataCollector::AT_THRESHOLD );
        io_sc.service_data->setFlag( ServiceDataCollector::SERVICE_CALL );
        return SUCCESS;
    }
}
PRDF_PLUGIN_DEFINE_NS( nimbus_obus,  obus, non_smp_callout_bus_th_1 );
PRDF_PLUGIN_DEFINE_NS( cumulus_obus, obus, non_smp_callout_bus_th_1 );
PRDF_PLUGIN_DEFINE_NS( axone_obus,   obus, non_smp_callout_bus_th_1 );

//------------------------------------------------------------------------------

/**
 * @brief If OBUS is NOT in SMP mode, calls out level 2 support on first
 *        occurrence and returns SUCCESS. Otherwise, returns
 *        PRD_SCAN_COMM_REGISTER_ZERO.
 */
int32_t non_smp_callout_lvl2_th_1( ExtensibleChip * i_chip,
                                  STEP_CODE_DATA_STRUCT & io_sc )
{
    if ( obusInSmpMode(i_chip->getTrgt()) )
    {
        // SMP mode: Try some other action.
        return PRD_SCAN_COMM_REGISTER_ZERO;
    }
    else
    {
        // Non-SMP mode: Callout this bus on first occurrence.
        io_sc.service_data->SetCallout( LEVEL2_SUPPORT, MRU_MED, NO_GARD );
        io_sc.service_data->setFlag( ServiceDataCollector::AT_THRESHOLD );
        io_sc.service_data->setFlag( ServiceDataCollector::SERVICE_CALL );
        return SUCCESS;
    }
}
PRDF_PLUGIN_DEFINE_NS( nimbus_obus,  obus, non_smp_callout_lvl2_th_1 );
PRDF_PLUGIN_DEFINE_NS( cumulus_obus, obus, non_smp_callout_lvl2_th_1 );
PRDF_PLUGIN_DEFINE_NS( axone_obus,   obus, non_smp_callout_lvl2_th_1 );

//------------------------------------------------------------------------------

/**
 * @brief If OBUS is NOT in SMP mode, calls out this OBUS target and returns
 *        SUCCESS. Otherwise, returns PRD_SCAN_COMM_REGISTER_ZERO.
 */
int32_t non_smp_callout_self( ExtensibleChip * i_chip,
                              STEP_CODE_DATA_STRUCT & io_sc )
{
    if ( obusInSmpMode(i_chip->getTrgt()) )
    {
        // SMP mode: Try some other action.
        return PRD_SCAN_COMM_REGISTER_ZERO;
    }
    else
    {
        // Non-SMP mode: Callout this OBUS target.
        io_sc.service_data->SetCallout( i_chip->getTrgt() );
        return SUCCESS;
    }
}
PRDF_PLUGIN_DEFINE_NS( nimbus_obus,  obus, non_smp_callout_self );
PRDF_PLUGIN_DEFINE_NS( cumulus_obus, obus, non_smp_callout_self );
PRDF_PLUGIN_DEFINE_NS( axone_obus,   obus, non_smp_callout_self );

} // end namespace obus

} // end namespace PRDF

OpenPOWER on IntegriCloud