summaryrefslogtreecommitdiffstats
path: root/src/import/chips/ocmb/explorer/procedures/hwp/memory
diff options
context:
space:
mode:
authorStephen Glancy <sglancy@us.ibm.com>2019-08-13 11:14:26 -0400
committerDaniel M Crowell <dcrowell@us.ibm.com>2019-08-16 09:27:48 -0500
commit67fcaa2aafc5302195c086cb63b85b3c1353face (patch)
tree022ccddf9b5a8fdbae16166a22b5ca65ec3ce7ec /src/import/chips/ocmb/explorer/procedures/hwp/memory
parentfc5fa5842e3e03e1419501de236c36b1641281d0 (diff)
downloadtalos-hostboot-67fcaa2aafc5302195c086cb63b85b3c1353face.tar.gz
talos-hostboot-67fcaa2aafc5302195c086cb63b85b3c1353face.zip
Adds explorer primary_ranks function for sf_init
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>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/dimm/exp_rank.H56
1 files changed, 48 insertions, 8 deletions
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 <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_
@@ -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;
}
///
OpenPOWER on IntegriCloud