diff options
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/mc')
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C | 5 | ||||
-rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/lib/mc/port.H | 31 |
2 files changed, 35 insertions, 1 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C index 1ee2353bb..907655022 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -93,11 +93,14 @@ fapi2::ReturnCode enable_periodic_cal( const fapi2::Target<fapi2::TARGET_TYPE_MC FAPI_TRY( mss::eff_memcal_interval(i_target, l_memcal_interval) ); FAPI_TRY( mss::eff_zqcal_interval(i_target, l_zqcal_interval) ); + // TODO RTC: 166433 Leave periodics off (0's) by default for the time being +#ifdef TODO_166433_PERIODICS FAPI_TRY( mss::mrw_periodic_memcal_mode_options(l_per_memcal_mode_options) ); FAPI_INF("mrw_periodic_memcal_mode_options: 0x%02x", l_per_memcal_mode_options); FAPI_TRY( mss::mrw_periodic_zqcal_mode_options(l_per_zqcal_mode_options) ); FAPI_INF("mrw_periodic_zqcal_mode_options: 0x%02x", l_per_memcal_mode_options); +#endif // TODO RTC:155854 We haven't done the work for calculating init cal periods // in effective config yet, and the MC setup below is hard wired for sim 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 |