summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/lib/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/utils')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H50
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H2
2 files changed, 51 insertions, 1 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H
index 1a81db863..77aa4fcc5 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/find.H
@@ -34,6 +34,8 @@
#include <map>
#include <vector>
+#include <lib/utils/pos.H>
+
namespace mss
{
@@ -163,6 +165,30 @@ inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> > find_targets( const
}
///
+/// @brief find all the MCA connected to an MCBIST
+/// @param[in] i_target a fapi2::Target MCBIST
+/// @return a vector of fapi2::TARGET_TYPE_MCA
+///
+template<>
+inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCA> > find_targets( const
+ fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target )
+{
+ return i_target.getChildren<fapi2::TARGET_TYPE_MCA>();
+}
+
+///
+/// @brief find all the DIMM connected to an MCA
+/// @param[in] i_target a fapi2::Target MCA
+/// @return a vector of fapi2::TARGET_TYPE_DIMM
+///
+template<>
+inline std::vector< fapi2::Target<fapi2::TARGET_TYPE_DIMM> > find_targets( const
+ fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target )
+{
+ return i_target.getChildren<fapi2::TARGET_TYPE_DIMM>();
+}
+
+///
/// @brief find the MCS given a DIMM
/// @param[in] i_target the fapi2 target DIMM
/// @return a MCS target.
@@ -221,6 +247,30 @@ bool find_value_from_key(const std::vector<std::pair<T, OT> >& i_vector_of_pairs
}// find_value_from_key
+///
+/// @brief Determine if a thing is functional
+/// @tparam P, the type of the parent which holds the things of interest
+/// @tparam I, the type of the item we want to check for
+/// @param[in] i_target the parent containing the thing we're looking for
+/// @param[in] i_rel_pos the relative position of the item of interest.
+/// @return bool true iff the thing at i_rel_pos is noted as functional
+///
+template< fapi2::TargetType I, fapi2::TargetType P >
+bool is_functional( const fapi2::Target<P>& i_target, const uint64_t i_rel_pos )
+{
+ // Not sure of a good way to do this ... we get all the functional
+ // children of the parent and look for our relative position ...
+ for (const auto& i : i_target.template getChildren<I>(fapi2::TARGET_STATE_FUNCTIONAL))
+ {
+ if (mss::template relative_pos<P>(i) == i_rel_pos)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
}// mss
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H b/src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H
index a63d20d95..9a3491320 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/utils/scom.H
@@ -31,7 +31,7 @@
#define _MSS_SCOM_H_
#include <fapi2.H>
-#include <utils/c_str.H>
+#include <lib/utils/c_str.H>
//
// Wrapping scom operations: We wrap fapi2::get/putScom for two reasons. The
OpenPOWER on IntegriCloud