Skip to content

Commit eb82590

Browse files
cnpalmerzane131
authored andcommitted
PRD: Update MemThresholds Files
Change-Id: Ibb6fcfac1e424296de09e632f382ecf55dd73dba RTC: 159627 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34056 Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36074 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
1 parent 97dcd09 commit eb82590

File tree

4 files changed

+69
-97
lines changed

4 files changed

+69
-97
lines changed

src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C renamed to src/usr/diag/prdf/plat/mem/prdfMemThresholds.C

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* IBM_PROLOG_BEGIN_TAG */
22
/* This is an automatically generated prolog. */
33
/* */
4-
/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C $ */
4+
/* $Source: src/usr/diag/prdf/plat/mem/prdfMemThresholds.C $ */
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2013,2015 */
8+
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -23,18 +23,18 @@
2323
/* */
2424
/* IBM_PROLOG_END_TAG */
2525

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.
2828
*/
2929

3030
// Framework includes
3131
#include <prdfExtensibleChip.H>
3232
#include <prdfMfgThresholdMgr.H>
3333
#include <prdfPlatServices.H>
3434

35-
// Pegasus includes
36-
#include <prdfCenMbaThresholds.H>
37-
#include <prdfCenMemUtils.H>
35+
// Platform includes
36+
#include <prdfMemThresholds.H>
37+
#include <prdfMemUtils.H>
3838

3939
using namespace TARGETING;
4040

@@ -51,6 +51,27 @@ static uint32_t MBA_SCRUB_CE_NON_MNFG_TH = 80;
5151

5252
//------------------------------------------------------------------------------
5353

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+
5475
ThresholdResolution::ThresholdPolicy getRceThreshold()
5576
{
5677
uint32_t th = MBA_RCE_NON_MNFG_TH;
@@ -69,7 +90,8 @@ ThresholdResolution::ThresholdPolicy getRceThreshold()
6990

7091
//------------------------------------------------------------------------------
7192

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,
7395
uint16_t & o_cePerDram, uint16_t & o_cePerHalfRank,
7496
uint16_t & o_cePerDimm )
7597
{
@@ -91,20 +113,14 @@ int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
91113
}
92114

93115
// 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() );
101117

102118
// 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() );
105121
if ( 0 == rankCount )
106122
{
107-
PRDF_ERR( PRDF_FUNC "PlatServices::getRanksPerDimm() failed" );
123+
PRDF_ERR( PRDF_FUNC "PlatServices::getNumRanksPerDimm() failed" );
108124
o_rc = FAIL; break;
109125
}
110126

@@ -134,9 +150,19 @@ int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
134150
#undef PRDF_FUNC
135151
}
136152

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 );
138157

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,
140166
uint16_t & o_thr )
141167
{
142168
#define PRDF_FUNC "[getScrubCeThreshold] "
@@ -150,7 +176,7 @@ int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
150176
uint16_t junk1 = 0;
151177
uint16_t junk2 = 0;
152178

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 );
154180
if ( SUCCESS != o_rc )
155181
PRDF_ERR( PRDF_FUNC "getMnfgMemCeTh() failed" );
156182

@@ -164,5 +190,12 @@ int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
164190
#undef PRDF_FUNC
165191
}
166192

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+
167200
} // end namespace PRDF
168201

src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H renamed to src/usr/diag/prdf/plat/mem/prdfMemThresholds.H

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* IBM_PROLOG_BEGIN_TAG */
22
/* This is an automatically generated prolog. */
33
/* */
4-
/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H $ */
4+
/* $Source: src/usr/diag/prdf/plat/mem/prdfMemThresholds.H $ */
55
/* */
66
/* OpenPOWER HostBoot Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2013,2014 */
8+
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -23,15 +23,15 @@
2323
/* */
2424
/* IBM_PROLOG_END_TAG */
2525

26-
#ifndef __PRDF_CEN_MBA_COMMON_THRESHOLDS_H
27-
#define __PRDF_CEN_MBA_COMMON_THRESHOLDS_H
26+
#ifndef __PRDF_MEM_THRESHOLDS_H
27+
#define __PRDF_MEM_THRESHOLDS_H
2828

29-
/** @file prdfCenMbaThresholds_common.H
30-
* @brief Utility functions used to get specific Centaur thresholds.
29+
/** @file prdfMemThresholds.H
30+
* @brief Utility functions used to get specific memory thresholds.
3131
*/
3232

3333
#include <prdfThresholdResolutions.H>
34-
#include <prdfCenAddress.H>
34+
#include <prdfMemAddress.H>
3535

3636
namespace PRDF
3737
{
@@ -42,14 +42,15 @@ class ExtensibleChip;
4242
* @brief Returns number of allowed CEs for MNFG IPLs.
4343
* @pre Must check if in manufacturing mode before calling this function.
4444
* @post Must callout if the count is greater than the returned values.
45-
* @param i_mbaChip MBA chip.
45+
* @param i_chip MCA or MBA chip.
4646
* @param i_rank The rank for which the threshold is needed.
4747
* @param o_cePerDram CEs allowed per DRAM.
4848
* @param o_cePerHalfRank CEs allowed per logical DIMM rank.
4949
* @param o_cePerDimm CEs allowed per logical DIMM.
5050
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
5151
*/
52-
int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
52+
template <TARGETING::TYPE T>
53+
int32_t getMnfgMemCeTh( ExtensibleChip * i_chip, const MemRank & i_rank,
5354
uint16_t & o_cePerDram, uint16_t & o_cePerHalfRank,
5455
uint16_t & o_cePerDimm );
5556

@@ -60,15 +61,16 @@ ThresholdResolution::ThresholdPolicy getRceThreshold();
6061

6162
/**
6263
* @brief Returns scrub soft/intermittent CEs threshold during runtime.
63-
* @param i_mbaChip MBA chip.
64+
* @param i_chip MCA or MBA chip.
6465
* @param i_rank The rank for which the threshold is needed.
6566
* @param o_thr Scrub soft/intermittent CE threshold.
6667
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
6768
*/
68-
int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
69+
template <TARGETING::TYPE T>
70+
int32_t getScrubCeThreshold( ExtensibleChip * i_chip, const MemRank & i_rank,
6971
uint16_t & o_thr );
7072

7173
} // end namespace PRDF
7274

73-
#endif /* __PRDF_CEN_MBA_COMMON_THRESHOLDS_H */
75+
#endif /* __PRDF_MEM_THRESHOLDS_H */
7476

src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ prd_incpath += ${PRD_SRC_PATH}/plat/mem
4141
prd_obj += prdfMemScrubUtils.o
4242
prd_obj += prdfMemTdCtlr.o
4343
prd_obj += prdfMemUtils.o
44+
prd_obj += prdfMemThresholds.o
4445

4546
# plat/mem/ (rule plugin related)
4647
prd_rule_plugin += prdfP9Mca.o

src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)