summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/framework/service/prdfPlatServices.H
blob: 5ab99bb440c3cd4768b015fd5804ce8407a99a77 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/framework/service/prdfPlatServices.H $      */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2012                   */
/*                                                                        */
/* 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 PRDFPLATSERVICES_H
#define PRDFPLATSERVICES_H

/**
 * @file  prdfPlatServices.H
 * @brief Wrapper code for things PRD needs from external components ( other then targetting ).
 */

//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------

#include <algorithm>

#include <iipconst.h>
#include <prdfTargetServices.H>
#include <prdfTimer.H>

#include <errlentry.H>

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

namespace PRDF
{

namespace PlatServices
{

//##############################################################################
//##
//##                        Hostboot and FSP functions
//##
//##############################################################################

//##############################################################################
//##                     System Level Utility Functions
//##############################################################################

//FIXME functions defintion not found.Should we remove it?
//void enterCCMMode();
//bool inCMMode();
//bool isCM_FUNCTIONAL(TARGETING::TargetHandle_t);

/**
 * @brief   Returns if role is mater fsp.
 * @param   None.
 * @return  TRUE if master fsp. FALSE if not master fsp.
 * @pre     None.
 * @post    None.
 */
bool isMasterFSP();

/**
 * @brief   Checks if we are currently doing a memory preserving IPL.
 * @param   None.
 * @return  TRUE if this is a memory preserving IPL, FALSE otherwise.
 * @pre     None.
 * @post    None.
 */
bool isMemoryPreservingIpl();

/**
 * @brief   Return ecidString for a given target
 * @param   i_pGivenTarget  handle to target
 * @param   o_ecidStr       buffer for ecidstring
 * @return  Returns ecidString for given target Handle
 * @pre     none
 * @post    none
 */
void getECIDString( TARGETING::TargetHandle_t i_pGivenHandle, const char *o_ecidStr );

/**
 * @brief Get a PRD timer value based on the current time.
 * @param o_timer The returned PrdTimer
 */
void getCurrentTime( PrdTimer & o_timer );

/**
 * @brief   synch the file with rmgr
 * @param   i_fileName file name
 * @return  NULL if synch is unsuccessfull, error handle otherwise
 */
errlHndl_t syncFile( const char* i_fileName );

//##############################################################################
//##                     MNFG Policy Flag Functions
//##############################################################################

/**
 * @brief   Returns the state of the MNFG_THRESHOLDS policy flag.
 * @return  TRUE if MNFG_THRESHOLDS is set, FALSE otherwise.
 */
bool mfgMode();

/**
 * @brief   Returns the state of the MNFG_HDAT_AVP_ENABLE policy flag.
 * @return  TRUE if MNFG_HDAT_AVP_ENABLE is set, FALSE otherwise.
 */
bool hdatAvpMode();

/**
 * @brief   Returns status of MNFG_SRC_TERM manufacturing policy flag.
 * @param   None.
 * @return  TRUE if MNFG_SRC_TERM policy flag is set, FALSE
 *          otherwise.
 * @pre     None.
 * @post    None.
 */
bool mnfgTerminate();

//##############################################################################
//##                        Memory specific functions
//##############################################################################

/**
 * @brief   Returns the memory buffer raw card type (i.e. R/C A).
 * @param   i_memTarget A memory buffer, MBA, or DIMM.
 * @return
 */
/* TODO - See .C
getMembufRawCardType( TARGETING::TargetHandle_t i_memTarget );
*/

/**
 * @brief   Returns the type of the card the DIMM is plugged into.
 * @param   i_dimmTarget A DIMM target.
 * @return
 */

/* TODO - See .C
getDimmPlugCardType( TARGETING::TargetHandle_t i_dimmTarget );
*/

/**
 * @brief   Reads the bad DQ bitmap attribute.
 * @param   i_mbaTarget A MBA target.
 * @param   i_portSlct  Port select (0-1).
 * @param   i_dimmSlct  DIMM select (0-1).
 * @param   i_rankSlct  Rank select (0-3).
 * @param   o_data      The return data array.
 * @return  Non-SUCCESS if an internal function fails, SUCCESS otherwise.
 */
/* TODO - See .C
int32_t getBadDqBitmap( TARGETING::TargetHandle_t i_mbaTarget
                        const uint8_t i_portSlct,
                        const uint8_t i_dimmSlct,
                        const uint8_t i_rankSlct,
                        uint8_t (&o_data)[DIMM_DQ_RANK_BITMAP_SIZE] );
*/

/**
 * @brief   Writes the bad DQ bitmap attribute.
 * @param   i_mbaTarget A MBA target.
 * @param   i_portSlct  Port select (0-1).
 * @param   i_dimmSlct  DIMM select (0-1).
 * @param   i_rankSlct  Rank select (0-3).
 * @param   i_data      The input data array.
 * @return  Non-SUCCESS if an internal function fails, SUCCESS otherwise.
 */
/* TODO - See .C
int32_t setBadDqBitmap( TARGETING::TargetHandle_t i_mbaTarget
                        const uint8_t i_portSlct,
                        const uint8_t i_dimmSlct,
                        const uint8_t i_rankSlct,
                        const uint8_t (&i_data)[DIMM_DQ_RANK_BITMAP_SIZE] );
*/

//##############################################################################
//##
//##                        Hostboot only functions
//##
//##############################################################################

#ifdef __HOSTBOOT_MODULE

/**
 * @brief  Checks if we are running in MDIA mode.
 * @return TRUE if in MDIA mode, FALSE otherwise.
 */
bool isInMdiaMode();

/**
 * @brief  Sends a command complete message to MDIA.
 * @param  i_mbaTarget An MBA target.
 * @return Non-SUCCESS in internal function fails, SUCCESS otherwise.
 */
int32_t mdiaSendCmdComplete( TARGETING::TargetHandle_t i_mbaTarget );

#endif // __HOSTBOOT_MODULE

//##############################################################################
//##
//##                           FSP only functions
//##
//##############################################################################

#ifndef __HOSTBOOT_MODULE

/**
 * @brief  Do a runtime deconfiguration of the given target.
 * @param  i_target The target to deconfigure.
 * @return NULL if deconfig is successful, non-NULL otherwise.
 */
errlHndl_t runtimeDeconfig( TARGETING::TargetHandle_t i_target );

#endif // not __HOSTBOOT_MODULE

} // end namespace PlatServices

} // end namespace PRDF

#endif // PRDFPLATSERVICES_H

OpenPOWER on IntegriCloud