diff options
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.H')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.H | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.H b/src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.H new file mode 100644 index 000000000..5e11ad551 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/memory/lib/freq/sync.H @@ -0,0 +1,91 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: chips/p9/procedures/hwp/memory/lib/freq/sync.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* EKB Project */ +/* */ +/* COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/// +/// @file synch.H +/// @brief Synchronous function implementations +/// +// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com> +// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com> +// *HWP Team: Memory +// *HWP Level: 2 +// *HWP Consumed by: HB:FSP + +#ifndef _MSS_SYNC_H_ +#define _MSS_SYNC_H_ + +#include <map> +#include <vector> + +#include <fapi2.H> + +namespace mss +{ + +enum class speed_equality : uint8_t +{ + NOT_EQUAL_DIMM_SPEEDS = 0, + EQUAL_DIMM_SPEEDS = 1, +}; + +enum class sync_mode : uint8_t +{ + MC_NOT_IN_SYNC = 0, + MC_IN_SYNC = 1, +}; + +/// +/// @brief Retrieves a mapping of MSS frequency values per mcbist target +/// @param[in] i_targets vector of controller targets +/// @param[out] o_freq_map dimm speed map <key, value> = (mcbist target, frequency) +/// @param[out] o_is_speed_equal holds whether map dimm speed is equal +/// @return FAPI2_RC_SUCCESS iff successful +/// +fapi2::ReturnCode dimm_speed_map(const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCBIST> >& i_targets, + std::map< fapi2::Target<fapi2::TARGET_TYPE_MCBIST>, uint64_t >& o_freq_map, + speed_equality& o_is_speed_equal); + +/// +/// @brief Helper function to deconfigure MCS targets connected to MCBIST +/// @param[in] i_target the controller target +/// @param[in] i_dimm_speed dimm speed in MT/s +/// @param[in] i_nest_freq nest freq in MHz +/// @return true if hardware was deconfigured +/// +bool deconfigure(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target, + const uint64_t i_dimm_speed, + const uint32_t i_nest_freq); + +/// +/// @brief Selects synchronous mode and performs requirements enforced by ATTR_REQUIRED_SYNCH_MODE +/// @param[in] i_freq_map dimm speed mapping +/// @param[in] i_equal_dimm_speed tracks whether map has equal dimm speeds +/// @param[in] i_nest_freq nest frequency +/// @param[in] i_required_sync_mode system policy to enforce synchronous mode +/// @param[out] o_selected_sync_mode final synchronous mode +/// @return FAPI2_RC_SUCCESS iff successful +/// +fapi2::ReturnCode select_sync_mode(const std::map< fapi2::Target<fapi2::TARGET_TYPE_MCBIST>, uint64_t >& i_freq_map, + const speed_equality i_equal_dimm_speed, + const uint32_t i_nest_freq, + const uint8_t i_required_sync_mode, + sync_mode& o_selected_sync_mode); + +}// mss + +#endif |