summaryrefslogtreecommitdiffstats
path: root/src/import/generic/memory/lib/mss_generic_attribute_getters.H
diff options
context:
space:
mode:
authorAndre A. Marin <aamarin@us.ibm.com>2019-03-20 09:01:13 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2019-04-02 13:20:03 -0500
commitee76c2ca5927122cc9bfc792de240f20b87abe82 (patch)
tree5a2a256cc16f3b45ba1d3bf166b41b17692ab490 /src/import/generic/memory/lib/mss_generic_attribute_getters.H
parent8daf280f7d24a3f5b2c553bb39ceda4d0fd32736 (diff)
downloadtalos-hostboot-ee76c2ca5927122cc9bfc792de240f20b87abe82.tar.gz
talos-hostboot-ee76c2ca5927122cc9bfc792de240f20b87abe82.zip
Fix c_str and pos DIMM specialization
Change-Id: Id234f7f14bc4dd90de1f8ea70a4617c513ca1ffa Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/74846 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@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: Mark Pizzutillo <mark.pizzutillo@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/74877 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/generic/memory/lib/mss_generic_attribute_getters.H')
-rw-r--r--src/import/generic/memory/lib/mss_generic_attribute_getters.H71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/import/generic/memory/lib/mss_generic_attribute_getters.H b/src/import/generic/memory/lib/mss_generic_attribute_getters.H
index 3b01d0c4a..613ddad0a 100644
--- a/src/import/generic/memory/lib/mss_generic_attribute_getters.H
+++ b/src/import/generic/memory/lib/mss_generic_attribute_getters.H
@@ -37,6 +37,77 @@ namespace mss
namespace attr
{
///
+/// @brief ATTR_MEM_DIMM_POS_METADATA getter
+/// @param[in] const ref to the TARGET_TYPE_DIMM
+/// @param[out] uint32_t& reference to store the value
+/// @note Generated by gen_accessors.pl generate_other_attr_params
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note To get the FAPI_POS to the equivilent of ATTR_POS, we need to normalize the fapi_pos
+/// value to the processor (stride across which ever processor we're on) and then add
+/// in the delta per processor as ATTR_POS isn't processor relative (delta is the total
+/// dimm on a processor)
+///
+inline fapi2::ReturnCode get_dimm_pos_metadata(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint32_t& o_value)
+{
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MEM_DIMM_POS_METADATA, i_target, o_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed getting ATTR_MEM_DIMM_POS_METADATA: 0x%lx",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MEM_DRAM_GEN_METADATA getter
+/// @param[in] const ref to the TARGET_TYPE_DIMM
+/// @param[out] uint8_t& reference to store the value
+/// @note Generated by gen_accessors.pl generate_other_attr_params
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note DRAM Device Type. Decodes SPD byte 2. Created for use by attributes that need this
+/// data earlier than eff_config, such as c_str and the hypervisor. Not meant for direct
+/// HWP use. This is just an abstraction of any chip specific EFF_DRAM_GEN attribute.
+///
+inline fapi2::ReturnCode get_dram_gen_metadata(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint8_t& o_value)
+{
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MEM_DRAM_GEN_METADATA, i_target, o_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed getting ATTR_MEM_DRAM_GEN_METADATA: 0x%lx",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MEM_DIMM_TYPE_METADATA getter
+/// @param[in] const ref to the TARGET_TYPE_DIMM
+/// @param[out] uint8_t& reference to store the value
+/// @note Generated by gen_accessors.pl generate_other_attr_params
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK
+/// @note Base Module Type. Decodes SPD Byte 3 (bits 3~0). Created for use by attributes that
+/// need this data earlier than eff_config, such as c_str and the hypervisor. Not meant
+/// for direct HWP use. This is just an abstraction of any chip specific EFF_DIMM_TYPE
+/// attribute.
+///
+inline fapi2::ReturnCode get_dimm_type_metadata(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+ uint8_t& o_value)
+{
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MEM_DIMM_TYPE_METADATA, i_target, o_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed getting ATTR_MEM_DIMM_TYPE_METADATA: 0x%lx",
+ uint64_t(fapi2::current_err));
+ return fapi2::current_err;
+}
+
+
+///
/// @brief ATTR_MEM_DRAM_CWL getter
/// @param[in] const ref to the TARGET_TYPE_MEM_PORT
/// @param[out] uint8_t& reference to store the value
OpenPOWER on IntegriCloud