Skip to content

Commit

Permalink
Clean up for p10 porting dependency errors
Browse files Browse the repository at this point in the history
CMVC-Coreq: 1094420
Change-Id: I02b8dfab08121d4ac9ffbb7dedd37f7083bf527f
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/81543
Dev-Ready: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82367
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>
  • Loading branch information
aamarin authored and dcrowell77 committed Oct 16, 2019
1 parent 0571992 commit b403e67
Show file tree
Hide file tree
Showing 11 changed files with 147 additions and 121 deletions.
Expand Up @@ -129,15 +129,15 @@ extern "C"

// Set the thermal power throttle
//Set the PMIC current slope, intercept and limit
mss::power_thermal::get_power_attrs (l_throttle_type,
l_port,
l_thermal_power_slope_v,
l_thermal_power_intecept_v,
l_thermal_power_limit_v,
l_current_curve_with_limit_v,
l_slope,
l_intercept,
l_limit);
FAPI_TRY( mss::power_thermal::get_power_attrs (l_throttle_type,
l_port,
l_thermal_power_slope_v,
l_thermal_power_intecept_v,
l_thermal_power_limit_v,
l_current_curve_with_limit_v,
l_slope,
l_intercept,
l_limit) );

FAPI_TRY(mss::attr::set_total_pwr_slope(l_port, l_slope));
FAPI_TRY(mss::attr::set_total_pwr_intercept(l_port, l_intercept));
Expand Down
Expand Up @@ -86,16 +86,16 @@ fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_slope (
2);

// To get thermal power slope
get_power_thermal_value<TT::THERMAL_START, TT::THERMAL_LENGTH, SLOPE>(
*i_slope[0],
"ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_PWR_SLOPE",
iv_total_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",
iv_total_slope)) );

// To get power slope
get_power_thermal_value<TT::POWER_SLOPE_START, TT::POWER_SLOPE_LENGTH, SLOPE>(
*i_slope[1],
"ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT",
iv_vddr_slope);
FAPI_TRY( (get_power_thermal_value<TT::POWER_SLOPE_START, TT::POWER_SLOPE_LENGTH, SLOPE>(
*i_slope[1],
"ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT",
iv_vddr_slope)) );

fapi_try_exit:
return fapi2::current_err;
Expand Down Expand Up @@ -126,16 +126,16 @@ fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_intercept (
2);

// To get thermal power intercept
get_power_thermal_value<TT::THERMAL_START, TT::THERMAL_LENGTH, INTERCEPT>(
*i_intercept[0],
"ATTR_MSS_MRW_OCMB_POWER_INTERCEPT",
iv_total_intercept);
FAPI_TRY( (get_power_thermal_value<TT::THERMAL_START, TT::THERMAL_LENGTH, INTERCEPT>(
*i_intercept[0],
"ATTR_MSS_MRW_OCMB_POWER_INTERCEPT",
iv_total_intercept)) );

// To get power intercept
get_power_thermal_value<TT::POWER_INTERCEPT_START, TT::POWER_INTERCEPT_LENGTH, INTERCEPT>(
*i_intercept[1],
"ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT",
iv_vddr_intercept);
FAPI_TRY( (get_power_thermal_value<TT::POWER_INTERCEPT_START, TT::POWER_INTERCEPT_LENGTH, INTERCEPT>(
*i_intercept[1],
"ATTR_MSS_MRW_OCMB_CURRENT_CURVE_WITH_LIMIT",
iv_vddr_intercept)) );

fapi_try_exit:
return fapi2::current_err;
Expand Down Expand Up @@ -167,16 +167,16 @@ fapi2::ReturnCode decoder<mss::mc_type::EXPLORER>::find_thermal_power_limit (
2);

// To get thermal power limit
get_power_thermal_value<TT::THERMAL_START, TT::THERMAL_LENGTH, POWER_LIMIT>(
*i_thermal_limits[0],
"ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_POWER_LIMIT",
iv_thermal_power_limit);
FAPI_TRY( (get_power_thermal_value<TT::THERMAL_START, TT::THERMAL_LENGTH, POWER_LIMIT>(
*i_thermal_limits[0],
"ATTR_MSS_MRW_OCMB_THERMAL_MEMORY_POWER_LIMIT",
iv_thermal_power_limit)) );

// To get power intercept
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",
iv_power_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",
iv_power_limit)) );

fapi_try_exit:
return fapi2::current_err;
Expand Down
Expand Up @@ -21661,6 +21661,28 @@ fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief ATTR_MEM_PORT_POS_OF_FAIL_THROTTLE getter
/// @param[out] uint64_t& reference to store the value
/// @note Generated by gen_accessors.pl generateParameters (SYSTEM)
/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
/// @note This is the fapi position of the port that failed to calculate memory throttles
/// given the passed in watt target and or
/// utilization
///
inline fapi2::ReturnCode port_pos_of_fail_throttle(uint64_t& o_value)
{

FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MEM_PORT_POS_OF_FAIL_THROTTLE, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
o_value) );
return fapi2::current_err;

fapi_try_exit:
FAPI_ERR("failed accessing ATTR_MEM_PORT_POS_OF_FAIL_THROTTLE: 0x%lx (system target)",
uint64_t(fapi2::current_err));
return fapi2::current_err;
}


}

Expand Down
Expand Up @@ -1177,18 +1177,6 @@
<mssAccessorName>mem_throttled_n_commands_per_port</mssAccessorName>
</attribute>

<attribute>
<id>ATTR_MSS_MEM_PORT_POS_OF_FAIL_THROTTLE</id>
<targetType>TARGET_TYPE_SYSTEM</targetType>
<description>
This is the fapi position of the port that failed to calculate
memory throttles given the passed in watt target and or utilization
</description>
<initToZero></initToZero>
<valueType>uint64</valueType>
<writeable/>
</attribute>

<attribute>
<id>ATTR_MSS_MEM_M_DRAM_CLOCKS</id>
<targetType>TARGET_TYPE_MCS</targetType>
Expand Down
Expand Up @@ -245,20 +245,6 @@
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_INVALID_FREQ_PASSED_IN</rc>
<description>
An invalid Freq value has been set
</description>
<ffdc>FREQ</ffdc>
<ffdc>FUNCTION</ffdc>
<ffdc>DIMM_TARGET</ffdc>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_ERROR_CREATING_EFF_CONFIG_DIMM_OBJECT</rc>
<description>
Expand Down Expand Up @@ -382,52 +368,6 @@
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_INVALID_PAGE_SIZE</rc>
<description>
Invalid page size
</description>
<ffdc>DRAM_WIDTH</ffdc>
<callout>
<procedure>MEMORY_PLUGGING_ERROR</procedure>
<priority>HIGH</priority>
</callout>
<callout>
<target>DIMM_TARGET</target>
<priority>MEDIUM</priority>
</callout>
<deconfigure>
<target>DIMM_TARGET</target>
</deconfigure>
<callout>
<procedure>CODE</procedure>
<priority>MEDIUM</priority>
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_INVALID_DRAM_WIDTH</rc>
<description>
Code only supports x4 and x8 drams at this time
</description>
<ffdc>DRAM_WIDTH</ffdc>
<callout>
<procedure>MEMORY_PLUGGING_ERROR</procedure>
<priority>HIGH</priority>
</callout>
<callout>
<target>DIMM_TARGET</target>
<priority>MEDIUM</priority>
</callout>
<deconfigure>
<target>DIMM_TARGET</target>
</deconfigure>
<callout>
<procedure>CODE</procedure>
<priority>MEDIUM</priority>
</callout>
</hwpError>

<hwpError>
<rc>RC_MSS_INVALID_RTT_PARK_CALCULATIONS</rc>
<description>
Expand Down
4 changes: 2 additions & 2 deletions src/import/generic/memory/lib/utils/dimm/mss_timing.H
Expand Up @@ -269,8 +269,8 @@ inline fapi2::ReturnCode calc_trfc_dlr(const fapi2::Target<fapi2::TARGET_TYPE_DI
// which they "shouldn't" mess up as long as use "attribute" enums.
// if openpower messes this up we can at least catch it
FAPI_ASSERT( false,
fapi2::MSS_INVALID_FINE_REFRESH()
.set_REFRESH_MODE(i_refresh_mode),
fapi2::MSS_INVALID_FINE_REFRESH_MODE()
.set_FINE_REF_MODE(i_refresh_mode),
"Incorrect Fine Refresh Mode received: %d ",
i_refresh_mode);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/import/generic/memory/lib/utils/mc/gen_mss_port.H
Expand Up @@ -524,7 +524,7 @@ inline fapi2::ReturnCode reset_reorder_queue_settings(const fapi2::Target<T>& i_
// Changes the reorder queue settings
{
// Two settings are FIFO and REORDER. FIFO is a 1 in the registers, while reorder is a 0 state
const mss::states l_state = ((l_reorder_queue == fapi2::ENUM_ATTR_MSS_REORDER_QUEUE_SETTING_FIFO) ?
const mss::states l_state = ((l_reorder_queue == fapi2::ENUM_ATTR_MEM_REORDER_QUEUE_SETTING_FIFO) ?
mss::states::ON : mss::states::OFF);
FAPI_TRY(configure_rrq(i_target, l_state), "%s failed to reset read reorder queue settings", mss::c_str(i_target));
FAPI_TRY(configure_wrq(i_target, l_state), "%s failed to reset read reorder queue settings", mss::c_str(i_target));
Expand Down
18 changes: 9 additions & 9 deletions src/import/generic/memory/lib/utils/power_thermal/gen_decoder.H
Expand Up @@ -272,7 +272,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_SIZE == l_uint32_buf)
{
l_mask.setBit(TT::DIMM_SIZE_START, TT::DIMM_SIZE_LEN);
l_mask.setBit<TT::DIMM_SIZE_START, TT::DIMM_SIZE_LEN>();
}

//DRAM_GEN wildcard
Expand All @@ -283,7 +283,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_GEN == l_uint8_buf)
{
l_mask.setBit(TT::DRAM_GEN_START, TT::DRAM_GEN_LEN);
l_mask.setBit<TT::DRAM_GEN_START, TT::DRAM_GEN_LEN>();
}

//DIMM_TYPE wildcard
Expand All @@ -294,7 +294,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_TYPE == l_uint8_buf)
{
l_mask.setBit(TT::DIMM_TYPE_START, TT::DIMM_TYPE_LEN);
l_mask.setBit<TT::DIMM_TYPE_START, TT::DIMM_TYPE_LEN>();
}

//DRAM_WIDTH wildcard
Expand All @@ -305,7 +305,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_WIDTH == l_uint8_buf)
{
l_mask.setBit(TT::DRAM_WIDTH_START, TT::DRAM_WIDTH_LEN);
l_mask.setBit<TT::DRAM_WIDTH_START, TT::DRAM_WIDTH_LEN>();
}

//DRAM_DENSITY wildcard
Expand All @@ -316,7 +316,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_DENSITY == l_uint8_buf)
{
l_mask.setBit(TT::DRAM_DENSITY_START, TT::DRAM_DENSITY_LEN);
l_mask.setBit<TT::DRAM_DENSITY_START, TT::DRAM_DENSITY_LEN>();
}

//DRAM_STACK_TYPE wildcard
Expand All @@ -327,7 +327,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_STACK_TYPE == l_uint8_buf)
{
l_mask.setBit(TT::DRAM_STACK_TYPE_START, TT::DRAM_STACK_TYPE_LEN);
l_mask.setBit<TT::DRAM_STACK_TYPE_START, TT::DRAM_STACK_TYPE_LEN>();
}

//DRAM_MFGID wildcard
Expand All @@ -338,7 +338,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_MFGID == l_uint16_buf)
{
l_mask.setBit(TT::DRAM_MFGID_START, TT::DRAM_MFGID_LEN);
l_mask.setBit<TT::DRAM_MFGID_START, TT::DRAM_MFGID_LEN>();
}


Expand All @@ -352,7 +352,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_PORT == l_uint8_buf)
{
l_mask.setBit(TT::DIMMS_PER_PORT_START, TT::DIMMS_PER_PORT_LEN);
l_mask.setBit<TT::DIMMS_PER_PORT_START, TT::DIMMS_PER_PORT_LEN>();
}
}

Expand All @@ -366,7 +366,7 @@ fapi2::ReturnCode generate_wildcard_mask(const uint32_t i_hash, uint32_t& o_mask

if(ANY_HEIGHT == l_uint8_buf)
{
l_mask.setBit(TT::DIMM_MODULE_HEIGHT_START, TT::DIMM_MODULE_HEIGHT_LEN);
l_mask.setBit<TT::DIMM_MODULE_HEIGHT_START, TT::DIMM_MODULE_HEIGHT_LEN>();
}
}

Expand Down
10 changes: 6 additions & 4 deletions src/import/generic/memory/lib/utils/power_thermal/gen_throttle.H
Expand Up @@ -41,6 +41,7 @@
#include <generic/memory/lib/utils/power_thermal/gen_throttle_traits.H>
#include <generic/memory/lib/utils/count_dimm.H>
#include <generic/memory/lib/mss_generic_system_attribute_getters.H>
#include <generic/memory/lib/mss_generic_system_attribute_setters.H>
#include <generic/memory/lib/mss_generic_attribute_setters.H>
#include <generic/memory/lib/utils/mss_math.H>
#include <generic/memory/lib/utils/pos.H>
Expand Down Expand Up @@ -1110,6 +1111,7 @@ fapi2::ReturnCode equalize_throttles (const std::vector< fapi2::Target<T> >& i_t

if (mss::count_dimm(l_port) == 0)
{
FAPI_INF("Seeing no DIMMs on %s -- skipping", mss::c_str(l_port));
continue;
}

Expand Down Expand Up @@ -1140,6 +1142,7 @@ fapi2::ReturnCode equalize_throttles (const std::vector< fapi2::Target<T> >& i_t

if (mss::count_dimm(l_port) == 0)
{
FAPI_INF("Seeing no DIMMs on %s -- skipping", mss::c_str(l_port));
continue;
}

Expand All @@ -1149,7 +1152,7 @@ fapi2::ReturnCode equalize_throttles (const std::vector< fapi2::Target<T> >& i_t
l_fin_slot = l_min_slot;
l_fin_port = l_min_port;

//Need to create throttle object for each mca in order to get dimm configuration and power curves
//Need to create throttle object for each port in order to get dimm configuration and power curves
//To calculate the slot/port utilization and total port power consumption
fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;

Expand Down Expand Up @@ -1179,10 +1182,9 @@ fapi2::ReturnCode equalize_throttles (const std::vector< fapi2::Target<T> >& i_t
{
//Need this because of pos traits and templating stuff
uint64_t l_fail = mss::fapi_pos(l_port);

//Set the failing port. OCC just needs one failing port, doesn't need all of them
FAPI_TRY( FAPI_ATTR_SET( fapi2::ATTR_MSS_MEM_PORT_POS_OF_FAIL_THROTTLE,
fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(),
l_fail) );
FAPI_TRY( attr::set_port_pos_of_fail_throttle(l_fail) );

FAPI_ASSERT_NOEXIT( false,
fapi2::MSS_CALC_PORT_POWER_EXCEEDS_MAX()
Expand Down
Expand Up @@ -737,4 +737,18 @@
<initToZero/>
<mssAccessorName>mrw_safemode_dram_databus_util</mssAccessorName>
</attribute>

<attribute>
<id>ATTR_MEM_PORT_POS_OF_FAIL_THROTTLE</id>
<targetType>TARGET_TYPE_SYSTEM</targetType>
<description>
This is the fapi position of the port that failed to calculate
memory throttles given the passed in watt target and or utilization
</description>
<initToZero></initToZero>
<valueType>uint64</valueType>
<mssAccessorName>port_pos_of_fail_throttle</mssAccessorName>
<writeable/>
</attribute>

</attributes>

0 comments on commit b403e67

Please sign in to comment.