diff options
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_pos.C')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/lib/utils/nimbus_pos.C | 97 |
1 files changed, 97 insertions, 0 deletions
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 |