Skip to content

Commit

Permalink
Add attribute for SPD_REVISION (byte 1)
Browse files Browse the repository at this point in the history
Rename previous uses of Byte 192, the ddimm module spd section
to avoid ambiguity. Renamed from spd_revision --> ddimm_module_spd_revision

git-coreq:hostboot:I039173097619111ae5847660472e75ed9f2d5f1d
git-coreq:sbe:I039173097619111ae5847660472e75ed9f2d5f1d
git-coreq:hwsv:I039173097619111ae5847660472e75ed9f2d5f1d
Change-Id: I039173097619111ae5847660472e75ed9f2d5f1d
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90410
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: PPE CI <ppe-ci+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90508
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>
  • Loading branch information
markypizz authored and crgeddes committed Feb 12, 2020
1 parent 3dbe6a1 commit 798af67
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 27 deletions.
52 changes: 51 additions & 1 deletion src/import/generic/memory/lib/data_engine/attr_engine_traits.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019 */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -3466,6 +3466,56 @@ struct attrEngineTraits<P, attr_eff_engine_fields, attr_eff_engine_fields::DRAM_
}
};

///
/// @brief Traits for attr_engine
/// @class attrEngineTraits
/// @note attr_engine_derived_fields, SPD_REVISION specialization
///
template < proc_type P >
struct attrEngineTraits<P, attr_eff_engine_fields, attr_eff_engine_fields::SPD_REVISION>
{
using attr_type = fapi2::ATTR_MEM_EFF_SPD_REVISION_Type;
using attr_integral_type = std::remove_all_extents<attr_type>::type;
static constexpr fapi2::TargetType TARGET_TYPE = fapi2::ATTR_MEM_EFF_SPD_REVISION_TargetType;
static constexpr generic_ffdc_codes FFDC_CODE = SET_SPD_REVISION;

///
/// @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_spd_revision(i_target, o_setting);
}

///
/// @brief attribute setter
/// @param[in] i_target the attr 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_spd_revision(i_target, i_setting);
}

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

}//mss

#endif
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -118,9 +118,10 @@ enum class attr_eff_engine_fields
DRAM_MFG_ID = 23,
RCD_MFG_ID = 24,
DRAM_MODULE_HEIGHT = 25,
SPD_REVISION = 26,

// Dispatcher set to last enum value
DISPATCHER = DRAM_MODULE_HEIGHT,
DISPATCHER = SPD_REVISION,
};

///
Expand Down
22 changes: 21 additions & 1 deletion src/import/generic/memory/lib/mss_generic_attribute_getters.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -2854,6 +2854,26 @@ fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief ATTR_MEM_EFF_SPD_REVISION getter
/// @param[in] const ref to the TARGET_TYPE_MEM_PORT
/// @param[out] uint8_t& reference to store the value
/// @note Generated by gen_accessors.pl generate_mc_port_params
/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
/// @note SPD Revision (SPD Byte 1)
///
inline fapi2::ReturnCode get_spd_revision(const fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT>& i_target, uint8_t& o_value)
{

FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MEM_EFF_SPD_REVISION, i_target, o_value) );
return fapi2::current_err;

fapi_try_exit:
FAPI_ERR("failed getting ATTR_MEM_EFF_SPD_REVISION: 0x%lx (target: %s)",
uint64_t(fapi2::current_err), mss::c_str(i_target));
return fapi2::current_err;
}


///
/// @brief ATTR_MEM_EFF_VOLT_VDDR getter
Expand Down
17 changes: 14 additions & 3 deletions src/import/generic/memory/lib/spd/common/dimm_module_decoder.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* Contributors Listed Below - COPYRIGHT 2016,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -106,6 +106,17 @@ class dimm_module_decoder
iv_data = i_spd_data;
}

///
/// @brief Decodes SPD Revision -> SPD_REVISION
/// @param[out] o_output encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
///
virtual fapi2::ReturnCode revision(uint8_t& o_output) const
{
o_output = 0;
return fapi2::FAPI2_RC_SUCCESS;
}

///
/// @brief Decodes module nominal height max
/// @param[out] o_output height range encoding from SPD
Expand Down Expand Up @@ -559,11 +570,11 @@ class dimm_module_decoder
// DDIMM information from here on out
//////////////////////////////////////////
///
/// @brief Decodes SPD Revision for bytes 192->447 -> SPD_REVISION
/// @brief Decodes SPD Revision for bytes 192->447 -> SPD_REV_DDIMM_MODULE
/// @param[out] o_output encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
///
virtual fapi2::ReturnCode ddimm_spd_revision(uint8_t& o_output) const
virtual fapi2::ReturnCode ddimm_module_spd_revision(uint8_t& o_output) const
{
o_output = 0;
return fapi2::FAPI2_RC_SUCCESS;
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -114,13 +114,13 @@ class decoder< DDR4, DDIMM_MODULE, R > : public dimm_module_decoder
}

///
/// @brief Decodes SPD Revision for bytes 192->447 -> SPD_REVISION
/// @brief Decodes SPD Revision for bytes 192->447 -> SPD_REV_DDIMM_MODULE
/// @param[out] o_output encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
///
virtual fapi2::ReturnCode ddimm_spd_revision(uint8_t& o_output) const override
virtual fapi2::ReturnCode ddimm_module_spd_revision(uint8_t& o_output) const override
{
FAPI_TRY( (mss::spd::reader<fields_t::SPD_REVISION, R>(iv_target, iv_data, o_output)) );
FAPI_TRY( (mss::spd::reader<fields_t::SPD_REV_DDIMM_MODULE, R>(iv_target, iv_data, o_output)) );

fapi_try_exit:
return fapi2::current_err;
Expand Down
8 changes: 4 additions & 4 deletions src/import/generic/memory/lib/spd/spd_facade.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -1682,13 +1682,13 @@ class facade final
}

///
/// @brief Decodes SPD Revision for bytes 192->447 -> SPD_REVISION
/// @brief Decodes SPD Revision for bytes 192->447 -> SPD_REV_DDIMM_MODULE
/// @param[out] o_output encoding from SPD
/// @return FAPI2_RC_SUCCESS if okay
///
fapi2::ReturnCode ddimm_spd_revision(uint8_t& o_output) const
fapi2::ReturnCode ddimm_module_spd_revision(uint8_t& o_output) const
{
FAPI_TRY( iv_dimm_module_decoder->ddimm_spd_revision(o_output) );
FAPI_TRY( iv_dimm_module_decoder->ddimm_module_spd_revision(o_output) );

fapi_try_exit:
return fapi2::current_err;
Expand Down
14 changes: 7 additions & 7 deletions src/import/generic/memory/lib/spd/spd_fields_ddr4.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -795,10 +795,10 @@ class fields<DDR4, DDIMM_MODULE>
enum
{

// Byte 192: SPD Revision for bytes 192->447
SPD_REV_BYTE = 192,
SPD_REVISION_START = 0,
SPD_REVISION_LEN = 8,
// Byte 192: SPD Revision DDIMM Module Type (bytes 192->447)
SPD_REV_DDIMM_MODULE_BYTE = 192,
SPD_REV_DDIMM_MODULE_START = 0,
SPD_REV_DDIMM_MODULE_LEN = 8,

// Byte 193: Module Height
MODULE_HEIGHT_BYTE = 193,
Expand Down Expand Up @@ -1192,8 +1192,8 @@ class fields<DDR4, DDIMM_MODULE>
// Second field - start bit
// Third field - bit length

// Byte 192: SPD Revision for bytes 192->447
static constexpr field_t SPD_REVISION{SPD_REV_BYTE, SPD_REVISION_START, SPD_REVISION_LEN};
// Byte 192: SPD Revision DDIMM Module Bytes (192->447)
static constexpr field_t SPD_REV_DDIMM_MODULE{SPD_REV_DDIMM_MODULE_BYTE, SPD_REV_DDIMM_MODULE_START, SPD_REV_DDIMM_MODULE_LEN};

// Byte 193: Module Height
static constexpr field_t MODULE_BASE_HEIGHT{MODULE_HEIGHT_BYTE, MODULE_BASE_HEIGHT_START, MODULE_BASE_HEIGHT_LEN};
Expand Down
6 changes: 3 additions & 3 deletions src/import/generic/memory/lib/spd/spd_traits_ddr4.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -3690,11 +3690,11 @@ class readerTraits< fields<DDR4, LRDIMM_MODULE>::DATA_BUFFER_GAIN_ADJUST, R >
/// @class readerTraits
/// @brief trait structure to hold static SPD information
/// @tparam R the revision of the SPD field
/// @note SPD_REVISION field specialization
/// @note SPD_REV_DDIMM_MODULE field specialization
/// @note valid for all revs
///
template< rev R >
class readerTraits < fields< DDR4, DDIMM_MODULE>::SPD_REVISION, R >
class readerTraits < fields< DDR4, DDIMM_MODULE>::SPD_REV_DDIMM_MODULE, R >
{
public:

Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] Evan Lojewski */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -271,6 +271,7 @@ enum generic_ffdc_codes

SET_RCD_MFG_ID = 0x109B,
SET_DRAM_MODULE_HEIGHT = 0x109C,
SET_SPD_REVISION = 0x109D,
};

///
Expand Down
Expand Up @@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2018,2019 -->
<!-- Contributors Listed Below - COPYRIGHT 2018,2020 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
Expand Down Expand Up @@ -905,4 +905,16 @@
<mssAccessorName>volt_vpp</mssAccessorName>
</attribute>

<attribute>
<id>ATTR_MEM_EFF_SPD_REVISION</id>
<targetType>TARGET_TYPE_MEM_PORT</targetType>
<description>
SPD Revision (SPD Byte 1)
</description>
<initToZero></initToZero>
<valueType>uint8</valueType>
<writeable/>
<mssAccessorName>spd_revision</mssAccessorName>
</attribute>

</attributes>

0 comments on commit 798af67

Please sign in to comment.