From 000f358355b25fe2e46abc44f20e47f315c34f72 Mon Sep 17 00:00:00 2001 From: Stephen Glancy Date: Wed, 7 Feb 2018 13:17:47 -0600 Subject: Updates broadcast mode attributes Change-Id: Ia07a7036bbcc807f0f8cded35b06789a6f8c417c CQ:SW416637 RTC:187548 CMVC-Prereq: 1046151 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53569 Tested-by: FSP CI Jenkins Reviewed-by: Louis Stermole Reviewed-by: ANDRE A. MARIN Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: Hostboot CI Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53605 Reviewed-by: Daniel M. Crowell Tested-by: Daniel M. Crowell --- .../p9/procedures/hwp/memory/lib/mcbist/mcbist.C | 72 +++++++++++++++++----- .../p9/procedures/hwp/memory/lib/mcbist/mcbist.H | 15 ++++- 2 files changed, 72 insertions(+), 15 deletions(-) (limited to 'src/import/chips/p9/procedures/hwp/memory/lib/mcbist') diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C index 267b69573..44ae66b87 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -700,7 +700,8 @@ const mss::states is_broadcast_capable(const std::vector& i_rhs) -> bool { @@ -728,32 +729,74 @@ const mss::states is_broadcast_capable(const std::vector -const mss::states is_broadcast_capable(const fapi2::Target& i_target) +/// @param[in] i_target the target to effect +/// @param[in] i_bc_force attribute's value to force off broadcast mode +/// @param[in] i_bc_enable attribute's value to enable or disable broadcast mode +/// @param[in] i_chip_bc_capable true if the chip is BC capable +/// @return o_capable - yes iff these vector of targets are broadcast capable +/// +const mss::states is_broadcast_capable_helper(const fapi2::Target& i_target, + const uint8_t i_bc_force, + const uint8_t i_bc_enable, + const bool i_chip_bc_capable) { // First off, check if we need to disable broadcast mode due to a chip size bug // Note: the bug check is decidedly more complicated than the EC check, but we'll just disable BC mode out of safety concerns // Better to go slow and steady and initialize the chip properly than to go fast and leave the memory initialized poorly - if( mss::chip_ec_feature_mcbist_end_of_rank(i_target) ) + if( !i_chip_bc_capable ) { FAPI_INF("%s A chip bug prevents broadcast mode. Chip is not brodcast capable", mss::c_str(i_target)); return mss::states::NO; } + // If BC mode is forced off, then we're done + if( i_bc_force == fapi2::ENUM_ATTR_MSS_MRW_FORCE_BCMODE_OFF_YES ) + { + FAPI_INF("%s MRW attribute has broadcast mode forced off", mss::c_str(i_target)); + return mss::states::NO; + } + + // Now check the override broadcast mode capable attribute + if( i_bc_enable == fapi2::ENUM_ATTR_MSS_OVERRIDE_MEMDIAGS_BCMODE_DISABLE ) + { + FAPI_INF("%s attribute has broadcast mode disabled", mss::c_str(i_target)); + return mss::states::NO; + } + + // Otherwise, our chip and attributes allow us to be BC capable + FAPI_INF("%s chip and attributes allow for BC mode", mss::c_str(i_target)); + return mss::states::YES; +} + +/// +/// @brief Checks if broadcast mode is capable of being enabled on this target +/// @param[in] i_target the target to effect - specialization for MCBIST target type +/// @return l_capable - yes iff these vector of targets are broadcast capable +/// +template< > +const mss::states is_broadcast_capable(const fapi2::Target& i_target) +{ + // Chip is BC capable IFF the MCBIST end of rank bug is not present + const auto l_chip_bc_capable = !mss::chip_ec_feature_mcbist_end_of_rank(i_target); + // If BC mode is disabled in the MRW, then it's disabled here uint8_t l_bc_mode_enable = 0; - FAPI_TRY(mss::mrw_memdiags_bcmode(l_bc_mode_enable)); + uint8_t l_bc_mode_force_off = 0; + FAPI_TRY(mss::override_memdiags_bcmode(l_bc_mode_enable)); + FAPI_TRY(mss::mrw_force_bcmode_off(l_bc_mode_force_off)); - if( l_bc_mode_enable == fapi2::ENUM_ATTR_MSS_MRW_MEMDIAGS_BCMODE_DISABLE ) + // Check if the chip and attributes allows memdiags/mcbist to be in broadcast mode { - FAPI_INF("%s MRW attribute has broadcast mode disabled", mss::c_str(i_target)); - return mss::states::NO; + const auto l_state = is_broadcast_capable_helper(i_target, l_bc_mode_force_off, l_bc_mode_enable, l_chip_bc_capable); + + if(l_state == mss::states::NO) + { + return l_state; + } } - // Now that we are guaranteed to have a chip that could run broadcast mode, do the following steps to check whether our config is broadcast capable: + // Now that we are guaranteed to have a chip that could run broadcast mode and the system is allowed to do so, + // do the following steps to check whether our config is broadcast capable: { // Steps to determine if this MCBIST is broadcastable // 1) Check the number of DIMM's on each MCA - true only if they all match @@ -801,7 +844,8 @@ const mss::states is_broadcast_capable(const std::vector& i_kin const auto l_expected_kind = i_kinds[0]; // Now, find if we have any kinds that differ from our first kind - const auto l_kind_it = std::find_if(i_kinds.begin(), + // Note: starts on the next DIMM kind due to the fact that something always equals itself + const auto l_kind_it = std::find_if(i_kinds.begin() + 1, i_kinds.end(), [&l_expected_kind]( const mss::dimm::kind & i_rhs) -> bool { // If they're different, we found a DIMM that is differs diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H index 146d9d2ca..160db78ac 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mcbist/mcbist.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -3092,6 +3092,19 @@ fapi2::ReturnCode read_rb_array(const fapi2::Target& i_target, return read_rb_array(i_target, i_start_addr, i_num_entries, o_data, l_temp); } +/// +/// @brief Checks if broadcast mode is capable of being enabled on this target +/// @param[in] i_target the target to effect +/// @param[in] i_bc_force attribute's value to force off broadcast mode +/// @param[in] i_bc_enable attribute's value to enable or disable broadcast mode +/// @param[in] i_chip_bc_capable true if the chip is BC capable +/// @return o_capable - yes iff these vector of targets are broadcast capable +/// +const mss::states is_broadcast_capable_helper(const fapi2::Target& i_target, + const uint8_t i_bc_force, + const uint8_t i_bc_enable, + const bool i_chip_bc_capable); + /// /// @brief Checks if broadcast mode is capable of being enabled on this target /// @tparam T, the fapi2::TargetType -- cgit v1.2.1