diff options
author | Andre Marin <aamarin@us.ibm.com> | 2017-02-21 00:43:35 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-03-01 09:12:37 -0500 |
commit | 77b203d67647636e2f67135d84db184432eedf7e (patch) | |
tree | 93ec48198d0deecf91dd2629c65e69f0ab33b264 /src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C | |
parent | 7c5519c9412ffff7178f9ac0b93dd215a6c6b839 (diff) | |
download | talos-hostboot-77b203d67647636e2f67135d84db184432eedf7e.tar.gz talos-hostboot-77b203d67647636e2f67135d84db184432eedf7e.zip |
Simplify spd factory mapping to share among controllers
Also happened to address RTC 163150 and RTC:152390
with this refactoring.
Change-Id: Iaba29d96f577c74bda7c3b147c16749eb1d861e5
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36766
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: Brian R. Silver <bsilver@us.ibm.com>
Reviewed-by: JACOB L. HARVEY <jlharvey@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: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36769
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C index 0dfdb6e26..10440a804 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config.C @@ -36,7 +36,7 @@ #include <p9_mss_eff_config.H> // std -#include <map> +#include <vector> // fapi2 #include <fapi2.H> @@ -51,6 +51,7 @@ #include <lib/utils/find.H> #include <lib/dimm/eff_dimm.H> #include <lib/eff_config/plug_rules.H> + /// /// @brief Configure the attributes for each controller /// @param[in] i_target the controller (e.g., MCS) @@ -61,7 +62,7 @@ fapi2::ReturnCode p9_mss_eff_config( const fapi2::Target<fapi2::TARGET_TYPE_MCS> const bool i_decode_spd_only ) { fapi2::ReturnCode l_rc; - std::map<uint32_t, std::shared_ptr<mss::spd::decoder> > l_factory_caches; + std::vector< std::shared_ptr<mss::spd::decoder> > l_factory_caches; // Caches FAPI_TRY( mss::spd::populate_decoder_caches(i_target, l_factory_caches) ); @@ -77,22 +78,11 @@ fapi2::ReturnCode p9_mss_eff_config( const fapi2::Target<fapi2::TARGET_TYPE_MCS> "Unable to decode VPD for %s", mss::c_str(i_target) ); } - for( const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target) ) + for( const auto& l_cache : l_factory_caches ) { std::shared_ptr<mss::eff_dimm> l_eff_dimm; - const auto l_dimm_pos = mss::pos(l_dimm); - - // TODO RTC:152390 Create function to do map checking on cached values - // Find decoder factory for this dimm position - auto l_it = l_factory_caches.find(l_dimm_pos); - - FAPI_TRY( mss::check::spd::invalid_cache(l_dimm, - l_it != l_factory_caches.end(), - l_dimm_pos), - "Failed to get valid cache (main decoder)"); - - FAPI_TRY( mss::eff_dimm::eff_dimm_factory( l_dimm, l_it->second, l_eff_dimm)); + FAPI_TRY( mss::eff_dimm::eff_dimm_factory( l_cache, l_eff_dimm)); FAPI_TRY( l_eff_dimm->dram_mfg_id() ); FAPI_TRY( l_eff_dimm->dram_width() ); |