summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Palmer <cnpalmer@us.ibm.com>2016-12-19 09:56:55 -0600
committerZane C. Shelley <zshelle@us.ibm.com>2017-02-10 13:22:18 -0500
commiteb825905b34c4978bb75e81b654bb2390778563f (patch)
tree47c75475cdd384f8afd451f61396aa7ebeb497a4
parent97dcd092f4e72e2b67f2b97b6aac3cd57944d05e (diff)
downloadtalos-hostboot-eb825905b34c4978bb75e81b654bb2390778563f.tar.gz
talos-hostboot-eb825905b34c4978bb75e81b654bb2390778563f.zip
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>
-rwxr-xr-xsrc/usr/diag/prdf/plat/mem/prdfMemThresholds.C (renamed from src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C)75
-rwxr-xr-xsrc/usr/diag/prdf/plat/mem/prdfMemThresholds.H (renamed from src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H)26
-rw-r--r--src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk1
-rwxr-xr-xsrc/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H64
4 files changed, 69 insertions, 97 deletions
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C b/src/usr/diag/prdf/plat/mem/prdfMemThresholds.C
index b62c88fc3..722378e01 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemThresholds.C
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C $ */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfMemThresholds.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -23,8 +23,8 @@
/* */
/* IBM_PROLOG_END_TAG */
-/** @file prdfCenMbaThresholds_common.C
- * @brief Utility functions used to get specific Centaur thresholds.
+/** @file prdfMemThresholds.C
+ * @brief Utility functions used to get specific memory thresholds.
*/
// Framework includes
@@ -32,9 +32,9 @@
#include <prdfMfgThresholdMgr.H>
#include <prdfPlatServices.H>
-// Pegasus includes
-#include <prdfCenMbaThresholds.H>
-#include <prdfCenMemUtils.H>
+// Platform includes
+#include <prdfMemThresholds.H>
+#include <prdfMemUtils.H>
using namespace TARGETING;
@@ -51,6 +51,27 @@ static uint32_t MBA_SCRUB_CE_NON_MNFG_TH = 80;
//------------------------------------------------------------------------------
+/**
+ * @brief Returns the manufacturing memory CE thresholds Per 2GB ( base ).
+ */
+uint8_t getMnfgCeTh()
+{
+ #ifndef __HOSTBOOT_RUNTIME
+
+ return MfgThresholdMgr::getInstance()->
+ getThreshold( TARGETING::ATTR_MNFG_TH_CEN_MBA_IPL_SOFT_CE_TH_ALGO );
+
+ #else
+
+ return MfgThresholdMgr::getInstance()->
+ getThreshold( TARGETING::ATTR_MNFG_TH_CEN_MBA_RT_SOFT_CE_TH_ALGO );
+
+ #endif
+
+}
+
+//------------------------------------------------------------------------------
+
ThresholdResolution::ThresholdPolicy getRceThreshold()
{
uint32_t th = MBA_RCE_NON_MNFG_TH;
@@ -69,7 +90,8 @@ ThresholdResolution::ThresholdPolicy getRceThreshold()
//------------------------------------------------------------------------------
-int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
+template <TYPE T>
+int32_t getMnfgMemCeTh( ExtensibleChip * i_chip, const MemRank & i_rank,
uint16_t & o_cePerDram, uint16_t & o_cePerHalfRank,
uint16_t & o_cePerDimm )
{
@@ -91,20 +113,14 @@ int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
}
// Get DRAM size
- uint8_t size = 0;
- o_rc = MemUtils::getDramSize( i_mbaChip, size );
- if ( SUCCESS != o_rc )
- {
- PRDF_ERR( PRDF_FUNC "MemUtils::getDramSize() failed" );
- break;
- }
+ uint8_t size = MemUtils::getDramSize<T>( i_chip, i_rank.getDimmSlct() );
// Get number of ranks per DIMM select.
- uint8_t rankCount = getRanksPerDimm( i_mbaChip->GetChipHandle(),
- i_rank.getDimmSlct() );
+ uint8_t rankCount = getNumRanksPerDimm<T>(
+ i_chip->getTrgt(), i_rank.getDimmSlct() );
if ( 0 == rankCount )
{
- PRDF_ERR( PRDF_FUNC "PlatServices::getRanksPerDimm() failed" );
+ PRDF_ERR( PRDF_FUNC "PlatServices::getNumRanksPerDimm() failed" );
o_rc = FAIL; break;
}
@@ -134,9 +150,19 @@ int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
#undef PRDF_FUNC
}
-//------------------------------------------------------------------------------
+// need these templates to avoid linker errors
+template int32_t getMnfgMemCeTh<TYPE_MCA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank, uint16_t & o_cePerDram,
+ uint16_t & o_cePerHalfRank, uint16_t & o_cePerDimm );
-int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
+template int32_t getMnfgMemCeTh<TYPE_MBA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank, uint16_t & o_cePerDram,
+ uint16_t & o_cePerHalfRank, uint16_t & o_cePerDimm );
+
+
+//------------------------------------------------------------------------------
+template <TYPE T>
+int32_t getScrubCeThreshold( ExtensibleChip * i_chip, const MemRank & i_rank,
uint16_t & o_thr )
{
#define PRDF_FUNC "[getScrubCeThreshold] "
@@ -150,7 +176,7 @@ int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
uint16_t junk1 = 0;
uint16_t junk2 = 0;
- o_rc = getMnfgMemCeTh( i_mbaChip, i_rank, o_thr, junk1, junk2 );
+ o_rc = getMnfgMemCeTh<T>( i_chip, i_rank, o_thr, junk1, junk2 );
if ( SUCCESS != o_rc )
PRDF_ERR( PRDF_FUNC "getMnfgMemCeTh() failed" );
@@ -164,5 +190,12 @@ int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
#undef PRDF_FUNC
}
+// need these templates to avoid linker errors
+template int32_t getScrubCeThreshold<TYPE_MCA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank, uint16_t & o_thr );
+template int32_t getScrubCeThreshold<TYPE_MBA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank, uint16_t & o_thr );
+
+
} // end namespace PRDF
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H b/src/usr/diag/prdf/plat/mem/prdfMemThresholds.H
index 76ce6f5a4..58a2eb53f 100755
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H
+++ b/src/usr/diag/prdf/plat/mem/prdfMemThresholds.H
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
-/* $Source: src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.H $ */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfMemThresholds.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2014 */
+/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -23,15 +23,15 @@
/* */
/* IBM_PROLOG_END_TAG */
-#ifndef __PRDF_CEN_MBA_COMMON_THRESHOLDS_H
-#define __PRDF_CEN_MBA_COMMON_THRESHOLDS_H
+#ifndef __PRDF_MEM_THRESHOLDS_H
+#define __PRDF_MEM_THRESHOLDS_H
-/** @file prdfCenMbaThresholds_common.H
- * @brief Utility functions used to get specific Centaur thresholds.
+/** @file prdfMemThresholds.H
+ * @brief Utility functions used to get specific memory thresholds.
*/
#include <prdfThresholdResolutions.H>
-#include <prdfCenAddress.H>
+#include <prdfMemAddress.H>
namespace PRDF
{
@@ -42,14 +42,15 @@ class ExtensibleChip;
* @brief Returns number of allowed CEs for MNFG IPLs.
* @pre Must check if in manufacturing mode before calling this function.
* @post Must callout if the count is greater than the returned values.
- * @param i_mbaChip MBA chip.
+ * @param i_chip MCA or MBA chip.
* @param i_rank The rank for which the threshold is needed.
* @param o_cePerDram CEs allowed per DRAM.
* @param o_cePerHalfRank CEs allowed per logical DIMM rank.
* @param o_cePerDimm CEs allowed per logical DIMM.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
-int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
+template <TARGETING::TYPE T>
+int32_t getMnfgMemCeTh( ExtensibleChip * i_chip, const MemRank & i_rank,
uint16_t & o_cePerDram, uint16_t & o_cePerHalfRank,
uint16_t & o_cePerDimm );
@@ -60,15 +61,16 @@ ThresholdResolution::ThresholdPolicy getRceThreshold();
/**
* @brief Returns scrub soft/intermittent CEs threshold during runtime.
- * @param i_mbaChip MBA chip.
+ * @param i_chip MCA or MBA chip.
* @param i_rank The rank for which the threshold is needed.
* @param o_thr Scrub soft/intermittent CE threshold.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
-int32_t getScrubCeThreshold( ExtensibleChip * i_mbaChip, const CenRank & i_rank,
+template <TARGETING::TYPE T>
+int32_t getScrubCeThreshold( ExtensibleChip * i_chip, const MemRank & i_rank,
uint16_t & o_thr );
} // end namespace PRDF
-#endif /* __PRDF_CEN_MBA_COMMON_THRESHOLDS_H */
+#endif /* __PRDF_MEM_THRESHOLDS_H */
diff --git a/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk b/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
index b753dc50a..e27f879af 100644
--- a/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
+++ b/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
@@ -41,6 +41,7 @@ prd_incpath += ${PRD_SRC_PATH}/plat/mem
prd_obj += prdfMemScrubUtils.o
prd_obj += prdfMemTdCtlr.o
prd_obj += prdfMemUtils.o
+prd_obj += prdfMemThresholds.o
# plat/mem/ (rule plugin related)
prd_rule_plugin += prdfP9Mca.o
diff --git a/src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H b/src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H
deleted file mode 100755
index e6ac079b9..000000000
--- a/src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H
+++ /dev/null
@@ -1,64 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/usr/diag/prdf/plat/pegasus/prdfCenMbaThresholds.H $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2013,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 */
-
-#ifndef __PRDF_CEN_MBA_THRESHOLDS_H
-#define __PRDF_CEN_MBA_THRESHOLDS_H
-
-/** @file prdfCenMbaThresholds.H
- * @brief Utility functions used to get specific Centaur thresholds
- * during IPL time.
- */
-
-#include <prdfCenMbaThresholds_common.H>
-#include <prdfMfgThresholdMgr.H>
-
-namespace PRDF
-{
-
-class ExtensibleChip;
-
-/**
- * @brief Returns the manufacturing memory CE thresholds Per 2GB ( base ).
- */
-inline uint8_t getMnfgCeTh()
-{
- #ifndef __HOSTBOOT_RUNTIME
-
- return MfgThresholdMgr::getInstance()->
- getThreshold( TARGETING::ATTR_MNFG_TH_CEN_MBA_IPL_SOFT_CE_TH_ALGO );
-
- #else
-
- return MfgThresholdMgr::getInstance()->
- getThreshold( TARGETING::ATTR_MNFG_TH_CEN_MBA_RT_SOFT_CE_TH_ALGO );
-
- #endif
-
-}
-
-} // end namespace PRDF
-
-#endif /* __PRDF_CEN_MBA_THRESHOLDS_H */
-
OpenPOWER on IntegriCloud