diff options
author | Tsung Yeung <tyeung@us.ibm.com> | 2019-02-18 08:48:25 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2019-03-01 10:17:07 -0600 |
commit | 8eb0494af6a14c4caac58c045d293cb65f62f977 (patch) | |
tree | 2887871f697d18bb9a40dc41149f462204249df8 /src/import/chips/p9 | |
parent | e45d35734d18dece68b1c065666ee013f7d19209 (diff) | |
download | talos-hostboot-8eb0494af6a14c4caac58c045d293cb65f62f977.tar.gz talos-hostboot-8eb0494af6a14c4caac58c045d293cb65f62f977.zip |
Enforces NVDIMM Pairing
Change-Id: I0ba48a0eef571405bf4233a50d9ffd6a708e8c11
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72050
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.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/72053
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>
Diffstat (limited to 'src/import/chips/p9')
3 files changed, 134 insertions, 3 deletions
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 4ad111a87..20231cfcd 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 @@ -36,6 +36,7 @@ #include <fapi2.H> #include <vpd_access.H> #include <mss.H> +#include <algorithm> #include <lib/mss_vpd_decoder.H> #include <lib/dimm/rank.H> @@ -758,6 +759,71 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief Enforce the NVDIMM pairing per MCS for performance +/// @param[in] i_target FAPI2 target (MCS) +/// @param[in] i_kinds a vector of DIMM +/// @return fapi2::FAPI2_RC_SUCCESS if okay, otherwise a MSS_PLUG_RULE error code +/// +fapi2::ReturnCode check_nvdimm_pairing(const fapi2::Target<fapi2::TARGET_TYPE_MCS> i_target, + const std::vector<dimm::kind>& l_kinds) +{ + // 3 scenarios where the pairing rule would fail: + // (1). Odd number of NVDIMMs installed + // (2). Even number NVDIMMs are plugged but 1 deconfigured + // (3). 1 NVDIMM and 1 RDIMM mixed in the same MCS + + bool l_has_nvdimm = false; + fapi2::current_err = fapi2::FAPI2_RC_SUCCESS; + + for (uint8_t idx = 0; idx < l_kinds.size(); idx++) + { + l_has_nvdimm |= (l_kinds[idx].iv_hybrid_memory_type == fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NVDIMM); + + if (l_has_nvdimm) + { + break; + } + } + + FAPI_DBG("l_has_nvdimm %d", l_has_nvdimm); + + // No reason to continue if there is no nvdimm installed + if (l_has_nvdimm) + { + // Odd number of functional NVDIMMs installed. Covers (1) & (2) + // We can safely assume that all the other NVDIMM-related plug rules are satisfied + // as this subroutine is called after all the other plug rule checks + FAPI_ASSERT( (l_kinds.size() % 2) == 0, + fapi2::MSS_PLUG_RULES_ODD_NVDIMM_INSTALLED() + .set_NUM_NVDIMMS_IN_MCS(l_kinds.size()) + .set_MCS_TARGET(i_target), + "Odd number of NVDIMMs detected to be functional" ); + + // Make sure no mixing dimm type + bool l_condition = false; + + for (uint8_t idx = 0; idx < l_kinds.size(); idx++) + { + l_condition = l_kinds[idx].iv_hybrid == fapi2::ENUM_ATTR_EFF_HYBRID_IS_HYBRID && + l_kinds[idx].iv_hybrid_memory_type == fapi2::ENUM_ATTR_EFF_HYBRID_MEMORY_TYPE_NVDIMM; + + if (!l_condition) + { + break; + } + } + + FAPI_ASSERT( l_condition, + fapi2::MSS_PLUG_RULES_NVDIMM_RDIMM_MIXED() + .set_MCS_TARGET(i_target), + "No mixing of RDIMM and NVDIMM in the same MCS" ); + } + +fapi_try_exit: + return fapi2::current_err; +} + } // close namespace plug_rule /// @@ -798,6 +864,12 @@ fapi2::ReturnCode plug_rule::enforce_plug_rules(const fapi2::Target<fapi2::TARGE FAPI_TRY( enforce_plug_rules(p) ); } + // Enforce the NVDIMM pairing rule + { + const auto l_dimm_kinds = mss::dimm::kind::vector(l_dimms); + FAPI_TRY( plug_rule::check_nvdimm_pairing(i_target, l_dimm_kinds) ); + } + fapi_try_exit: return fapi2::current_err; } diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H index b83b39e98..a730fa9a4 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/eff_config/plug_rules.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -225,6 +225,15 @@ fapi2::ReturnCode check_hybrid(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_ta fapi2::ReturnCode check_nvdimm(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target, const std::vector<dimm::kind>& i_kinds); +/// +/// @brief Enforce the NVDIMM pairing per MCS +/// @param[in] i_target FAPI2 target (MCS) +/// @param[in] i_kinds a vector of DIMM +/// @return fapi2::FAPI2_RC_SUCCESS if okay, otherwise a MSS_PLUG_RULE error code +/// +fapi2::ReturnCode check_nvdimm_pairing(const fapi2::Target<fapi2::TARGET_TYPE_MCS> i_target, + const std::vector<dimm::kind>& l_kinds); + // Adding in code based plug rules - as supporting code gets added, the following checks can be deleted namespace code { 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 657c61e0c..b1a686031 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 @@ -5,7 +5,7 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- Contributors Listed Below - COPYRIGHT 2016,2018 --> +<!-- Contributors Listed Below - COPYRIGHT 2016,2019 --> <!-- [+] International Business Machines Corp. --> <!-- --> <!-- --> @@ -485,6 +485,56 @@ <childType>TARGET_TYPE_DIMM</childType> </childTargets> </deconfigure> -</hwpError> + </hwpError> + + <hwpError> + <rc>RC_MSS_PLUG_RULES_ODD_NVDIMM_INSTALLED</rc> + <description> + The MCS called out has odd number of NVDIMMs installed or has two/four NVDIMMs + but the one is deconfigured. + </description> + <ffdc>NUM_NVDIMMS_IN_MCS</ffdc> + <callout> + <procedure>MEMORY_PLUGGING_ERROR</procedure> + <priority>HIGH</priority> + </callout> + <callout> + <childTargets> + <parent>MCS_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + </childTargets> + <priority>MEDIUM</priority> + </callout> + <deconfigure> + <childTargets> + <parent>MCS_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + </childTargets> + </deconfigure> + </hwpError> + + <hwpError> + <rc>RC_MSS_PLUG_RULES_NVDIMM_RDIMM_MIXED</rc> + <description> + The MCS called out has NVDIMM and RDIMM mixed + </description> + <callout> + <procedure>MEMORY_PLUGGING_ERROR</procedure> + <priority>HIGH</priority> + </callout> + <callout> + <childTargets> + <parent>MCS_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + </childTargets> + <priority>MEDIUM</priority> + </callout> + <deconfigure> + <childTargets> + <parent>MCS_TARGET</parent> + <childType>TARGET_TYPE_DIMM</childType> + </childTargets> + </deconfigure> + </hwpError> </hwpErrors> |