diff options
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H index c5edddf9f..48a75d431 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H @@ -40,6 +40,7 @@ #include <p9_mc_scom_addresses.H> #include <p9_mc_scom_addresses_fld.H> +#include <lib/mss_attribute_accessors.H> #include <lib/shared/mss_const.H> #include <lib/utils/scom.H> @@ -507,5 +508,35 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief Apply mark store bits from module VPD +/// @tparam T, the fapi2 target type of the target +/// @tparam TT, the class traits for the port +/// @param[in] i_target A target representing a port +/// @return FAPI2_RC_SUCCESS if and only if ok +/// +template< fapi2::TargetType T, typename TT = portTraits<T> > +fapi2::ReturnCode apply_mark_store( const fapi2::Target<T>& i_target ) +{ + FAPI_INF("Enable marks from MVPD"); + + uint32_t l_fwms[MARK_STORE_COUNT]; + + FAPI_TRY( mss::mvpd_fwms(i_target, &(l_fwms[0])) ); + + for (size_t l_mark = 0; l_mark < MARK_STORE_COUNT; ++l_mark) + { + if (l_fwms[l_mark] != 0) + { + fapi2::buffer<uint64_t> l_fwms_data; + l_fwms_data.insertFromRight < MCA_FWMS0_MARK, MCA_FWMS0_EXIT_1 - MCA_FWMS0_MARK + 1 > (l_fwms[l_mark]); + FAPI_TRY( mss::putScom(i_target, MCA_FWMS0 + l_mark, l_fwms_data) ); + } + } + +fapi_try_exit: + return fapi2::current_err; +} + } #endif |