1
1
/* IBM_PROLOG_BEGIN_TAG */
2
2
/* This is an automatically generated prolog. */
3
3
/* */
4
- /* $Source: src/usr/diag/prdf/common/ plat/pegasus/prdfCenMbaThresholds_common .C $ */
4
+ /* $Source: src/usr/diag/prdf/plat/mem/prdfMemThresholds .C $ */
5
5
/* */
6
6
/* OpenPOWER HostBoot Project */
7
7
/* */
8
- /* Contributors Listed Below - COPYRIGHT 2013,2015 */
8
+ /* Contributors Listed Below - COPYRIGHT 2013,2017 */
9
9
/* [+] International Business Machines Corp. */
10
10
/* */
11
11
/* */
23
23
/* */
24
24
/* IBM_PROLOG_END_TAG */
25
25
26
- /** @file prdfCenMbaThresholds_common .C
27
- * @brief Utility functions used to get specific Centaur thresholds.
26
+ /** @file prdfMemThresholds .C
27
+ * @brief Utility functions used to get specific memory thresholds.
28
28
*/
29
29
30
30
// Framework includes
31
31
#include <prdfExtensibleChip.H>
32
32
#include <prdfMfgThresholdMgr.H>
33
33
#include <prdfPlatServices.H>
34
34
35
- // Pegasus includes
36
- #include <prdfCenMbaThresholds .H>
37
- #include <prdfCenMemUtils .H>
35
+ // Platform includes
36
+ #include <prdfMemThresholds .H>
37
+ #include <prdfMemUtils .H>
38
38
39
39
using namespace TARGETING ;
40
40
@@ -51,6 +51,27 @@ static uint32_t MBA_SCRUB_CE_NON_MNFG_TH = 80;
51
51
52
52
//------------------------------------------------------------------------------
53
53
54
+ /**
55
+ * @brief Returns the manufacturing memory CE thresholds Per 2GB ( base ).
56
+ */
57
+ uint8_t getMnfgCeTh ()
58
+ {
59
+ #ifndef __HOSTBOOT_RUNTIME
60
+
61
+ return MfgThresholdMgr ::getInstance ()->
62
+ getThreshold ( TARGETING ::ATTR_MNFG_TH_CEN_MBA_IPL_SOFT_CE_TH_ALGO );
63
+
64
+ #else
65
+
66
+ return MfgThresholdMgr ::getInstance ()->
67
+ getThreshold ( TARGETING ::ATTR_MNFG_TH_CEN_MBA_RT_SOFT_CE_TH_ALGO );
68
+
69
+ #endif
70
+
71
+ }
72
+
73
+ //------------------------------------------------------------------------------
74
+
54
75
ThresholdResolution ::ThresholdPolicy getRceThreshold ()
55
76
{
56
77
uint32_t th = MBA_RCE_NON_MNFG_TH ;
@@ -69,7 +90,8 @@ ThresholdResolution::ThresholdPolicy getRceThreshold()
69
90
70
91
//------------------------------------------------------------------------------
71
92
72
- int32_t getMnfgMemCeTh ( ExtensibleChip * i_mbaChip , const CenRank & i_rank ,
93
+ template < TYPE T >
94
+ int32_t getMnfgMemCeTh ( ExtensibleChip * i_chip , const MemRank & i_rank ,
73
95
uint16_t & o_cePerDram , uint16_t & o_cePerHalfRank ,
74
96
uint16_t & o_cePerDimm )
75
97
{
@@ -91,20 +113,14 @@ int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
91
113
}
92
114
93
115
// Get DRAM size
94
- uint8_t size = 0 ;
95
- o_rc = MemUtils ::getDramSize ( i_mbaChip , size );
96
- if ( SUCCESS != o_rc )
97
- {
98
- PRDF_ERR ( PRDF_FUNC "MemUtils::getDramSize() failed" );
99
- break ;
100
- }
116
+ uint8_t size = MemUtils ::getDramSize < T > ( i_chip , i_rank .getDimmSlct () );
101
117
102
118
// Get number of ranks per DIMM select.
103
- uint8_t rankCount = getRanksPerDimm ( i_mbaChip -> GetChipHandle (),
104
- i_rank .getDimmSlct () );
119
+ uint8_t rankCount = getNumRanksPerDimm < T > (
120
+ i_chip -> getTrgt (), i_rank .getDimmSlct () );
105
121
if ( 0 == rankCount )
106
122
{
107
- PRDF_ERR ( PRDF_FUNC "PlatServices::getRanksPerDimm () failed" );
123
+ PRDF_ERR ( PRDF_FUNC "PlatServices::getNumRanksPerDimm () failed" );
108
124
o_rc = FAIL ; break ;
109
125
}
110
126
@@ -134,9 +150,19 @@ int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
134
150
#undef PRDF_FUNC
135
151
}
136
152
137
- //------------------------------------------------------------------------------
153
+ // need these templates to avoid linker errors
154
+ template int32_t getMnfgMemCeTh < TYPE_MCA > ( ExtensibleChip * i_chip ,
155
+ const MemRank & i_rank , uint16_t & o_cePerDram ,
156
+ uint16_t & o_cePerHalfRank , uint16_t & o_cePerDimm );
138
157
139
- int32_t getScrubCeThreshold ( ExtensibleChip * i_mbaChip , const CenRank & i_rank ,
158
+ template int32_t getMnfgMemCeTh < TYPE_MBA > ( ExtensibleChip * i_chip ,
159
+ const MemRank & i_rank , uint16_t & o_cePerDram ,
160
+ uint16_t & o_cePerHalfRank , uint16_t & o_cePerDimm );
161
+
162
+
163
+ //------------------------------------------------------------------------------
164
+ template < TYPE T >
165
+ int32_t getScrubCeThreshold ( ExtensibleChip * i_chip , const MemRank & i_rank ,
140
166
uint16_t & o_thr )
141
167
{
142
168
#define PRDF_FUNC "[getScrubCeThreshold] "
@@ -150,7 +176,7 @@ int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
150
176
uint16_t junk1 = 0 ;
151
177
uint16_t junk2 = 0 ;
152
178
153
- o_rc = getMnfgMemCeTh ( i_mbaChip , i_rank , o_thr , junk1 , junk2 );
179
+ o_rc = getMnfgMemCeTh < T > ( i_chip , i_rank , o_thr , junk1 , junk2 );
154
180
if ( SUCCESS != o_rc )
155
181
PRDF_ERR ( PRDF_FUNC "getMnfgMemCeTh() failed" );
156
182
@@ -164,5 +190,12 @@ int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
164
190
#undef PRDF_FUNC
165
191
}
166
192
193
+ // need these templates to avoid linker errors
194
+ template int32_t getScrubCeThreshold < TYPE_MCA > ( ExtensibleChip * i_chip ,
195
+ const MemRank & i_rank , uint16_t & o_thr );
196
+ template int32_t getScrubCeThreshold < TYPE_MBA > ( ExtensibleChip * i_chip ,
197
+ const MemRank & i_rank , uint16_t & o_thr );
198
+
199
+
167
200
} // end namespace PRDF
168
201
0 commit comments