diff options
author | Michael Pardeik <pardeik@us.ibm.com> | 2019-10-01 15:55:23 -0500 |
---|---|---|
committer | Christian R Geddes <crgeddes@us.ibm.com> | 2019-11-15 17:25:42 -0600 |
commit | fe09e7b9d29b238b07f8d1017fc0c195843c654f (patch) | |
tree | 5838485d50eefcf67c74a4e51a6bb3df97be8ddc /src/import/chips/ocmb/explorer/procedures/hwp/memory/lib | |
parent | dfba68af85eaded297f58d25f33f27b88677b300 (diff) | |
download | talos-hostboot-fe09e7b9d29b238b07f8d1017fc0c195843c654f.tar.gz talos-hostboot-fe09e7b9d29b238b07f8d1017fc0c195843c654f.zip |
exp_mss_eff_config_thermal fixes
Fix pwr_throttles call for thermal throttle type
Fix equalize throttles call for power throttling type
Updates to handle DDIMM and non-DDIMM differences
Clarify related power and thermal MRW attribute descriptions
Change-Id: I34ecfd4bbb97f1e74c258a474e0b5daf3a4dcbbb
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84620
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Dev-Ready: STEPHEN GLANCY <sglancy@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>
Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/84699
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: Christian R Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/lib')
4 files changed, 55 insertions, 41 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_decoder.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_decoder.C index 3411bc1d3..ea703b9e7 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_decoder.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_decoder.C @@ -25,7 +25,7 @@ /// /// @file exp_decoder.C -/// @brief Decode MSS_MRW_PWR_CURVE_SLOPE, PWR_CURVE_INTERCEPT, and THERMAL_POWER_LIMIT +/// @brief Decode MRW attributes for DIMM power curves and power limits /// // *HWP HWP Owner: Louis Stermole <stermole@us.ibm.com> // *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com> @@ -63,9 +63,9 @@ const std::vector< std::pair<uint8_t , uint8_t> > throttle_traits<mss::mc_type:: /// /// @brief Finds a value for the power curve slope attributes by matching the generated hashes -/// @param[in] i_slope vector of generated key-values from POWER_CURVE_SLOPE +/// @param[in] i_slope vector of generated key-values from MRW power curve attriutes /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful -/// @note populates iv_vddr_slope, iv_total_slop +/// @note populates iv_vddr_slope, iv_total_slope /// template<> fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_slope ( @@ -74,7 +74,7 @@ fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_slope ( using TT = throttle_traits<mss::mc_type::EXPLORER>; // For explorer, two attribute are used to get slope (i_slope[0], i_slope[1]) - // ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_PWR_SLOPE is for thermal power slope + // ATTR_MSS_MRW_OCMB_PWR_SLOPE is for thermal power slope // ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT is for power slope FAPI_ASSERT(i_slope.size() == 2, fapi2::MSS_POWER_THERMAL_ATTR_VECTORS_INCORRECT() @@ -88,7 +88,7 @@ fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_slope ( // To get thermal power slope FAPI_TRY( (get_power_thermal_value<TT::THERMAL_START, TT::THERMAL_LENGTH, SLOPE>( *i_slope[0], - "ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_PWR_SLOPE", + "ATTR_MSS_MRW_OCMB_PWR_SLOPE", iv_total_slope)) ); // To get power slope @@ -103,7 +103,7 @@ fapi_try_exit: /// /// @brief Finds a value for power curve intercept attributes by matching the generated hashes -/// @param[in] i_intercept vector of generated key-values for ATTR_MSS_MRW_POWER_CURVE_INTERCEPT +/// @param[in] i_intercept vector of generated key-values from MRW power curve attributes /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful /// @note populates iv_vddr_intercept, iv_total_intercept /// @@ -114,7 +114,7 @@ fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_intercept ( using TT = throttle_traits<mss::mc_type::EXPLORER>; // For explorer, two attribute are used to get slope (i_slope[0], i_slope[1]) - // ATTR_MSS_MRW_OCMB_POWER_INTERCEPT is for thermal power intercept + // ATTR_MSS_MRW_OCMB_PWR_INTERCEPT is for thermal power intercept // ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT is for power intercept FAPI_ASSERT(i_intercept.size() == 2, fapi2::MSS_POWER_THERMAL_ATTR_VECTORS_INCORRECT() @@ -128,7 +128,7 @@ fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_intercept ( // To get thermal power intercept FAPI_TRY( (get_power_thermal_value<TT::THERMAL_START, TT::THERMAL_LENGTH, INTERCEPT>( *i_intercept[0], - "ATTR_MSS_MRW_OCMB_POWER_INTERCEPT", + "ATTR_MSS_MRW_OCMB_PWR_INTERCEPT", iv_total_intercept)) ); // To get power intercept @@ -143,10 +143,10 @@ fapi_try_exit: /// -/// @brief Finds a value from ATTR_MSS_MRW_THERMAL_MEMORY_POWER_LIMIT and stores in iv variable -/// @param[in] i_thermal_limits is a vector of the generated values from ATTR_MSS_MRW_THERMAL_POWER_LIMIT +/// @brief Finds a value for the power limit attributes by matching the generated hashes +/// @param[in] i_thermal_limits is a vector of the generated values from MRW power limit attributes /// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff the encoding was successful -/// @note populates thermal_power_limit. +/// @note populates iv_thermal_power_limit, iv_power_limit /// template<> fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_thermal_power_limit ( @@ -172,7 +172,7 @@ fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_thermal_power_limit ( "ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_POWER_LIMIT", iv_thermal_power_limit)) ); - // To get power intercept + // To get regulator power or current limit FAPI_TRY( (get_power_thermal_value<TT::POWER_LIMIT_START, TT::POWER_LIMIT_LENGTH, POWER_LIMIT>( *i_thermal_limits[1], "ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT", @@ -184,19 +184,19 @@ fapi_try_exit: /// -/// @brief find the power curve attributes for each dimm on an MCS target -/// @param[in] i_targets vector of MCS targets on which dimm attrs will be set -/// @param[in] i_slope vector of generated hashes for encoding and values for MSS_MRW_POWER_SLOPE -/// @param[in] i_intercept vector of generated hashes for encoding and values for MSS_MRW_POWER_INTERCEPT -/// @param[in] i_thermal_power_limit vector of generated hashes for encoding and values for MSS_MRW_THERMAL_MEMORY_POWER_LIMIT -/// @param[out] o_vddr_slope the VDDR power curve slope for each dimm -/// @param[out] o_vddr_int the VDDR power curve intercept for each dimm -/// @param[out] o_total_slope the VDDR+VPP power curve slope for each dimm -/// @param[out] o_total_int the VDDR+VPP power curve intercept for each dimm -/// @param[out] o_thermal_power the thermal power limit for the dimm +/// @brief find the power curve attributes for each dimm on an MEM_PORT target +/// @param[in] i_throttle_type specifies whether this is for power or thermal throttling +/// @param[in] i_port vector of MEM_PORT targets on which dimm attrs will be set +/// @param[in] i_slope vector of generated hashes for encoding the values for memory power curve slopes +/// @param[in] i_intercept vector of generated hashes for encoding the values for memory power curve intercepts +/// @param[in] i_thermal_power_limit vector of generated hashes for encoding the values for memory power limits +/// @param[in] i_current_curve_with_limit vector of generated hashes for encoding the values for regulator power curves and limits +/// @param[out] o_slope the power curve slope for each dimm +/// @param[out] o_intercept the power curve intercept for each dimm +/// @param[out] o_limit the power limit for the dimm /// @return FAPI2_RC_SUCCESS iff ok /// @note used to set power curve attributes in calling function -/// @note decodes the attribute "encoding" to get the vddr and vddr/vpp power curves for a dimm +/// @note decodes the attribute "encoding" to get the power curves and power limits for a dimm /// fapi2::ReturnCode get_power_attrs (const mss::throttle_type i_throttle_type, const fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT>& i_port, @@ -217,6 +217,13 @@ fapi2::ReturnCode get_power_attrs (const mss::throttle_type i_throttle_type, mss::power_thermal::decoder<> l_decoder(l_kind); fapi2::buffer<uint64_t> l_attr_value; + // DDIMMs mrw slope/intercept/limit attribute values are for whole DDIMM, so divide these by total number of virtual DIMMs + // to get it to a DIMM level. This will get the DIMM count to use in later calculations. + // ISDIMMs use a value of 1 since mrw attribute values are at the DIMM level + uint8_t l_number_dimm_for_attr_value = (l_kind.iv_dimm_type == fapi2::ENUM_ATTR_MEM_EFF_DIMM_TYPE_DDIMM) ? + mss::count_dimm(mss::find_target<fapi2::TARGET_TYPE_OCMB_CHIP>(l_dimm)) : + 1; + FAPI_TRY( l_decoder.generate_encoding(), "%s Error in get_power_attrs", mss::c_str(l_dimm) ); // The first entry into these arrays must be valid @@ -228,7 +235,8 @@ fapi2::ReturnCode get_power_attrs (const mss::throttle_type i_throttle_type, FAPI_INF("%s ATTR_MSS_MRW_OCMB_PWR_SLOPE not found or has zero values", mss::c_str(l_dimm)); o_slope[l_dimm_pos] = - (i_throttle_type == mss::throttle_type::POWER) ? TT::POWER_SLOPE : TT::TOTAL_SLOPE; + ((i_throttle_type == mss::throttle_type::POWER) ? TT::POWER_SLOPE : TT::TOTAL_SLOPE) / + l_number_dimm_for_attr_value; } else { @@ -237,7 +245,8 @@ fapi2::ReturnCode get_power_attrs (const mss::throttle_type i_throttle_type, FAPI_TRY( l_decoder.find_slope(l_slope), "%s Error in get_power_attrs", mss::c_str(l_dimm) ); o_slope[l_dimm_pos] = - (i_throttle_type == mss::throttle_type::POWER) ? l_decoder.iv_vddr_slope : l_decoder.iv_total_slope; + ((i_throttle_type == mss::throttle_type::POWER) ? l_decoder.iv_vddr_slope : l_decoder.iv_total_slope) / + l_number_dimm_for_attr_value; } l_attr_value = i_intercept[0]; @@ -247,7 +256,8 @@ fapi2::ReturnCode get_power_attrs (const mss::throttle_type i_throttle_type, FAPI_INF("%s ATTR_MSS_MRW_OCMB_PWR_INTERCEPT not found or has zero values", mss::c_str(l_dimm)); o_intercept[l_dimm_pos] = - (i_throttle_type == mss::throttle_type::POWER) ? TT::POWER_INT : TT::TOTAL_INT; + ((i_throttle_type == mss::throttle_type::POWER) ? TT::POWER_INT : TT::TOTAL_INT) / + l_number_dimm_for_attr_value; } else { @@ -256,7 +266,8 @@ fapi2::ReturnCode get_power_attrs (const mss::throttle_type i_throttle_type, FAPI_TRY( l_decoder.find_intercept(l_intercept), "%s Error in get_power_attrs", mss::c_str(l_dimm) ); o_intercept[l_dimm_pos] = - (i_throttle_type == mss::throttle_type::POWER) ? l_decoder.iv_vddr_intercept : l_decoder.iv_total_intercept; + ((i_throttle_type == mss::throttle_type::POWER) ? l_decoder.iv_vddr_intercept : l_decoder.iv_total_intercept) / + l_number_dimm_for_attr_value; } l_attr_value = i_thermal_power_limit[0]; @@ -268,7 +279,8 @@ fapi2::ReturnCode get_power_attrs (const mss::throttle_type i_throttle_type, // The unit of limit and intercept is cA but limit is dA in mss::throttle_type::POWER // So we need to transfer them to the same unit o_limit[l_dimm_pos] = - (i_throttle_type == mss::throttle_type::POWER) ? TT::POWER_LIMIT * DECI_TO_CENTI : TT::THERMAL_LIMIT; + ((i_throttle_type == mss::throttle_type::POWER) ? TT::POWER_LIMIT* DECI_TO_CENTI : TT::THERMAL_LIMIT) / + l_number_dimm_for_attr_value; } else { @@ -279,8 +291,10 @@ fapi2::ReturnCode get_power_attrs (const mss::throttle_type i_throttle_type, // The unit of limit and intercept is cA but limit is dA in mss::throttle_type::POWER // So we need to transfer them to the same unit o_limit[l_dimm_pos] = - (i_throttle_type == mss::throttle_type::POWER) ? l_decoder.iv_power_limit * DECI_TO_CENTI : - l_decoder.iv_thermal_power_limit; + ((i_throttle_type == mss::throttle_type::POWER) ? + l_decoder.iv_power_limit* DECI_TO_CENTI : l_decoder.iv_thermal_power_limit + ) / + l_number_dimm_for_attr_value; } } diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle.C index 0e95aebb7..dbed7a8c0 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle.C @@ -61,7 +61,7 @@ namespace power_thermal fapi2::ReturnCode pwr_throttles( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target, const mss::throttle_type i_throttle_type) { - FAPI_INF("Start exp_bulk_pwr_throttle for %s type throttling for %s", + FAPI_INF("Start pwr_throttles for %s type throttling for %s", (( i_throttle_type == mss::throttle_type::THERMAL) ? "THERMAL" : "POWER"), mss::c_str(i_target)); if (mss::count_dimm (i_target) == 0) @@ -109,11 +109,11 @@ fapi2::ReturnCode pwr_throttles( const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHI FAPI_TRY(mss::attr::set_mem_throttled_n_commands_per_port( l_port_target, l_port)); } - FAPI_INF("End bulk_pwr_throttles for %s", mss::c_str(i_target)); + FAPI_INF("End pwr_throttles for %s", mss::c_str(i_target)); return fapi2::current_err; fapi_try_exit: - FAPI_ERR("Error calculating bulk_pwr_throttles using %s throttling", + FAPI_ERR("Error calculating pwr_throttles using %s throttling", ((i_throttle_type == mss::throttle_type::POWER) ? "power" : "thermal")); return fapi2::current_err; } diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle.H index 683e484e0..17f8a7dbc 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle.H @@ -43,6 +43,7 @@ #include <mss_explorer_attribute_setters.H> #include <mss_explorer_attribute_getters.H> #include <lib/power_thermal/exp_throttle_traits.H> +#include <generic/memory/lib/utils/dimm/kind.H> #include <generic/memory/lib/utils/power_thermal/gen_throttle.H> namespace mss diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle_traits.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle_traits.H index 21e003434..0b0d06572 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle_traits.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/power_thermal/exp_throttle_traits.H @@ -85,17 +85,16 @@ class throttle_traits<mss::mc_type::EXPLORER> //They are the default/ catch-all values from the power curve attributes //Shouldn't be used if system is set up correctly and attributes are available //This will throttle the DIMMs to ~76% dram data bus utilization - //(using the mrw regulator power limit of 1700 cW and thermal power limit here of 1940 cW). - // TODO: Need to fill the right value. The current value is from Nimbus + //(using the mrw regulator current limit of 100 dA cW and thermal power limit here of 2175 cW). // Thermal power (OCMB+DRAM) - TOTAL_SLOPE = 0x44C, - TOTAL_INT = 0x44C, - THERMAL_LIMIT = 0x794, + TOTAL_SLOPE = 0x462, + TOTAL_INT = 0x526, + THERMAL_LIMIT = 0x87F, // Power (PMIC) - POWER_SLOPE = 0x41A, - POWER_INT = 0x384, - POWER_LIMIT = 0x794, + POWER_SLOPE = 0x152, + POWER_INT = 0x94, + POWER_LIMIT = 0x64, }; |