diff options
author | Stephen Glancy <sglancy@us.ibm.com> | 2018-02-07 13:17:47 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-02-19 11:32:51 -0500 |
commit | 000f358355b25fe2e46abc44f20e47f315c34f72 (patch) | |
tree | 753c96a3feb546b8dc98438f33fc5a95dd110a22 | |
parent | 5c78bbd873e90210f862d863bca63f94ed169cc8 (diff) | |
download | talos-hostboot-000f358355b25fe2e46abc44f20e47f315c34f72.tar.gz talos-hostboot-000f358355b25fe2e46abc44f20e47f315c34f72.zip |
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 <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53605
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
5 files changed, 123 insertions, 26 deletions
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<fapi2::Target<fapi2::TA const uint64_t l_first_mca_num_dimm = mss::count_dimm(i_targets[0]); // Now, find if we have any MCA's that have a different number of DIMM's - const auto l_mca_it = std::find_if(i_targets.begin(), + // Note: starts on the next MCA target due to the fact that something always equals itself + const auto l_mca_it = std::find_if(i_targets.begin() + 1, i_targets.end(), [l_first_mca_num_dimm]( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_rhs) -> bool { @@ -728,32 +729,74 @@ const mss::states is_broadcast_capable(const std::vector<fapi2::Target<fapi2::TA /// /// @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<fapi2::TARGET_TYPE_MCBIST>& 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<fapi2::TARGET_TYPE_MCBIST>& 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<fapi2::TARGET_TYPE_MCBIST>& 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<mss::dimm::kind>& 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. */ /* */ /* */ @@ -3094,6 +3094,19 @@ fapi2::ReturnCode read_rb_array(const fapi2::Target<T>& i_target, /// /// @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<fapi2::TARGET_TYPE_MCBIST>& 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 /// @param[in] i_target the target to effect /// @return o_capable - yes iff these vector of targets are broadcast capable diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H index b5305ac85..09537972f 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors.H @@ -21491,21 +21491,22 @@ fapi_try_exit: } /// -/// @brief ATTR_MSS_MRW_MEMDIAGS_BCMODE getter +/// @brief ATTR_MSS_MRW_FORCE_BCMODE_OFF getter /// @param[out] uint8_t& reference to store the value /// @note Generated by gen_accessors.pl generateParameters (SYSTEM) /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK -/// @note A switch for memdiags broadcast -/// mode +/// @note An override switch to shut off broadcast mode Enum values: YES: broadcast mode +/// is forced off NO: broadcast mode uses the default +/// value /// -inline fapi2::ReturnCode mrw_memdiags_bcmode(uint8_t& o_value) +inline fapi2::ReturnCode mrw_force_bcmode_off(uint8_t& o_value) { - FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_MEMDIAGS_BCMODE, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), o_value) ); + FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_MRW_FORCE_BCMODE_OFF, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), o_value) ); return fapi2::current_err; fapi_try_exit: - FAPI_ERR("failed accessing ATTR_MSS_MRW_MEMDIAGS_BCMODE: 0x%lx (system target)", + FAPI_ERR("failed accessing ATTR_MSS_MRW_FORCE_BCMODE_OFF: 0x%lx (system target)", uint64_t(fapi2::current_err)); return fapi2::current_err; } @@ -28119,6 +28120,28 @@ fapi_try_exit: /// +/// @brief ATTR_MSS_OVERRIDE_MEMDIAGS_BCMODE getter +/// @param[out] uint8_t& reference to store the value +/// @note Generated by gen_accessors.pl generateParameters (SYSTEM) +/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK +/// @note A switch for memdiags broadcast +/// mode +/// +inline fapi2::ReturnCode override_memdiags_bcmode(uint8_t& o_value) +{ + + FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_OVERRIDE_MEMDIAGS_BCMODE, fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>(), + o_value) ); + return fapi2::current_err; + +fapi_try_exit: + FAPI_ERR("failed accessing ATTR_MSS_OVERRIDE_MEMDIAGS_BCMODE: 0x%lx (system target)", + uint64_t(fapi2::current_err)); + return fapi2::current_err; +} + + +/// /// @brief ATTR_MAX_ALLOWED_DIMM_FREQ getter /// @param[out] uint32_t* memory to store the value /// @note Generated by gen_accessors.pl generateParameters (SYSTEM A) diff --git a/src/import/chips/p9/procedures/xml/attribute_info/memory_mrw_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/memory_mrw_attributes.xml index 9b707c20c..3598d2135 100755 --- a/src/import/chips/p9/procedures/xml/attribute_info/memory_mrw_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/memory_mrw_attributes.xml @@ -618,17 +618,20 @@ </attribute> <attribute> - <id>ATTR_MSS_MRW_MEMDIAGS_BCMODE</id> + <id>ATTR_MSS_MRW_FORCE_BCMODE_OFF</id> <targetType>TARGET_TYPE_SYSTEM</targetType> <description> - A switch for memdiags broadcast mode + An override switch to shut off broadcast mode + Enum values: + YES: broadcast mode is forced off + NO: broadcast mode uses the default value </description> <valueType>uint8</valueType> <platInit/> <initToZero/> <overrideOnly/> - <enum> ENABLE = 0, DISABLE = 1 </enum> - <mssAccessorName>mrw_memdiags_bcmode</mssAccessorName> + <enum> NO = 0, YES = 1 </enum> + <mssAccessorName>mrw_force_bcmode_off</mssAccessorName> </attribute> <attribute> diff --git a/src/import/chips/p9/procedures/xml/attribute_info/memory_override_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/memory_override_attributes.xml index 8f9c60d11..4269fa2aa 100644 --- a/src/import/chips/p9/procedures/xml/attribute_info/memory_override_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/memory_override_attributes.xml @@ -5,7 +5,7 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- Contributors Listed Below - COPYRIGHT 2016 --> +<!-- Contributors Listed Below - COPYRIGHT 2016,2018 --> <!-- [+] International Business Machines Corp. --> <!-- --> <!-- --> @@ -182,4 +182,18 @@ <overrideOnly/> </attribute> + <attribute> + <id>ATTR_MSS_OVERRIDE_MEMDIAGS_BCMODE</id> + <targetType>TARGET_TYPE_SYSTEM</targetType> + <description> + A switch for memdiags broadcast mode + </description> + <valueType>uint8</valueType> + <platInit/> + <initToZero/> + <overrideOnly/> + <enum> ENABLE = 0, DISABLE = 1 </enum> + <mssAccessorName>override_memdiags_bcmode</mssAccessorName> + </attribute> + </attributes> |