From 13c42ee1d83917b13bb535eaf16e32d16105cfba Mon Sep 17 00:00:00 2001 From: Stephen Glancy Date: Wed, 25 Apr 2018 13:18:16 -0500 Subject: Adds MRW support for x4/x8 DIMM configurations Change-Id: Ifc5152564cddfcfda2f0ae9e709cad46b1d585b3 RTC:189937 CQ:SW426701 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57832 Tested-by: FSP CI Jenkins Reviewed-by: Louis Stermole Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: Hostboot CI Reviewed-by: ANDRE A. MARIN Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57842 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- .../hwp/memory/lib/eff_config/plug_rules.C | 74 ++++++++++++++++++++++ .../hwp/memory/lib/eff_config/plug_rules.H | 23 +++++++ .../hwp/memory/lib/mss_attribute_accessors.H | 23 +++++++ .../xml/attribute_info/memory_mrw_attributes.xml | 15 +++++ .../xml/error_info/p9_memory_mss_plug_rules.xml | 52 +++++++++++++++ 5 files changed, 187 insertions(+) (limited to 'src/import/chips') diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C index ce3cdbcfb..a5bc2d719 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.C @@ -131,6 +131,77 @@ fapi_try_exit: } // code +/// +/// @brief Enforce DRAM width system support checks +/// @param[in] i_target the port +/// @param[in] i_kind a DIMM kind +/// @param[in] i_mrw_supported_list the MRW bitmap's value +/// @return fapi2::FAPI2_RC_SUCCESS if okay +/// @note The DIMM kind should be a DIMM on the MCA +/// +fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target& i_target, + const dimm::kind& i_kind, + const fapi2::buffer& i_mrw_supported_list) +{ + // Contains a mapping of the DRAM width to the bitmap value to be checked for support + // If the DRAM's width is not found in this map, we'll error out with a special error + static const std::vector> DRAM_WIDTH_MAP = + { + {fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X4, fapi2::ENUM_ATTR_MSS_MRW_SUPPORTED_DRAM_WIDTH_X4}, + {fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8, fapi2::ENUM_ATTR_MSS_MRW_SUPPORTED_DRAM_WIDTH_X8}, + }; + // Gets the bitmap value for this DIMM's DRAM's width + uint8_t l_bitmap_value = 0; + const auto l_found = mss::find_value_from_key(DRAM_WIDTH_MAP, i_kind.iv_dram_width, l_bitmap_value); + + // We didn't find this DRAM width as supported in the above list + FAPI_ASSERT(l_found, + fapi2::MSS_PLUG_RULES_DRAM_WIDTH_NOT_SUPPORTED() + .set_DRAM_WIDTH(i_kind.iv_dram_width) + .set_MCA_TARGET(i_target), + "%s failed to find DRAM width of %u in the supported DRAM widths vector", + mss::c_str(i_kind.iv_target), i_kind.iv_dram_width); + + // We didn't find this DRAM width as supported in the MRW attribute + FAPI_ASSERT(i_mrw_supported_list.getBit(l_bitmap_value), + fapi2::MSS_PLUG_RULES_MRW_DRAM_WIDTH_NOT_SUPPORTED() + .set_DRAM_WIDTH(i_kind.iv_dram_width) + .set_MRW_SUPPORTED_LIST(i_mrw_supported_list) + .set_BITMAP_VALUE(l_bitmap_value) + .set_MCA_TARGET(i_target), + "%s failed! 0x%02x is not in MRW suppored value of 0x%02x for DRAM width of %u", + mss::c_str(i_kind.iv_target), l_bitmap_value, i_mrw_supported_list, i_kind.iv_dram_width); + +fapi_try_exit: + return fapi2::current_err; +} + +/// +/// @brief Enforce DRAM width system support checks +/// @param[in] i_target the port +/// @param[in] i_kinds a vector of DIMM (sorted while processing) +/// @return fapi2::FAPI2_RC_SUCCESS if okay +/// @note Expects the kind array to represent the DIMM on the port. +/// This function will commit error logs if a DIMM has an unsupported DRAM width +/// +fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target& i_target, + const std::vector& i_kinds) +{ + fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; + + uint8_t l_mrw_supported_list = 0; + FAPI_TRY(mss::mrw_supported_dram_width(l_mrw_supported_list)); + + // Loops through the DIMM and checks for unsupported DRAM widths + for(const auto& l_kind : i_kinds) + { + FAPI_TRY(check_system_supported_dram_width(i_target, l_kind, l_mrw_supported_list)); + } + +fapi_try_exit: + return fapi2::current_err; +} + /// /// @brief Enforce DRAM width checks /// @note DIMM0's width needs to equal DIMM1's width @@ -755,6 +826,9 @@ fapi2::ReturnCode plug_rule::enforce_plug_rules(const fapi2::Target& const std::vector& i_kinds, const uint64_t i_ranks_override); +/// +/// @brief Enforce DRAM width system support checks +/// @param[in] i_target the port +/// @param[in] i_kind a DIMM kind +/// @param[in] i_mrw_supported_list the MRW bitmap's value +/// @return fapi2::FAPI2_RC_SUCCESS if okay +/// @note The DIMM kind should be a DIMM on the MCA +/// +fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target& i_target, + const dimm::kind& i_kind, + const fapi2::buffer& i_mrw_supported_list); + +/// +/// @brief Enforce DRAM width system support checks +/// @param[in] i_target the port +/// @param[in] i_kinds a vector of DIMM (sorted while processing) +/// @return fapi2::FAPI2_RC_SUCCESS if okay +/// @note Expects the kind array to represent the DIMM on the port. +/// This function will commit error logs if a DIMM has an unsupported DRAM width +/// +fapi2::ReturnCode check_system_supported_dram_width(const fapi2::Target& i_target, + const std::vector& i_kinds); + /// /// @brief Enforce DRAM width checks /// @note DIMM0's width needs to equal DIMM1's width diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H index 1ee63867f..c2cc8ee8f 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H @@ -21557,6 +21557,29 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief ATTR_MSS_MRW_SUPPORTED_DRAM_WIDTH getter +/// @param[out] uint8_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 Bitmap of DRAM widths supported by a system. A 1 indicates that the system +/// supports a density. Enums below represent the the bit location in the attribute +/// for a given DRAM width. Default value is 0xC -> both x4/x8 +/// supported +/// +inline fapi2::ReturnCode mrw_supported_dram_width(uint8_t& o_value) +{ + + FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_SUPPORTED_DRAM_WIDTH, fapi2::Target(), + o_value) ); + return fapi2::current_err; + +fapi_try_exit: + FAPI_ERR("failed accessing ATTR_MSS_MRW_SUPPORTED_DRAM_WIDTH: 0x%lx (system target)", + uint64_t(fapi2::current_err)); + return fapi2::current_err; +} + /// /// @brief ATTR_MSS_VPD_MR_0_VERSION_LAYOUT getter diff --git a/src/import/chips/p9/procedures/xml/attribute_info/memory_mrw_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/memory_mrw_attributes.xml index 48ecc68d8..385a324ca 100755 --- a/src/import/chips/p9/procedures/xml/attribute_info/memory_mrw_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/memory_mrw_attributes.xml @@ -665,4 +665,19 @@ mrw_allow_unsupported_rcw + + ATTR_MSS_MRW_SUPPORTED_DRAM_WIDTH + TARGET_TYPE_SYSTEM + + Bitmap of DRAM widths supported by a system. A 1 indicates that the system supports a density. + Enums below represent the the bit location in the attribute for a given DRAM width. + Default value is 0xC -> both x4/x8 supported + + uint8 + + 0xc0 + X4 = 0, X8 = 1 + mrw_supported_dram_width + + diff --git a/src/import/chips/p9/procedures/xml/error_info/p9_memory_mss_plug_rules.xml b/src/import/chips/p9/procedures/xml/error_info/p9_memory_mss_plug_rules.xml index 7220ef48e..b290b48fc 100644 --- a/src/import/chips/p9/procedures/xml/error_info/p9_memory_mss_plug_rules.xml +++ b/src/import/chips/p9/procedures/xml/error_info/p9_memory_mss_plug_rules.xml @@ -58,6 +58,58 @@ + + RC_MSS_PLUG_RULES_DRAM_WIDTH_NOT_SUPPORTED + + DRAM width was not found to be supported by the code + + DRAM_WIDTH + + MEMORY_PLUGGING_ERROR + HIGH + + + + MCA_TARGET + TARGET_TYPE_DIMM + + MEDIUM + + + + MCA_TARGET + TARGET_TYPE_DIMM + + + + + + RC_MSS_PLUG_RULES_MRW_DRAM_WIDTH_NOT_SUPPORTED + + DRAM width was not found to be supported by the MRW attribute + + DRAM_WIDTH + MRW_SUPPORTED_LIST + BITMAP_VALUE + + MEMORY_PLUGGING_ERROR + HIGH + + + + MCA_TARGET + TARGET_TYPE_DIMM + + MEDIUM + + + + MCA_TARGET + TARGET_TYPE_DIMM + + + + RC_MSS_PLUG_RULES_INVALID_DRAM_WIDTH_MIX -- cgit v1.2.1