summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Pardeik <pardeik@us.ibm.com>2018-05-24 14:30:33 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-05-28 14:54:03 -0400
commitccc4804c0a8f5bc37a738b07da36cd9f8595921c (patch)
tree46360bf241c3effb7fe98408a9163aa3f4ea3bfa
parent862ecf79aaecf5f1330e7c494f9a5e13c1b18f38 (diff)
downloadtalos-hostboot-ccc4804c0a8f5bc37a738b07da36cd9f8595921c.tar.gz
talos-hostboot-ccc4804c0a8f5bc37a738b07da36cd9f8595921c.zip
P9C Memory Throttle HWP Updates
Change-Id: I292e12105aa5dd1a36b6cdcdd889c110f4e81715 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59357 Reviewed-by: Louis Stermole <stermole@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Dev-Ready: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59369 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.C15
-rw-r--r--src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.H6
-rw-r--r--src/import/chips/centaur/procedures/hwp/memory/p9c_mss_eff_config_thermal.C11
-rw-r--r--src/import/chips/centaur/procedures/hwp/memory/p9c_mss_util_to_throttle.C3
-rw-r--r--src/import/generic/memory/lib/utils/find.H99
5 files changed, 65 insertions, 69 deletions
diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.C b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.C
index 6ba0a8e37..06c84da79 100644
--- a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.C
+++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.C
@@ -209,7 +209,7 @@ extern "C" {
// Maximum theoretical data bus utilization (percent of max) (for ceiling)
// Comes from MRW value in c% - convert to %
// We don't need to limit this because this function is only determining the channel pair power slope and interecpt
- l_max_util = (static_cast<double>(convert_to_percent(l_max_dram_databus_util)));
+ l_max_util = convert_to_percent(static_cast<double>(l_max_dram_databus_util));
for (l_port = 0; l_port < MAX_PORTS_PER_MBA; l_port++)
{
@@ -342,7 +342,7 @@ extern "C" {
FAPI_INF("%s [Max Util Limited to %4.2lf centi percent]", mss::c_str(i_target_mba), l_max_dram_databus_util);
}
- l_max_util = (static_cast<double>(convert_to_percent(l_max_dram_databus_util)));
+ l_max_util = convert_to_percent(static_cast<double>(l_max_dram_databus_util));
// Limit input utilization if needed
if (i_utilization > l_max_util)
@@ -378,9 +378,8 @@ extern "C" {
if (l_num_mba_with_dimms > 1)
{
- l_max_util_power_calc = (l_max_util < (static_cast<double>(convert_to_percent(DRAM_UTIL_LIMIT_BOTH_MBA_WITH_DIMMS)))) ?
- l_max_util : (
- static_cast<double>(convert_to_percent(DRAM_UTIL_LIMIT_BOTH_MBA_WITH_DIMMS)));
+ l_max_util_power_calc = (l_max_util < (convert_to_percent(static_cast<double>(DRAM_UTIL_LIMIT_BOTH_MBA_WITH_DIMMS)))) ?
+ l_max_util : (convert_to_percent(static_cast<double>(DRAM_UTIL_LIMIT_BOTH_MBA_WITH_DIMMS)));
}
FAPI_INF("%s [Max Util for power calculations %4.2lf percent]", mss::c_str(i_target_mba), l_max_util_power_calc);
@@ -397,7 +396,7 @@ extern "C" {
// throttling disabled with M=0, use MAX_UTIL
if (l_throttle_d == 0)
{
- l_util_power_calc = convert_to_percent(MAX_UTIL);
+ l_util_power_calc = convert_to_percent(static_cast<double>(MAX_UTIL));
}
// throttling enabled, use calculated throttle settings to determine utilization
else
@@ -426,8 +425,8 @@ extern "C" {
// throttling disabled with M=0, use MAX_UTIL
if (l_throttle_d == 0)
{
- l_utilization_calc = convert_to_percent(MAX_UTIL);
- l_utilization_calc_without_throttle_adder = convert_to_percent(MAX_UTIL);
+ l_utilization_calc = convert_to_percent(static_cast<double>(MAX_UTIL));
+ l_utilization_calc_without_throttle_adder = convert_to_percent(static_cast<double>(MAX_UTIL));
}
// throttling enabled, use calculated throttle settings to determine utilization
else
diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.H b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.H
index 20f78b47e..1462c767c 100644
--- a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.H
+++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_bulk_pwr_throttles.H
@@ -51,7 +51,7 @@ constexpr uint8_t PERCENT_CONVERSION = 100;
///
/// @brief This function will convert a value with units of centi percent to percent
/// @tparam T the type to convert into a percentage
-/// @param[in] i_value: uint32_t value in centi percent
+/// @param[in] i_value: value in centi percent
/// @return the value in percent
///
template<typename T>
@@ -68,8 +68,8 @@ typedef fapi2::ReturnCode (*p9c_mss_bulk_pwr_throttles_FP_t)
typedef fapi2::ReturnCode (*p9c_mss_bulk_pwr_channel_pair_power_curve_FP_t)
(
const fapi2::Target<fapi2::TARGET_TYPE_MBA>&,
- double,
- double
+ double&,
+ double&
);
typedef fapi2::ReturnCode (*p9c_mss_bulk_pwr_util_to_throttle_power_FP_t)
diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_eff_config_thermal.C b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_eff_config_thermal.C
index 69fe85e6e..c613abb9f 100644
--- a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_eff_config_thermal.C
+++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_eff_config_thermal.C
@@ -638,11 +638,12 @@ extern "C" {
i_target_mba, l_channel_pair_thermal_power_limit));
// Initialize the runtime throttle attributes to an unthrottled value for mss_bulk_pwr_throttles
- l_runtime_throttle_n_per_mba = (static_cast<uint32_t>(l_runtime_throttle_d * ((static_cast<double>
- (convert_to_percent(l_max_dram_databus_util))) / PERCENT_CONVERSION) / ADDR_TO_DATA_UTIL_CONVERSION));
- l_runtime_throttle_n_per_chip = (static_cast<uint32_t>(l_runtime_throttle_d * ((static_cast<double>
- (convert_to_percent(l_max_dram_databus_util))) / PERCENT_CONVERSION) / ADDR_TO_DATA_UTIL_CONVERSION) *
- l_throttle_multiplier);
+ l_runtime_throttle_n_per_mba = (static_cast<uint32_t>(l_runtime_throttle_d *
+ ((convert_to_percent(static_cast<double>(l_max_dram_databus_util))) / PERCENT_CONVERSION) /
+ ADDR_TO_DATA_UTIL_CONVERSION));
+ l_runtime_throttle_n_per_chip = (static_cast<uint32_t>(l_runtime_throttle_d *
+ ((convert_to_percent(static_cast<double>(l_max_dram_databus_util))) / PERCENT_CONVERSION) /
+ ADDR_TO_DATA_UTIL_CONVERSION) * l_throttle_multiplier);
// for better custom dimm performance for DDR4, set the per mba throttle to the per chip throttle
// Not planning on doing this for DDR3
diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_util_to_throttle.C b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_util_to_throttle.C
index 11ee3d3a7..6f2d61eaa 100644
--- a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_util_to_throttle.C
+++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_util_to_throttle.C
@@ -40,11 +40,10 @@
// My Includes
//------------------------------------------------------------------------------
#include <p9c_mss_util_to_throttle.H>
-#include <p9c_mss_bulk_pwr_throttles.C>
#include <p9c_mss_bulk_pwr_throttles.H>
#include <generic/memory/lib/utils/c_str.H>
#include <fapi2.H>
-#include <generic/memory/lib/utils/c_str.H>
+#include <generic/memory/lib/utils/count_dimm.H>
using fapi2::FAPI2_RC_SUCCESS;
diff --git a/src/import/generic/memory/lib/utils/find.H b/src/import/generic/memory/lib/utils/find.H
index f5f723438..b8d6c7976 100644
--- a/src/import/generic/memory/lib/utils/find.H
+++ b/src/import/generic/memory/lib/utils/find.H
@@ -48,6 +48,7 @@ namespace mss
/// @tparam M the target type to be returned
/// @tparam T the fapi2 target type of the argument
/// @param[in] i_target the fapi2 target T
+/// @param[in] i_state [optional] fapi2 target state (defaults to TARGET_STATE_FUNCTIONAL)
/// @return a vector of M targets.
/// @note Only works for valid parent-child relationships
/// So calling find_targets<TARGET_TYPE_DIMM>(l_mca) will work here
@@ -56,26 +57,8 @@ namespace mss
/// If we do, it's on fapi2
///
template< fapi2::TargetType M, fapi2::TargetType T >
-inline std::vector< fapi2::Target<M> > find_targets( const fapi2::Target<T>& i_target)
-{
- return i_target.template getChildren<M>();
-}
-
-///
-/// @brief find a set of elements based on a fapi2 target
-/// @tparam M the target type to be returned
-/// @tparam T the fapi2 target type of the argument
-/// @param[in] i_target the fapi2 target T
-/// @param[in] i_state the fapi2 target state for the children of i_target
-/// @return a vector of M targets that match the target state specified
-/// @note Only works for valid parent-child relationships
-/// So calling find_targets<TARGET_TYPE_DIMM>(l_mca) will work here
-/// but calling find_targets<TARGET_TYPE_DIMM>(l_mcs) will not work
-/// Compiler will freak out and we'll never get a bad relationship/ error at runtime
-/// If we do, it's on fapi2
-///
-template< fapi2::TargetType M, fapi2::TargetType T >
-inline std::vector< fapi2::Target<M> > find_targets( const fapi2::Target<T>& i_target, fapi2::TargetState i_state)
+inline std::vector< fapi2::Target<M> > find_targets( const fapi2::Target<T>& i_target,
+ fapi2::TargetState i_state = fapi2::TARGET_STATE_FUNCTIONAL )
{
return i_target.template getChildren<M>(i_state);
}
@@ -212,9 +195,10 @@ inline fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> find_target( const fapi2::Tar
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_DMI> >
-find_targets( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target )
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ fapi2::TargetState i_state )
{
- return i_target.getChildren<fapi2::TARGET_TYPE_DMI>();
+ return i_target.getChildren<fapi2::TARGET_TYPE_DMI>(i_state);
}
///
@@ -224,9 +208,10 @@ find_targets( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target )
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> >
-find_targets( const fapi2::Target<fapi2::TARGET_TYPE_DMI>& i_target )
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_DMI>& i_target,
+ fapi2::TargetState i_state )
{
- return i_target.getChildren<fapi2::TARGET_TYPE_MEMBUF_CHIP>();
+ return i_target.getChildren<fapi2::TARGET_TYPE_MEMBUF_CHIP>(i_state);
}
///
@@ -236,9 +221,10 @@ find_targets( const fapi2::Target<fapi2::TARGET_TYPE_DMI>& i_target )
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MBA> >
-find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target )
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target,
+ fapi2::TargetState i_state )
{
- return i_target.getChildren<fapi2::TARGET_TYPE_MBA>();
+ return i_target.getChildren<fapi2::TARGET_TYPE_MBA>(i_state);
}
///
@@ -248,13 +234,14 @@ find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target )
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MBA> >
-find_targets( const fapi2::Target<fapi2::TARGET_TYPE_DMI>& i_target )
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_DMI>& i_target,
+ fapi2::TargetState i_state )
{
std::vector< fapi2::Target<fapi2::TARGET_TYPE_MBA> > l_mbas;
- for (const auto& membuf_chip : i_target.getChildren<fapi2::TARGET_TYPE_MEMBUF_CHIP>())
+ for (const auto& membuf_chip : i_target.getChildren<fapi2::TARGET_TYPE_MEMBUF_CHIP>(i_state))
{
- auto l_these_mbas( membuf_chip.getChildren<fapi2::TARGET_TYPE_MBA>() );
+ auto l_these_mbas( membuf_chip.getChildren<fapi2::TARGET_TYPE_MBA>(i_state) );
l_mbas.insert(l_mbas.end(), l_these_mbas.begin(), l_these_mbas.end());
}
@@ -268,13 +255,14 @@ find_targets( const fapi2::Target<fapi2::TARGET_TYPE_DMI>& i_target )
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> >
-find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target )
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target,
+ fapi2::TargetState i_state )
{
std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> > l_dimms;
- for (const auto& l_mba : i_target.getChildren<fapi2::TARGET_TYPE_MBA>())
+ for (const auto& l_mba : i_target.getChildren<fapi2::TARGET_TYPE_MBA>(i_state))
{
- auto l_these_dimms( l_mba.getChildren<fapi2::TARGET_TYPE_DIMM>() );
+ auto l_these_dimms( l_mba.getChildren<fapi2::TARGET_TYPE_DIMM>(i_state) );
l_dimms.insert(l_dimms.end(), l_these_dimms.begin(), l_these_dimms.end());
}
@@ -288,14 +276,15 @@ find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP>& i_target )
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> >
-find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target )
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target,
+ fapi2::TargetState i_state )
{
std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> > l_dimms;
// At this time, fapi2 (cronus?) doesn't seem to recognize a DIMM is the child of an MCS.
- for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>())
+ for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>(i_state))
{
- auto l_these_dimms( p.getChildren<fapi2::TARGET_TYPE_DIMM>() );
+ auto l_these_dimms( p.getChildren<fapi2::TARGET_TYPE_DIMM>(i_state) );
l_dimms.insert(l_dimms.end(), l_these_dimms.begin(), l_these_dimms.end());
}
@@ -309,13 +298,14 @@ find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target )
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> >
-find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
+find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ fapi2::TargetState i_state )
{
std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> > l_dimms;
- for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>())
+ for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>(i_state))
{
- auto l_these_dimms( p.getChildren<fapi2::TARGET_TYPE_DIMM>() );
+ auto l_these_dimms( p.getChildren<fapi2::TARGET_TYPE_DIMM>(i_state) );
l_dimms.insert(l_dimms.end(), l_these_dimms.begin(), l_these_dimms.end());
}
@@ -329,9 +319,10 @@ find_targets( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> > find_targets
-( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target )
+( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ fapi2::TargetState i_state )
{
- return i_target.getChildren<fapi2::TARGET_TYPE_MCS>();
+ return i_target.getChildren<fapi2::TARGET_TYPE_MCS>(i_state);
}
///
/// @brief find all the MCS connected to an MCBIST
@@ -341,12 +332,13 @@ inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> > find_targets
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> > find_targets
-( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
+( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ fapi2::TargetState i_state )
{
std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> > l_mcses;
// At this time, fapi2 (cronus?) doesn't seem to recognize a MCS is the child of an MCBIST
- for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>())
+ for (const auto& p : i_target.getChildren<fapi2::TARGET_TYPE_MCA>(i_state))
{
fapi2::Target<fapi2::TARGET_TYPE_MCS> l_mcs = p.getParent<fapi2::TARGET_TYPE_MCS>();
@@ -370,9 +362,10 @@ inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> > find_targets
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > find_targets
-( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
+( const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target,
+ fapi2::TargetState i_state )
{
- return i_target.getChildren<fapi2::TARGET_TYPE_MCA>();
+ return i_target.getChildren<fapi2::TARGET_TYPE_MCA>(i_state);
}
///
@@ -382,7 +375,8 @@ inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > find_targets
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > find_targets
-( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target )
+( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ fapi2::TargetState i_state )
{
// TODO - RTC:174905. Find out if we really need a find API that returns a vector of MCA from an MCA
std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > l_temp = {i_target};
@@ -468,9 +462,10 @@ inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > find_targets_with_ma
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > find_targets
-( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target )
+( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target,
+ fapi2::TargetState i_state )
{
- return i_target.getChildren<fapi2::TARGET_TYPE_MCA>();
+ return i_target.getChildren<fapi2::TARGET_TYPE_MCA>(i_state);
}
///
@@ -480,9 +475,10 @@ inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > find_targets
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> > find_targets
-( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target )
+( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
+ fapi2::TargetState i_state )
{
- return i_target.getChildren<fapi2::TARGET_TYPE_DIMM>();
+ return i_target.getChildren<fapi2::TARGET_TYPE_DIMM>(i_state);
}
///
@@ -503,9 +499,10 @@ inline fapi2::Target<fapi2::TARGET_TYPE_MCS> find_target( const fapi2::Target<fa
///
template<>
inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCBIST> > find_targets(
- const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target )
+ const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ fapi2::TargetState i_state )
{
- return i_target.getChildren<fapi2::TARGET_TYPE_MCBIST>();
+ return i_target.getChildren<fapi2::TARGET_TYPE_MCBIST>(i_state);
}
///
OpenPOWER on IntegriCloud