Skip to content

Commit

Permalink
Adds explorer primary_ranks function for sf_init
Browse files Browse the repository at this point in the history
Change-Id: Ie80cb9bd4343b484d78f4c752b9af2c6b33975d0
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82155
Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
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: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82243
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: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
sglancy6 authored and dcrowell77 committed Aug 16, 2019
1 parent fc5fa58 commit 67fcaa2
Showing 1 changed file with 48 additions and 8 deletions.
Expand Up @@ -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 <aamarin@us.ibm.com>
// *HWP HWP Backup: Stephen Glancy <sglancy@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 2
// *HWP Consumed by: FSP:HB

#ifndef _MSS_EXP_RANK_H_
#define _MSS_EXP_RANK_H_
Expand Down Expand Up @@ -52,16 +61,47 @@ class rankTraits<mss::mc_type::EXPLORER>
};

///
/// @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<T>& i_target, std::vector< uint64_t >& o_rps )
inline fapi2::ReturnCode primary_ranks( const fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT>& i_target,
std::vector< uint64_t >& o_rps )
{
return fapi2::FAPI2_RC_SUCCESS;
o_rps.clear();
std::vector<mss::rank::info<mss::mc_type::EXPLORER>> l_rank_info_vect;
FAPI_TRY(mss::rank::ranks_on_port<mss::mc_type::EXPLORER>(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<fapi2::TARGET_TYPE_DIMM>& i_target,
std::vector< uint64_t >& o_rps )
{
o_rps.clear();
std::vector<mss::rank::info<mss::mc_type::EXPLORER>> l_rank_info_vect;
FAPI_TRY(mss::rank::ranks_on_dimm<mss::mc_type::EXPLORER>(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;
}

///
Expand Down

0 comments on commit 67fcaa2

Please sign in to comment.