From 779761d1c5e0d143e1b2d7bc1da248345d2dffb8 Mon Sep 17 00:00:00 2001 From: Mark Pizzutillo Date: Fri, 10 Jan 2020 15:57:10 -0500 Subject: Add read only subtest at the end of exp_mss_memdiags Change-Id: I280e814e7013b8d8844655c20f19b410ff7c2516 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/89612 Reviewed-by: STEPHEN GLANCY Tested-by: Jenkins Server Tested-by: Hostboot CI Tested-by: FSP CI Jenkins Reviewed-by: Louis Stermole Dev-Ready: Mark Pizzutillo Reviewed-by: Jennifer A Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90002 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M Crowell --- .../procedures/hwp/memory/exp_mss_memdiag.C | 12 +++- .../hwp/memory/lib/mcbist/exp_memdiags.C | 72 +++++++++++++++++++++- .../hwp/memory/lib/mcbist/exp_memdiags.H | 33 +++++++++- .../xml/attribute_info/exp_attributes.xml | 36 +++++++++++ 4 files changed, 150 insertions(+), 3 deletions(-) diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_mss_memdiag.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_mss_memdiag.C index 14b9af119..f2452efdd 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_mss_memdiag.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_mss_memdiag.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2019 */ +/* Contributors Listed Below - COPYRIGHT 2015,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -51,9 +51,19 @@ extern "C" /// fapi2::ReturnCode exp_mss_memdiag( const fapi2::Target& i_target ) { + uint8_t l_post_memdiags_subtest = 0; + FAPI_INF("Start exp_mss_memdiag on: %s", mss::c_str( i_target )); FAPI_TRY(mss::memdiags::mss_initialize_memory(i_target)); + FAPI_TRY(mss::attr::get_post_memdiags_read_subtest(i_target, l_post_memdiags_subtest)); + + // Perform subtest if attribute is set to + if (l_post_memdiags_subtest == fapi2::ENUM_ATTR_MSS_POST_MEMDIAGS_READ_SUBTEST_ENABLE) + { + FAPI_TRY(mss::exp::memdiags::perform_read_only_subtest(i_target)); + } + fapi_try_exit: FAPI_INF("End exp_mss_memdiag on %s", mss::c_str( i_target )); return fapi2::current_err; diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mcbist/exp_memdiags.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mcbist/exp_memdiags.C index ba40143c5..c4e2f807e 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mcbist/exp_memdiags.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mcbist/exp_memdiags.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2019 */ +/* Contributors Listed Below - COPYRIGHT 2019,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -66,4 +66,74 @@ fapi2::ReturnCode operation::multi_port_init_internal() } // namespace memdiags +namespace exp +{ + +namespace memdiags +{ + +/// +/// @brief Process the result from the mcbist sf_read subtest after memdiags +/// +/// @param[in] i_target OCMB target for traces +/// @param[in] l_fail_behavior_attr +/// @param[in,out] io_rc ReturnCode from sf_read +/// @return fapi2::ReturnCode +/// +fapi2::ReturnCode process_subtest_result(const fapi2::Target& i_target, + const uint8_t l_fail_behavior_attr, + fapi2::ReturnCode& io_rc) +{ + // Check RC + if ((l_fail_behavior_attr == fapi2::ENUM_ATTR_MSS_POST_MEMDIAGS_READ_SUBTEST_FAIL_BEHAVIOR_TRACE) + && (io_rc != fapi2::FAPI2_RC_SUCCESS)) + { + // Trace + Bad RC: Log as recovered, return success, set io_rc back to success + FAPI_ERR("%s Error code 0x%08lx from post-memdiags mcbist read subtest", mss::c_str(i_target), uint32_t(io_rc)); + fapi2::logError(io_rc, fapi2::FAPI2_ERRL_SEV_RECOVERED); + + io_rc = fapi2::FAPI2_RC_SUCCESS; + + return fapi2::FAPI2_RC_SUCCESS; + } + + // Else, we will just try the RC as-is + FAPI_TRY(io_rc, "%s Error from post-memdiags mcbist read subtest", mss::c_str(i_target)); + +fapi_try_exit: + return fapi2::current_err; +} + +/// +/// @brief Perform a read only mcbist subtest at the end of memdiags +/// +/// @param[in] i_target OCMB Chip +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error +/// +fapi2::ReturnCode perform_read_only_subtest(const fapi2::Target& i_target) +{ + fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS; + uint8_t l_fail_behavior = 0; + + auto l_stop_conditions = mss::mcbist::stop_conditions(); + + // Pause on unrecoverable error + l_stop_conditions.set_pause_on_ue(mss::ON); + + // sf_read will run, poll for completion and return result ReturnCode + l_rc = mss::memdiags::sf_read(i_target, l_stop_conditions); + + // Get fail behavior attr and process the result + FAPI_TRY(mss::attr::get_post_memdiags_read_subtest(i_target, l_fail_behavior)); + FAPI_TRY(process_subtest_result(i_target, l_fail_behavior, l_rc)); + + return fapi2::FAPI2_RC_SUCCESS; + +fapi_try_exit: + return fapi2::current_err; +} + +} // memdiags +} // exp + } // namespace mss diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mcbist/exp_memdiags.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mcbist/exp_memdiags.H index 8feb8123c..a53b7c312 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mcbist/exp_memdiags.H +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/mcbist/exp_memdiags.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2019 */ +/* Contributors Listed Below - COPYRIGHT 2019,2020 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -45,4 +45,35 @@ // This file is still necessary to put traits and generic code together +namespace mss +{ +namespace exp +{ +namespace memdiags +{ + +/// +/// @brief Process the result from the mcbist sf_read subtest after memdiags +/// +/// @param[in] i_target OCMB target for traces +/// @param[in] l_fail_behavior_attr +/// @param[in, out] i_rc ReturnCode from sf_read +/// @return fapi2::ReturnCode +/// +fapi2::ReturnCode process_subtest_result(const fapi2::Target& i_target, + const uint8_t l_fail_behavior_attr, + fapi2::ReturnCode& io_rc); + +/// +/// @brief Perform a read only mcbist subtest at the end of memdiags +/// +/// @param[in] i_target OCMB Chip +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error +/// +fapi2::ReturnCode perform_read_only_subtest(const fapi2::Target& i_target); + +} // memdiags +} // exp +} // mss + #endif diff --git a/src/import/chips/ocmb/explorer/procedures/xml/attribute_info/exp_attributes.xml b/src/import/chips/ocmb/explorer/procedures/xml/attribute_info/exp_attributes.xml index a65155d69..61ff45e98 100644 --- a/src/import/chips/ocmb/explorer/procedures/xml/attribute_info/exp_attributes.xml +++ b/src/import/chips/ocmb/explorer/procedures/xml/attribute_info/exp_attributes.xml @@ -487,4 +487,40 @@ check_for_ready_timeout + + ATTR_MSS_POST_MEMDIAGS_READ_SUBTEST + TARGET_TYPE_OCMB_CHIP + + Whether to run post-memdiags read-only subtest + + uint8 + + DISABLE = 0, + ENABLE = 1 + + ENABLE + + + post_memdiags_read_subtest + + + + ATTR_MSS_POST_MEMDIAGS_READ_SUBTEST_FAIL_BEHAVIOR + TARGET_TYPE_OCMB_CHIP + + Behvaior to perform if read subtest post-memdiags does not get a good result. + EXIT = fapi_try_exit out with error code + TRACE = FAPI_ERR that test failed, return success code + + uint8 + + EXIT = 0, + TRACE = 1 + + EXIT + + + post_memdiags_read_subtest_fail_behavior + + -- cgit v1.2.1