From e0cdfdda35d69af5cab08d081a6d8be108584109 Mon Sep 17 00:00:00 2001 From: Jacob Harvey Date: Wed, 4 Oct 2017 14:20:07 -0500 Subject: Create xlate equality function for dimm kind Change-Id: Ia2c85d7afa9872a49dd470ec5061b2f99f992db9 CQ: SW404201 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47169 Dev-Ready: JACOB L. HARVEY Reviewed-by: STEPHEN GLANCY Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: Hostboot CI Reviewed-by: ANDRE A. MARIN Reviewed-by: Louis Stermole Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47173 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: William G. Hoffa --- .../chips/p9/procedures/hwp/memory/lib/dimm/kind.H | 18 ++++++++++++++++++ .../chips/p9/procedures/hwp/memory/lib/mc/xlate.C | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H index 048ec591d..fd2604061 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/kind.H @@ -228,6 +228,24 @@ class kind uint8_t iv_stack_type; uint8_t iv_hybrid; uint8_t iv_hybrid_memory_type; + + /// + /// @brief equal_config + /// @param[in] i_input_compare the i_kind to compare against + /// @return bool true iff the two kind are of the same kind for xlate purposes + /// @warning this does not compare the targets (iv_target,), mfgid, prim_stack_type nor hybrid type + /// + inline bool equal_config(const kind& i_input_compare) const + { + return ((iv_master_ranks == i_input_compare.iv_master_ranks) && + (iv_total_ranks == i_input_compare.iv_total_ranks) && + (iv_dram_density == i_input_compare.iv_dram_density) && + (iv_dram_width == i_input_compare.iv_dram_width) && + (iv_dram_generation == i_input_compare.iv_dram_generation) && + (iv_dimm_type == i_input_compare.iv_dimm_type) && + (iv_rows == i_input_compare.iv_rows) && + (iv_size == i_input_compare.iv_size)); + } }; } diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C index 5d8486f3d..ed291f248 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/xlate.C @@ -1926,7 +1926,7 @@ fapi2::ReturnCode setup_xlate_map_helper( std::vector& io_dimm_kinds // Find the proper set function based on this DIMM kind. const auto l_setup = std::find_if( xlate_map.begin(), xlate_map.end(), [k](const xlate_setup & x) -> bool { - return x.iv_kind == k; + return x.iv_kind.equal_config(k); } ); // If we didn't find it, raise a stink. -- cgit v1.2.1