summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C49
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H14
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C44
3 files changed, 87 insertions, 20 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C
index 11da9b2dd..e9bc4a3bb 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.C
@@ -290,18 +290,49 @@ fapi2::ReturnCode get_power_attrs (const fapi2::Target<fapi2::TARGET_TYPE_MCS>&
{
const auto l_mca_pos = mss::index (find_target<TARGET_TYPE_MCA>(l_dimm));
const auto l_dimm_pos = mss::index (l_dimm);
+
mss::dimm::kind l_kind (l_dimm);
mss::power_thermal::decoder l_decoder(l_kind);
FAPI_TRY( l_decoder.generate_encoding() );
- FAPI_TRY( l_decoder.find_slope(i_slope) );
- FAPI_TRY( l_decoder.find_intercept(i_intercept) );
- FAPI_TRY( l_decoder.find_thermal_power_limit(i_thermal_power_limit) );
-
- o_vddr_slope [l_mca_pos][l_dimm_pos] = l_decoder.iv_vddr_slope;
- o_vddr_int [l_mca_pos][l_dimm_pos] = l_decoder.iv_vddr_intercept;
- o_total_slope [l_mca_pos][l_dimm_pos] = l_decoder.iv_total_slope;
- o_total_int [l_mca_pos][l_dimm_pos] = l_decoder.iv_total_intercept;
- o_thermal_power [l_mca_pos][l_dimm_pos] = l_decoder.iv_thermal_power_limit;
+
+ // The first entry into these arrays must be valid
+ // If we don't find any values, the attributes aren't found so go with some defaults
+ if (i_slope.empty() || i_slope[0] == 0)
+ {
+ FAPI_INF("ATTR_MSS_MRW_PWR_SLOPE not found!!");
+ o_vddr_slope [l_mca_pos][l_dimm_pos] = default_power::VDDR_SLOPE;
+ o_total_slope [l_mca_pos][l_dimm_pos] = default_power::TOTAL_SLOPE;
+ }
+ else
+ {
+ FAPI_TRY( l_decoder.find_slope(i_slope) );
+ o_vddr_slope [l_mca_pos][l_dimm_pos] = l_decoder.iv_vddr_slope;
+ o_total_slope [l_mca_pos][l_dimm_pos] = l_decoder.iv_total_slope;
+ }
+
+ if (i_intercept.empty() || i_intercept[0] == 0)
+ {
+ FAPI_INF("ATTR_MSS_MRW_PWR_INTERCEPT not found!!");
+ o_total_int [l_mca_pos][l_dimm_pos] = default_power::TOTAL_INT;
+ o_vddr_int [l_mca_pos][l_dimm_pos] = default_power::VDDR_INT;
+ }
+ else
+ {
+ FAPI_TRY( l_decoder.find_intercept(i_intercept) );
+ o_vddr_int [l_mca_pos][l_dimm_pos] = l_decoder.iv_vddr_intercept;
+ o_total_int [l_mca_pos][l_dimm_pos] = l_decoder.iv_total_intercept;
+ }
+
+ if (i_thermal_power_limit.empty() || i_thermal_power_limit[0] == 0)
+ {
+ FAPI_INF("ATTR_MSS_MRW_THERMAL_MEMORY_POWER_LIMIT not found!!");
+ o_thermal_power [l_mca_pos][l_dimm_pos] = default_power::THERMAL_LIMIT;
+ }
+ else
+ {
+ FAPI_TRY( l_decoder.find_thermal_power_limit(i_thermal_power_limit) );
+ o_thermal_power [l_mca_pos][l_dimm_pos] = l_decoder.iv_thermal_power_limit;
+ }
}
fapi_try_exit:
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H
index aa339fd93..07c293462 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/decoder.H
@@ -51,6 +51,20 @@ enum size_of_attrs : size_t
SIZE_OF_THERMAL_ATTR = 10,
};
+enum default_power
+{
+ //Values are the worst case defaults for power curves
+ //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).
+ VDDR_SLOPE = 0x41A,
+ VDDR_INT = 0x384,
+ TOTAL_SLOPE = 0x44C,
+ TOTAL_INT = 0x44C,
+ THERMAL_LIMIT = 0x794,
+};
+
//Currently needs to be in sorted order for lookup to work
static const std::vector< std::pair<uint32_t , uint8_t> > DIMM_SIZE_MAP =
{
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
index 3935ef805..11337674a 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
@@ -67,23 +67,45 @@ extern "C"
std::vector< uint64_t > l_tintercept (mss::power_thermal::SIZE_OF_POWER_CURVES_ATTRS, 0);
std::vector< uint64_t > l_tthermal_power_limit (mss::power_thermal::SIZE_OF_THERMAL_ATTR, 0);
- std::vector<fapi2::buffer< uint64_t>> l_slope (mss::power_thermal::SIZE_OF_POWER_CURVES_ATTRS);
- std::vector<fapi2::buffer< uint64_t>> l_intercept (mss::power_thermal::SIZE_OF_POWER_CURVES_ATTRS);
- std::vector<fapi2::buffer< uint64_t>> l_thermal_power_limit (mss::power_thermal::SIZE_OF_THERMAL_ATTR);
+ std::vector<fapi2::buffer< uint64_t>> l_slope = {};
+ std::vector<fapi2::buffer< uint64_t>> l_intercept = {};
+ std::vector<fapi2::buffer< uint64_t>> l_thermal_power_limit = {};
FAPI_TRY( mss::mrw_pwr_slope (l_tslope.data() ));
FAPI_TRY( mss::mrw_pwr_intercept (l_tintercept.data()) );
FAPI_TRY( mss::mrw_thermal_memory_power_limit (l_tthermal_power_limit.data()) );
-
- for (size_t i = 0; i < l_slope.size(); ++i)
{
- l_slope[i] = fapi2::buffer<uint64_t> (l_tslope[i]);
- l_intercept[i] = fapi2::buffer<uint64_t>(l_tintercept[i]);
- }
+ for (auto l_tslope_iter = l_tslope.begin(); l_tslope_iter != l_tslope.end(); ++l_tslope_iter)
+ {
+ auto l_slope_buf = fapi2::buffer<uint64_t> (*l_tslope_iter);
- for (size_t i = 0; i < l_thermal_power_limit.size(); ++i)
- {
- l_thermal_power_limit[i] = fapi2::buffer<uint64_t> (l_tthermal_power_limit[i]);
+ if (l_slope_buf != 0)
+ {
+ l_slope.push_back(l_slope_buf);
+ }
+ }
+
+ for (auto l_tintercept_iter = l_tintercept.begin(); l_tintercept_iter != l_tintercept.end(); ++l_tintercept_iter)
+ {
+ auto l_intercept_buf = fapi2::buffer<uint64_t> (*l_tintercept_iter);
+
+ if (l_intercept_buf != 0)
+ {
+ l_intercept.push_back(l_intercept_buf);
+ }
+ }
+
+ for (auto l_tthermal_iter = l_tthermal_power_limit.begin();
+ l_tthermal_iter != l_tthermal_power_limit.end();
+ ++l_tthermal_iter)
+ {
+ auto l_tthermal_buf = fapi2::buffer<uint64_t> (*l_tthermal_iter);
+
+ if (l_tthermal_buf != 0)
+ {
+ l_thermal_power_limit.push_back(l_tthermal_buf);
+ }
+ }
}
//Restore runtime_throttles from safemode setting
OpenPOWER on IntegriCloud