From 67fcaa2aafc5302195c086cb63b85b3c1353face Mon Sep 17 00:00:00 2001 From: Stephen Glancy Date: Tue, 13 Aug 2019 11:14:26 -0400 Subject: Adds explorer primary_ranks function for sf_init Change-Id: Ie80cb9bd4343b484d78f4c752b9af2c6b33975d0 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82155 Reviewed-by: Mark Pizzutillo Reviewed-by: Louis Stermole Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: Jennifer A Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82243 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M Crowell --- .../procedures/hwp/memory/lib/dimm/exp_rank.H | 56 ++++++++++++++++++---- 1 file changed, 48 insertions(+), 8 deletions(-) (limited to 'src/import/chips/ocmb') diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/dimm/exp_rank.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/dimm/exp_rank.H index f61dc0db0..d1ed24665 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/dimm/exp_rank.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/dimm/exp_rank.H @@ -22,6 +22,15 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ +/// +/// @file exp_rank.H +/// @brief Explorer rank definitions +/// +// *HWP HWP Owner: Andre Marin +// *HWP HWP Backup: Stephen Glancy +// *HWP Team: Memory +// *HWP Level: 2 +// *HWP Consumed by: FSP:HB #ifndef _MSS_EXP_RANK_H_ #define _MSS_EXP_RANK_H_ @@ -52,16 +61,47 @@ class rankTraits }; /// -/// @brief Return a vector of rank numbers which represent the primary rank pairs for this port or dimm -/// @tparam T the target type -/// @param[in] i_target TARGET_TYPE_MCA or TARGET_TYPEDIMM -/// @param[out] o_rps a vector of rank_pairs +/// @brief Return a vector of rank numbers which represent the primary rank pairs for this port +/// @param[in] i_target port target on which to operate +/// @param[out] o_ranks a vector of ranks /// @return FAPI@_RC_SUCCESS iff all is ok -//TODO: Need to implement this -template< fapi2::TargetType T > -inline fapi2::ReturnCode primary_ranks( const fapi2::Target& i_target, std::vector< uint64_t >& o_rps ) +inline fapi2::ReturnCode primary_ranks( const fapi2::Target& i_target, + std::vector< uint64_t >& o_rps ) { - return fapi2::FAPI2_RC_SUCCESS; + o_rps.clear(); + std::vector> l_rank_info_vect; + FAPI_TRY(mss::rank::ranks_on_port(i_target, l_rank_info_vect)); + + // Loop through and assemble the ranks + for(const auto& l_rank_info : l_rank_info_vect) + { + o_rps.push_back(l_rank_info.get_port_rank()); + } + +fapi_try_exit: + return fapi2::current_err; +} + +/// +/// @brief Return a vector of rank numbers which represent the primary rank pairs for this dimm +/// @param[in] i_target DIMM target on which to operate +/// @param[out] o_ranks a vector of ranks +/// @return FAPI@_RC_SUCCESS iff all is ok +inline fapi2::ReturnCode primary_ranks( const fapi2::Target& i_target, + std::vector< uint64_t >& o_rps ) +{ + o_rps.clear(); + std::vector> l_rank_info_vect; + FAPI_TRY(mss::rank::ranks_on_dimm(i_target, l_rank_info_vect)); + + // Loop through and assemble the ranks + for(const auto& l_rank_info : l_rank_info_vect) + { + o_rps.push_back(l_rank_info.get_port_rank()); + } + +fapi_try_exit: + return fapi2::current_err; } /// -- cgit v1.2.1