Skip to content

Commit

Permalink
Add supported_rcd attribute from SPD + tests
Browse files Browse the repository at this point in the history
Change-Id: I55ac87e453ebb3a6f458d93b9ae505e6775f68cf
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/91836
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@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: MATTHEW I HICKMAN <matthew.hickman@ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/93102
Reviewed-by: Christian R Geddes <crgeddes@us.ibm.com>
Tested-by: Christian R Geddes <crgeddes@us.ibm.com>
  • Loading branch information
aamarin authored and crgeddes committed Mar 25, 2020
1 parent 80ecda0 commit 3b661be
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,58 @@ struct attrEngineTraits<P, exp::attr_eff_engine_fields, exp::attr_eff_engine_fie
}
};

///
/// @brief Traits for attr_engine
/// @class attrEngineTraits
/// @tparam P processor type
/// @note attr_eff_engine_fields, SUPPORTED_RCD specialization
///
template< proc_type P >
struct attrEngineTraits<P, exp::attr_eff_engine_fields, exp::attr_eff_engine_fields::SUPPORTED_RCD>
{
using attr_type = fapi2::ATTR_MEM_EFF_SUPPORTED_RCD_Type;
using attr_integral_type = std::remove_all_extents<attr_type>::type;
using attr_type_to_set = attr_integral_type;
static constexpr fapi2::TargetType TARGET_TYPE = fapi2::ATTR_MEM_EFF_SUPPORTED_RCD_TargetType;
static constexpr exp::ffdc_codes FFDC_CODE = exp::SET_SUPPORTED_RCD;

///
/// @brief attribute getter
/// @param[in] i_target the fapi2 target
/// @param[out] o_setting array to populate
/// @return FAPI2_RC_SUCCESS iff okay
///
static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target,
attr_type& o_setting)
{
return mss::attr::get_supported_rcd(i_target, o_setting);
}

///
/// @brief attribute setter
/// @param[in] i_target the fapi2 target
/// @param[in] i_setting array to set
/// @return FAPI2_RC_SUCCESS iff okay
///
static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target,
attr_type& i_setting)
{
return mss::attr::set_supported_rcd(i_target, i_setting);
}

///
/// @brief Computes setting for attribute
/// @param[in] i_spd_data EFD data
/// @param[out] o_setting value we want to set attr with
/// @return FAPI2_RC_SUCCESS iff okay
///
static fapi2::ReturnCode get_value_to_set(const spd::facade& i_spd_data,
attr_integral_type& o_setting)
{
return i_spd_data.module_rcd(o_setting);
}
};

///
/// @brief Traits for attr_engine
/// @class attrEngineTraits
Expand Down Expand Up @@ -1287,6 +1339,10 @@ struct attrEngineTraits<P, exp::attr_eff_engine_fields, exp::attr_eff_engine_fie
}
};

////////////////////////////////////////////////////////
// Traits for explorer specific generic_metadata_fields
////////////////////////////////////////////////////////

///
/// @brief Traits for pre_data_engine
/// @class attrEngineTraits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ enum class attr_eff_engine_fields
THERM_SENSOR_DIFF_USAGE = 22,
THERM_SENSOR_DIFF_I2C_ADDR = 23,

SUPPORTED_RCD = 24,

// Dispatcher set to last enum value
DISPATCHER = THERM_SENSOR_DIFF_I2C_ADDR,
DISPATCHER = SUPPORTED_RCD,
};

///
Expand Down Expand Up @@ -190,6 +192,7 @@ enum ffdc_codes
SET_THERM_SENSOR_DIFF_TYPE = 0x105C,
SET_THERM_SENSOR_DIFF_USAGE = 0x105D,
SET_THERM_SENSOR_DIFF_I2C_ADDR = 0x105E,
SET_SUPPORTED_RCD = 0x105F,
};

///
Expand Down
12 changes: 12 additions & 0 deletions src/import/generic/memory/lib/spd/common/dimm_module_decoder.H
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,18 @@ class dimm_module_decoder
o_value = 0;
return fapi2::FAPI2_RC_SUCCESS;
}


///
/// @brief Decodes Registered Clock Drivers (RCD)
/// @param[out] o_output encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
///
virtual fapi2::ReturnCode module_rcd(uint8_t& o_output) const
{
o_output = 0;
return fapi2::FAPI2_RC_SUCCESS;
}
};

}// spd
Expand Down
14 changes: 14 additions & 0 deletions src/import/generic/memory/lib/spd/ddimm/ddr4/ddimm_decoder_ddr4.H
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,20 @@ class decoder< DDR4, DDIMM_MODULE, R > : public dimm_module_decoder
return fapi2::current_err;
}

///
/// @brief Decodes Registered Clock Drivers (RCD)
/// @param[out] o_output encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
/// @note Byte 264 DDIMM SPD
///
virtual fapi2::ReturnCode module_rcd(uint8_t& o_output) const override
{
FAPI_TRY((mss::spd::reader<fields_t::MODULE_RCD, R>(iv_target, iv_data, o_output)));

fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Decodes Thermal Sensor 0 Availability -> THERM_SENSOR_0_AVAIL
/// @param[out] o_output encoding from SPD
Expand Down
13 changes: 13 additions & 0 deletions src/import/generic/memory/lib/spd/spd_facade.H
Original file line number Diff line number Diff line change
Expand Up @@ -2794,6 +2794,19 @@ class facade final
return fapi2::current_err;
}

///
/// @brief Decodes Module RCD
/// @param[out] o_output encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
///
fapi2::ReturnCode module_rcd(uint8_t& o_output) const
{
FAPI_TRY( iv_dimm_module_decoder->module_rcd(o_output) );

fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Decodes Thermal Sensor 0 Availability -> THERM_SENSOR_0_AVAIL
/// @param[out] o_output encoding from SPD
Expand Down
8 changes: 8 additions & 0 deletions src/import/generic/memory/lib/spd/spd_fields_ddr4.H
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,11 @@ class fields<DDR4, DDIMM_MODULE>
PMIC1_PHASE_COMBIN_START = 4,
PMIC1_PHASE_COMBIN_LEN = 4,

// Byte 264
MODULE_RCD_BYTE = 264,
MODULE_RCD_START = 6,
MODULE_RCD_LEN = 2,

// Byte 268: Thermal Sensor 0 Profile
THERM_SENSOR_0_PROFILE_BYTE = 268,
THERM_SENSOR_0_AVAIL_START = 0,
Expand Down Expand Up @@ -1462,6 +1467,9 @@ class fields<DDR4, DDIMM_MODULE>
static constexpr field_t PMIC1_PHASE_COMBIN{PMIC1_PHASE_COMBIN_BYTE, PMIC1_PHASE_COMBIN_START, PMIC1_PHASE_COMBIN_LEN};
static constexpr field_t PMIC1_REDUNDANCY{PMIC1_PHASE_COMBIN_BYTE, PMIC1_REDUNDANCY_START, PMIC1_REDUNDANCY_LEN};

// Byte 264: Registered Clock Drivers (RCD)
static constexpr field_t MODULE_RCD{MODULE_RCD_BYTE, MODULE_RCD_START, MODULE_RCD_LEN};

// Byte 268: Thermal Sensor 0 Profile
static constexpr field_t THERM_SENSOR_0_AVAIL{THERM_SENSOR_0_PROFILE_BYTE, THERM_SENSOR_0_AVAIL_START, THERM_SENSOR_0_AVAIL_LEN};
static constexpr field_t THERM_SENSOR_0_USAGE{THERM_SENSOR_0_PROFILE_BYTE, THERM_SENSOR_0_USAGE_START, THERM_SENSOR_0_USAGE_LEN};
Expand Down
19 changes: 19 additions & 0 deletions src/import/generic/memory/lib/spd/spd_traits_ddr4.H
Original file line number Diff line number Diff line change
Expand Up @@ -5855,6 +5855,25 @@ class readerTraits < fields<DDR4, DDIMM_MODULE>::DRAM_MFR_ID_CODE_MSB, R >
using COMPARISON_OP = std::greater_equal<T>;
};

///
/// @class readerTraits
/// @brief trait structure to hold static SPD information
/// @tparam R the revision of the SPD field
/// @note MODULE_RCD field specialization
/// @note valid for all revisions
///
template< rev R >
class readerTraits < fields<DDR4, DDIMM_MODULE>::MODULE_RCD, R >
{
public:

static constexpr size_t COMPARISON_VAL = 0x01;
static constexpr const char* FIELD_STR = "Registered Clock Drivers (RCD)";

template <typename T>
using COMPARISON_OP = std::less_equal<T>;
};

}// spd
}// mss

Expand Down

0 comments on commit 3b661be

Please sign in to comment.