diff options
author | Andre A. Marin <aamarin@us.ibm.com> | 2019-03-20 09:01:13 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2019-04-02 13:20:03 -0500 |
commit | ee76c2ca5927122cc9bfc792de240f20b87abe82 (patch) | |
tree | 5a2a256cc16f3b45ba1d3bf166b41b17692ab490 /src/import/chips | |
parent | 8daf280f7d24a3f5b2c553bb39ceda4d0fd32736 (diff) | |
download | talos-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/chips')
24 files changed, 401 insertions, 26 deletions
diff --git a/src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C b/src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C index 0a804bdf0..465e31779 100644 --- a/src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C +++ b/src/import/chips/centaur/procedures/hwp/memory/lib/utils/mem_size.C @@ -26,11 +26,10 @@ #include <fapi2.H> #include <lib/shared/dimmConsts.H> +#include <p9c_mss_funcs.H> #include <generic/memory/lib/utils/memory_size.H> #include <generic/memory/lib/utils/find.H> - -namespace mss -{ +#include <generic/memory/lib/utils/c_str.H> /// /// @brief Check if a given DIMM is functional @@ -74,6 +73,8 @@ bool is_dimm_functional(const uint8_t i_valid_dimm_bitmap, return fapi2::buffer<uint8_t>(i_valid_dimm_bitmap).getBit(VALID_DIMM_POS[i_port][i_dimm]); } +namespace mss +{ /// /// @brief Return the total memory size behind an MBA diff --git a/src/import/chips/centaur/procedures/hwp/memory/mss_dynamic_vid_utils.C b/src/import/chips/centaur/procedures/hwp/memory/mss_dynamic_vid_utils.C index 38aed25e9..f8324bb84 100644 --- a/src/import/chips/centaur/procedures/hwp/memory/mss_dynamic_vid_utils.C +++ b/src/import/chips/centaur/procedures/hwp/memory/mss_dynamic_vid_utils.C @@ -33,8 +33,7 @@ #include <mss_dynamic_vid_utils.H> #include <generic/memory/lib/utils/find.H> - - +#include <generic/memory/lib/utils/c_str.H> /// /// @brief Checks centaur configurations and outputs DRAM device type diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_funcs.H b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_funcs.H index d53e72730..3472a6547 100755 --- a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_funcs.H +++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_funcs.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -447,5 +447,16 @@ fapi2::ReturnCode cs_decode(const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_targe const uint8_t i_stack_type, fapi2::variable_buffer& o_csn_8); +/// +/// @brief Check if a given DIMM is functional +/// @param[in] i_valid_dimm_bitmap from ATTR_CEN_MSS_EFF_DIMM_FUNCTIONAL_VECTOR +/// @param[in] i_port port index [0:1] +/// @param[in] i_dimm dimm index [0:1] +/// @return true if dimm is functional, false otherwise +/// +bool is_dimm_functional(const uint8_t i_valid_dimm_bitmap, + const uint8_t i_port, + const uint8_t i_dimm); + #endif /* _MSS_FUNCS_H */ diff --git a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C index 65b95f894..8362380a7 100644 --- a/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C +++ b/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_rowRepairFuncs.C @@ -24,6 +24,7 @@ /* IBM_PROLOG_END_TAG */ #include <p9c_mss_rowRepairFuncs.H> #include <generic/memory/lib/utils/find.H> +#include <generic/memory/lib/utils/c_str.H> using namespace fapi2; diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/eff_config/explorer_attr_engine_traits.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/eff_config/explorer_attr_engine_traits.H index 686f7085c..61c941f53 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/eff_config/explorer_attr_engine_traits.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/eff_config/explorer_attr_engine_traits.H @@ -39,6 +39,7 @@ #include <fapi2.H> #include <lib/shared/exp_consts.H> +#include <generic/memory/lib/data_engine/data_engine_traits_def.H> #include <generic/memory/lib/data_engine/data_engine.H> #include <generic/memory/lib/spd/spd_facade.H> #include <lib/mss_explorer_attribute_getters.H> @@ -610,6 +611,191 @@ struct attrEngineTraits<exp::attr_eff_engine_fields, exp::SPD_CL_SUPPORTED> }; /// +/// @brief Traits for pre_data_engine +/// @class attrEngineTraits +/// @note AXONE, DIMM_TYPE_METADATA specialization +/// +template<> +struct attrEngineTraits<generic_metadata_fields, DIMM_TYPE_METADATA> +{ + using attr_type = fapi2::ATTR_MEM_DIMM_TYPE_METADATA_Type; + using attr_integral_type = std::remove_all_extents<attr_type>::type; + static constexpr fapi2::TargetType TARGET_TYPE = fapi2::ATTR_MEM_DIMM_TYPE_METADATA_TargetType; + static constexpr generic_ffdc_codes FFDC_CODE = SET_DIMM_TYPE_METADATA; + + /// + /// @brief attribute getter + /// @param[in] i_target the MCS target + /// @param[out] o_setting array to populate + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target, + attr_type& o_setting) + { + return mss::attr::get_dimm_type_metadata(i_target, o_setting); + } + + /// + /// @brief attribute setter + /// @param[in] i_target the MCS target + /// @param[in] i_setting array to set + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target, + attr_type& i_setting) + { + return mss::attr::set_dimm_type_metadata(i_target, i_setting); + } + + /// + /// @brief Computes setting for attribute + /// @param[in] i_spd_data SPD data + /// @param[in] i_setting value we want to set attr with + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode get_value_to_set(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, + attr_integral_type& o_setting) + { + return mss::attr::get_dimm_type(i_target, o_setting); + } +}; + +/// +/// @brief Traits associated with DIMM positioning +/// @class dimmPosTraits - EXPLORER specializattion +/// +template<> +class dimmPosTraits<mss::mc_type::EXPLORER> +{ + private: + using PT = posTraits<fapi2::TARGET_TYPE_DIMM>; + using MT = mss::mcTypeTraits<mc_type::EXPLORER>; + + public: + // Public interface syntatic sugar + using pos_type = PT::pos_type; + + // Proc 0 would be DIMM0 - 31, proc 1 would be DIMM32 - 63, etc. 32 is the stride between processors + static constexpr auto DIMM_STRIDE_PER_PROC = 32; + static constexpr auto TOTAL_DIMM = MT::MC_PER_PROC * MT::MI_PER_MC * MT::MCC_PER_MI * + MT::OMI_PER_MCC * MT::OCMB_PER_OMI * MT::PORTS_PER_OCMB * MT::DIMMS_PER_PORT; + + /// + /// @brief Return the PROC_CHIP parent of a DIMM + /// @param[in] i_target the dimm target + /// @return the fapi2 proc target + /// + static fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> get_proc(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) + { + // Using fapi2 rather than mss::find as this is pretty low level stuff. + const auto l_ocmb = i_target.getParent<fapi2::TARGET_TYPE_MEM_PORT>().getParent<fapi2::TARGET_TYPE_OCMB_CHIP>(); + const auto l_mc = l_ocmb.getParent<fapi2::TARGET_TYPE_OMI>().getParent<fapi2::TARGET_TYPE_MC>(); + return l_mc.getParent<fapi2::TARGET_TYPE_PROC_CHIP>(); + } +}; + +/// +/// @brief Traits for pre_data_engine +/// @class attrEngineTraits +/// @note generic_metadata_fields, DRAM_GEN_METADATA specialization +/// +template<> +struct attrEngineTraits<generic_metadata_fields, DRAM_GEN_METADATA> +{ + using attr_type = fapi2::ATTR_MEM_DRAM_GEN_METADATA_Type; + using attr_integral_type = std::remove_all_extents<attr_type>::type; + static constexpr fapi2::TargetType TARGET_TYPE = fapi2::ATTR_MEM_DRAM_GEN_METADATA_TargetType; + static constexpr generic_ffdc_codes FFDC_CODE = SET_DRAM_GEN_METADATA; + + /// + /// @brief attribute getter + /// @param[in] i_target the MCS target + /// @param[out] o_setting array to populate + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target, + attr_type& o_setting) + { + return mss::attr::get_dram_gen_metadata(i_target, o_setting); + } + + /// + /// @brief attribute setter + /// @param[in] i_target the MCS target + /// @param[in] i_setting array to set + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target, + attr_type& i_setting) + { + return mss::attr::set_dram_gen_metadata(i_target, i_setting); + } + + /// + /// @brief Computes setting for attribute + /// @param[in] i_spd_data SPD data + /// @param[in] i_setting value we want to set attr with + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode get_value_to_set(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, + attr_integral_type& o_setting) + { + return mss::attr::get_dram_gen(i_target, o_setting); + } +}; + +/// +/// @brief Traits for pre_data_engine +/// @class attrEngineTraits +/// @note generic_metadata_fields, DIMM_POS_METADATA specialization +/// +template<> +struct attrEngineTraits<generic_metadata_fields, DIMM_POS_METADATA> +{ + using attr_type = fapi2::ATTR_MEM_DIMM_POS_METADATA_Type; + using attr_integral_type = std::remove_all_extents<attr_type>::type; + static constexpr fapi2::TargetType TARGET_TYPE = fapi2::ATTR_MEM_DIMM_POS_METADATA_TargetType; + static constexpr generic_ffdc_codes FFDC_CODE = SET_DIMM_POS_METADATA; + + /// + /// @brief attribute getter + /// @param[in] i_target the MCS target + /// @param[out] o_setting array to populate + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode get_attr(const fapi2::Target<TARGET_TYPE>& i_target, + attr_type& o_setting) + { + return mss::attr::get_dimm_pos_metadata(i_target, o_setting); + } + + /// + /// @brief attribute setter + /// @param[in] i_target the MCS target + /// @param[in] i_setting array to set + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode set_attr(const fapi2::Target<TARGET_TYPE>& i_target, + attr_type& i_setting) + { + return mss::attr::set_dimm_pos_metadata(i_target, i_setting); + } + + /// + /// @brief Computes setting for attribute + /// @param[in] i_spd_data SPD data + /// @param[in] i_setting value we want to set attr with + /// @return FAPI2_RC_SUCCESS iff okay + /// + static fapi2::ReturnCode get_value_to_set(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, + attr_integral_type& o_setting) + { + using TT = mss::dimmPosTraits<mss::mc_type::EXPLORER>; + return gen::dimm_pos<TT>(i_target, o_setting); + } +}; + +/// /// @brief Value traits for attr_eff_engine_fields /// @class attrEngineTraits /// @note attr_eff_engine_fields @@ -620,6 +806,17 @@ struct attrEnumTraits<exp::attr_eff_engine_fields> static constexpr size_t DISPATCHER = exp::ATTR_EFF_DISPATCHER; }; +/// +/// @brief Value traits for attr_eff_engine_fields +/// @class attrEngineTraits +/// @note attr_eff_engine_fields +/// +template < > +struct attrEnumTraits<generic_metadata_fields> +{ + static constexpr size_t DISPATCHER = ATTR_METADATA_DISPATCHER; +}; + }//mss #endif diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C index 4b1072a61..4a3f7c703 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/utils/explorer_pos.C @@ -22,3 +22,62 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file explorer_pos.C +/// @brief Tools to return target's position from a fapi2 target +/// +// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 3 +// *HWP Consumed by: HB:FSP + +#include <generic/memory/lib/utils/pos.H> + +namespace mss +{ + +/// +/// +/// @brief Return a DIMM's relative position from a port +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type +relative_pos<fapi2::TARGET_TYPE_MEM_PORT>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) +{ + typedef mcTypeTraits<mc_type::EXPLORER> TT; + return pos(i_target) % TT::DIMMS_PER_PORT; +} + +/// +/// @brief Return a DIMM's relative position from an OCMB +/// @tparam MC the type of memory controller (defaults to DEFAULT_MC_TYPE) +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type +relative_pos<fapi2::TARGET_TYPE_OCMB_CHIP>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) +{ + typedef mcTypeTraits<mc_type::EXPLORER> TT; + return pos(i_target) % (TT::DIMMS_PER_PORT * TT::PORTS_PER_OCMB); +} + +/// +/// @brief Return an MEM_PORT's relative position from an OCMB +/// @tparam MC the type of memory controller (defaults to DEFAULT_MC_TYPE) +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_MEM_PORT>::pos_type +relative_pos<fapi2::TARGET_TYPE_OCMB_CHIP>(const fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT>& i_target) +{ + typedef mcTypeTraits<mc_type::EXPLORER> TT; + return pos(i_target) % TT::PORTS_PER_OCMB; +} + +}// mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C index e564eafce..d2ddaf136 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/dimm/ddr4/nvdimm_utils.C @@ -49,7 +49,7 @@ #include <lib/mcbist/mcbist.H> #include <lib/mcbist/settings.H> #include <lib/utils/mss_nimbus_conversions.H> - +#include <generic/memory/lib/utils/pos.H> #include <lib/mc/port.H> #include <lib/phy/dp16.H> #include <lib/dimm/mrs_load.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H index bfded0433..038ed1e6e 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/ecc/mainline_nce_trap.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -41,6 +41,7 @@ #include <generic/memory/lib/utils/scom.H> #include <generic/memory/lib/utils/find.H> #include <lib/ecc/ecc_traits.H> +#include <generic/memory/lib/utils/pos.H> namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C index 68a5c02a2..e0c36092f 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C @@ -38,7 +38,7 @@ #include <p9_mc_scom_addresses_fld.H> #include <p9_perv_scom_addresses.H> #include <p9_perv_scom_addresses_fld.H> - +#include <generic/memory/lib/utils/find_magic.H> #include <generic/memory/lib/utils/scom.H> #include <lib/fir/fir.H> #include <lib/fir/check.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C b/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C index 0e2cb2c93..999e4c812 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -36,7 +36,7 @@ #include <fapi2.H> #include <p9_mc_scom_addresses.H> #include <p9_mc_scom_addresses_fld.H> - +#include <generic/memory/lib/utils/find_magic.H> #include <generic/memory/lib/utils/scom.H> #include <lib/fir/fir.H> #include <lib/fir/unmask.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C b/src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C index ef9933edb..62d36ae0b 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/perf_reg.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -44,6 +44,7 @@ #include <generic/memory/lib/utils/scom.H> #include <lib/dimm/kind.H> #include <generic/memory/lib/utils/find.H> +#include <generic/memory/lib/utils/pos.H> using fapi2::TARGET_TYPE_MCA; using fapi2::TARGET_TYPE_MCS; 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 87dd3db08..31ac6eade 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 @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -39,7 +39,7 @@ #include <p9_mc_scom_addresses_fld.H> #include <lib/mss_attribute_accessors.H> - +#include <generic/memory/lib/utils/pos.H> #include <lib/mc/mc.H> #include <lib/mc/xlate.H> #include <generic/memory/lib/utils/scom.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C index 44ae66b87..64ac23bcc 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -37,6 +37,7 @@ #include <lib/mcbist/mcbist.H> #include <lib/utils/dump_regs.H> #include <lib/workarounds/mcbist_workarounds.H> +#include <generic/memory/lib/utils/pos.H> using fapi2::TARGET_TYPE_MCBIST; using fapi2::TARGET_TYPE_MCA; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C index bdd64a0d1..e7176b855 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/memdiags.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -37,7 +37,7 @@ #include <p9_mc_scom_addresses.H> #include <p9_mc_scom_addresses_fld.H> - +#include <generic/memory/lib/utils/find_magic.H> #include <lib/mcbist/memdiags.H> #include <lib/mcbist/mcbist.H> #include <lib/mcbist/address.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C index 01940ac3c..20a8b10a3 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/sim.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -41,6 +41,7 @@ #include <lib/mcbist/patterns.H> #include <lib/mcbist/sim.H> #include <generic/memory/lib/utils/count_dimm.H> +#include <generic/memory/lib/utils/pos.H> using fapi2::TARGET_TYPE_MCBIST; using fapi2::TARGET_TYPE_MCA; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/apb.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/apb.C index eaf787bbc..6ddc3b109 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/apb.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/apb.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -38,6 +38,7 @@ #include <generic/memory/lib/utils/scom.H> #include <generic/memory/lib/utils/c_str.H> #include <generic/memory/lib/utils/index.H> +#include <generic/memory/lib/utils/pos.H> namespace mss { diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C index c8f59400e..b9f8cc351 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -55,7 +55,7 @@ #include <lib/workarounds/dll_workarounds.H> #include <lib/workarounds/dqs_align_workarounds.H> #include <lib/phy/mss_training.H> - +#include <generic/memory/lib/utils/find_magic.H> #include <generic/memory/lib/utils/bit_count.H> #include <generic/memory/lib/utils/find.H> #include <lib/utils/dump_regs.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C index d98f7a56f..89c00b0b8 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C @@ -50,7 +50,7 @@ #include <generic/memory/lib/utils/scom.H> #include <generic/memory/lib/utils/pos.H> #include <generic/memory/lib/utils/c_str.H> - +#include <generic/memory/lib/utils/find_magic.H> #include <lib/workarounds/dp16_workarounds.H> #include <lib/fir/check.H> #include <generic/memory/lib/utils/mss_math.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C index d6137f0a4..0bee4a41f 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/mss_lrdimm_training.C @@ -49,6 +49,7 @@ #include <lib/rosetta_map/rosetta_map.H> #include <lib/dimm/ddr4/pba.H> #include <lib/eff_config/timing.H> +#include <generic/memory/lib/utils/pos.H> #ifdef LRDIMM_CAPABLE #include <lib/phy/mss_lrdimm_training_helper.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C index a0622f929..82a5e2c6e 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -39,6 +39,7 @@ // mss lib #include <lib/power_thermal/throttle.H> #include <generic/memory/lib/utils/count_dimm.H> +#include <generic/memory/lib/utils/pos.H> using fapi2::TARGET_TYPE_MCA; using fapi2::TARGET_TYPE_MCS; diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/rosetta_map/rosetta_map.H b/src/import/chips/p9/procedures/hwp/memory/lib/rosetta_map/rosetta_map.H index f02ff4310..9e8cd18a0 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/rosetta_map/rosetta_map.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/rosetta_map/rosetta_map.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -39,7 +39,7 @@ #include <vector> #include <algorithm> #include <fapi2.H> - +#include <generic/memory/lib/utils/pos.H> #include <lib/mss_attribute_accessors.H> #include <lib/shared/mss_const.H> diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_pos.C b/src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_pos.C index 658ef9bc9..8ace1cac4 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_pos.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_pos.C @@ -22,3 +22,100 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file nimbus_pos.C +/// @brief Tools to return target's position from a fapi2 target +/// +// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Louis Stermole <stermole@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 3 +// *HWP Consumed by: HB:FSP + +#include <generic/memory/lib/utils/shared/mss_generic_consts.H> +#include <generic/memory/lib/utils/pos.H> + +namespace mss +{ + +/// +/// @brief Return a MCA's relative position from an MCBIST +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_MCA>::pos_type +relative_pos<fapi2::TARGET_TYPE_MCBIST>(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target) +{ + + typedef mcTypeTraits<mc_type::NIMBUS> TT; + return pos(i_target) % TT::PORTS_PER_MCBIST; +} + +/// +/// @brief Return a DIMM's relative position from an MCS +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type +relative_pos<fapi2::TARGET_TYPE_MCS>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) +{ + typedef mcTypeTraits<mc_type::NIMBUS> TT; + return pos(i_target) % TT::DIMMS_PER_MCS; +} + +/// +/// @brief Return a DIMM's relative position from an MCA +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type +relative_pos<fapi2::TARGET_TYPE_MCA>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) +{ + typedef mcTypeTraits<mc_type::NIMBUS> TT; + return pos(i_target) % TT::DIMMS_PER_PORT; +} + +/// +/// @brief Return a DIMM's relative position from an MCBIST +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_DIMM>::pos_type +relative_pos<fapi2::TARGET_TYPE_MCBIST>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target) +{ + typedef mcTypeTraits<mc_type::NIMBUS> TT; + return pos(i_target) % TT::DIMMS_PER_MCBIST; +} + +/// +/// @brief Return an MCS's relative position from a processor +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_MCS>::pos_type +relative_pos<fapi2::TARGET_TYPE_PROC_CHIP>(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target) +{ + typedef mcTypeTraits<mc_type::NIMBUS> TT; + return pos(i_target) % TT::MCS_PER_PROC; +} + +/// +/// @brief Return an MCA's relative position from an MCS +/// @param[in] i_target a target representing the target in question +/// @return The position relative to chiplet R +/// +template<> +posTraits<fapi2::TARGET_TYPE_MCA>::pos_type +relative_pos<fapi2::TARGET_TYPE_MCS>(const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target) +{ + typedef mcTypeTraits<mc_type::NIMBUS> TT; + return pos(i_target) % TT::PORTS_PER_MCS; +} + +}// mss diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C index e8acb8237..cb03ee369 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_scominit.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2018 */ +/* Contributors Listed Below - COPYRIGHT 2015,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -43,6 +43,7 @@ #include <lib/phy/ddr_phy.H> #include <lib/mc/mc.H> #include <lib/fir/unmask.H> +#include <generic/memory/lib/utils/find_magic.H> using fapi2::TARGET_TYPE_MCA; using fapi2::TARGET_TYPE_MCBIST; diff --git a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_eff_config.C b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_eff_config.C index 8a1e0a877..4fc51a28e 100644 --- a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_eff_config.C +++ b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_eff_config.C @@ -67,6 +67,8 @@ fapi2::ReturnCode p9a_mss_eff_config( const fapi2::Target<fapi2::TARGET_TYPE_MEM uint64_t l_freq = 0; FAPI_TRY( mss::attr::get_freq(mss::find_target<fapi2::TARGET_TYPE_MEM_PORT>(dimm), l_freq) ); + FAPI_TRY( mss::attr_derived_engine<mss::generic_metadata_fields>::set(dimm) ); + // Quick hack to get the index until DIMM level attrs work FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_REL_POS, dimm, l_dimm_index) ); |