From f18a5784ca82e3e44572fa55ac36673736d9eb66 Mon Sep 17 00:00:00 2001 From: Jacob Harvey Date: Thu, 31 Aug 2017 17:54:14 -0500 Subject: Add FIR checking to training error checking Change-Id: I7de696f3724a3a3b10650790d481ecb1130d6d7c Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45580 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: STEPHEN GLANCY Reviewed-by: ANDRE A. MARIN Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45583 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- .../chips/p9/procedures/hwp/memory/lib/fir/check.C | 46 ++++++++++++++++++++++ .../chips/p9/procedures/hwp/memory/lib/fir/check.H | 15 ++++++- .../p9/procedures/hwp/memory/lib/phy/ddr_phy.C | 14 ++++++- 3 files changed, 72 insertions(+), 3 deletions(-) (limited to 'src/import/chips/p9/procedures/hwp/memory/lib') diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C index ed1cbb30b..e0615943f 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C @@ -181,6 +181,52 @@ fapi_try_exit: return fapi2::current_err; } +/// +/// @brief Check FIR bits during draminit training +/// @param[in] i_target the dimm that was trained +/// @note We check for fir errors after training each rank +/// to see if there was a problem with the engine. +/// FFDC errors returned from this will be handled similar to other training errors: +/// Logged as informational if it affects less than a nibble and a bit. +/// Reported if it affects more than that +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok +/// +template<> +fapi2::ReturnCode during_draminit_training( const fapi2::Target& i_target) +{ + const auto& l_mca = mss::find_target(i_target); + + // Creating a mask to check for FIR errors. + // These are DP16 parity errors that would be triggered in case of a general PHY error + // During draminit_training, this would mean a training error dealing with the PHY + fapi2::buffer l_phyfir_mask; + l_phyfir_mask.setBit() + .setBit() + .setBit() + .setBit() + .setBit() + .setBit() + .setBit() + .setBit(); + + fapi2::buffer l_phyfir_data; + fapi2::buffer l_phyfir_masked; + + FAPI_TRY( mss::getScom(l_mca, MCA_IOM_PHY0_DDRPHY_FIR_REG, l_phyfir_data) ); + + l_phyfir_masked = l_phyfir_data & l_phyfir_mask; + + FAPI_ASSERT( l_phyfir_masked == 0, + fapi2::MSS_DRAMINIT_TRAINING_PORT_FIR() + .set_PHY_FIR(l_phyfir_masked) + .set_DIMM_TARGET(i_target) + .set_MCA_TARGET(l_mca), + "Initial CAL failed: Reporting FIR bits set for %s ( phy: 0x%016lx", + mss::c_str(i_target), l_phyfir_masked); + +fapi_try_exit: + return fapi2::current_err; +} } } diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.H b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.H index 27f884940..ded638e49 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/fir/check.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -56,6 +56,19 @@ namespace check template< fapi2::TargetType T > fapi2::ReturnCode during_phy_reset( const fapi2::Target& i_target ); +/// +/// @brief Check FIR bits during draminit training +/// @param[in] i_target the dimm that was trained +/// @note We check for fir errors after training each rank +/// to see if there was a problem with the engine +/// FFDC errors return from this will be handle similar to other training errors +/// Logged if it affects less than a nibble and a bit. +/// Reported if it affects more than that +/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok +/// +template< fapi2::TargetType T > +fapi2::ReturnCode during_draminit_training( const fapi2::Target& i_target ); + } } #endif diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C b/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C index 4aa6a48bd..ca275de9c 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/phy/ddr_phy.C @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -540,7 +541,11 @@ fapi2::ReturnCode process_initial_cal_errors( const fapi2::Target