diff options
author | Jacob Harvey <jlharvey@us.ibm.com> | 2017-05-16 14:57:06 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-05-24 22:37:21 -0400 |
commit | c5c795757a97971ef61548997991880a527122ae (patch) | |
tree | de51a3de2786b16df774278ac74e2e4920662429 | |
parent | e912642e50b25be2e1cc4f30ce2922d8fd61a239 (diff) | |
download | talos-hostboot-c5c795757a97971ef61548997991880a527122ae.tar.gz talos-hostboot-c5c795757a97971ef61548997991880a527122ae.zip |
Clear DLL CNTL ERROR and FIR bits for workaround
Change-Id: Ib9527d5a349806373242100891a3f29741094d55
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40590
Dev-Ready: JACOB L. HARVEY <jlharvey@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+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/40599
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
3 files changed, 49 insertions, 2 deletions
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 4daa01102..ce0497058 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 @@ -105,6 +105,7 @@ fapi2::ReturnCode during_phy_reset( const fapi2::Target<TARGET_TYPE_MCBIST>& i_t fapi2::buffer<uint64_t> l_phyfir_mask; l_phyfir_mask.setBit<MCA_IOM_PHY0_DDRPHY_FIR_REG_ERROR_0>() .setBit<MCA_IOM_PHY0_DDRPHY_FIR_REG_ERROR_1>() + .setBit<MCA_IOM_PHY0_DDRPHY_FIR_REG_ERROR_2>() .setBit<MCA_IOM_PHY0_DDRPHY_FIR_REG_ERROR_3>() .setBit<MCA_IOM_PHY0_DDRPHY_FIR_REG_ERROR_4>() .setBit<MCA_IOM_PHY0_DDRPHY_FIR_REG_ERROR_5>() diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C index 78b981343..38fe32402 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C +++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.C @@ -32,9 +32,11 @@ #include <map> #include <fapi2.H> #include <lib/workarounds/dll_workarounds.H> +#include <lib/fir/check.H> #include <generic/memory/lib/utils/find.H> #include <generic/memory/lib/utils/scom.H> #include <lib/phy/dp16.H> +#include <lib/fir/fir.H> #include <lib/shared/mss_const.H> #include <lib/utils/conversions.H> @@ -140,6 +142,33 @@ namespace dll { /// +/// @brief Clears the DLL firs +/// @param[in] i_target the MCA target +/// @return FAPI2_RC_SUCCESS if the scoms don't fail +/// @note Need to clear the DLL firs when we notice a DLL fail for workarounds +/// +fapi2::ReturnCode clear_dll_fir( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target ) +{ + fapi2::buffer<uint64_t> l_phyfir_data; + + fir::reg<MCA_IOM_PHY0_DDRPHY_FIR_REG> l_mca_fir_reg(i_target, fapi2::current_err); + FAPI_TRY(fapi2::current_err, "%s unable to create fir::reg for 0x%016llx", mss::c_str(i_target), + MCA_IOM_PHY0_DDRPHY_FIR_REG); + + FAPI_TRY(l_mca_fir_reg.clear<MCA_IOM_PHY0_DDRPHY_FIR_REG_ERROR_2>()); // bit 56 + FAPI_TRY(l_mca_fir_reg.clear<MCA_IOM_PHY0_DDRPHY_FIR_REG_ERROR_4>()); // bit 58 + + FAPI_TRY( mss::getScom(i_target, MCA_IOM_PHY0_DDRPHY_FIR_REG, l_phyfir_data), + "Failed getScom() operation on %s reg 0x%016llx", + mss::c_str(i_target), MCA_IOM_PHY0_DDRPHY_FIR_REG); + + FAPI_INF("%s PHY FIR register is now 0x%016llx", mss::c_str(i_target), l_phyfir_data); + +fapi_try_exit: + return fapi2::current_err; +} + +/// /// @brief Checks if CAL_ERROR and CAL_ERROR_FINE bits are set /// @param[in] i_dll_cntrl_data DLL CNTRL data /// @return true if DLL cal failed, false otherwiae @@ -362,6 +391,7 @@ fapi_try_exit: template< > fapi2::ReturnCode fix_bad_voltage_settings(const fapi2::Target<fapi2::TARGET_TYPE_MCBIST>& i_target) { + constexpr uint64_t SKIP_VREG = 0b10; for( const auto& p : mss::find_targets<fapi2::TARGET_TYPE_MCA>(i_target) ) @@ -383,13 +413,17 @@ fapi2::ReturnCode fix_bad_voltage_settings(const fapi2::Target<fapi2::TARGET_TYP for( const auto& d : l_failing_dll_cntrl ) { + // Need to clear out the error bits even though we set the reset bit FAPI_TRY(mss::getScom(p, d, l_read), "Failed getScom() operation on %s reg 0x%016llx", mss::c_str(i_target), d ); - - + FAPI_DBG("%s DLL CNTRL register is 0x%016llx", mss::c_str(p), l_read); mss::dp16::set_dll_cal_reset(l_read, mss::HIGH); mss::dp16::set_dll_cal_skip(l_read, SKIP_VREG); + l_read.clearBit<mss::dll_map::DLL_CNTL_CAL_ERROR>(); + l_read.clearBit<mss::dll_map::DLL_CNTL_CAL_ERROR_FINE>(); + + FAPI_DBG("%s new setting for DLL CNTRL register is 0x%016llx", mss::c_str(p), l_read); FAPI_TRY(mss::putScom(p, d, l_read), "Failed putScom() operation on %s reg 0x%016llx", @@ -399,6 +433,8 @@ fapi2::ReturnCode fix_bad_voltage_settings(const fapi2::Target<fapi2::TARGET_TYP } + FAPI_TRY( clear_dll_fir(p) ); + // Write the VREG DAC value found in log_fails to the failing DLL VREG DAC FAPI_TRY( change_vreg_coarse(p, l_failing_dll_vreg_coarse), "%s Failed change_vreg_coarse()", mss::c_str(p) ); @@ -439,12 +475,14 @@ fapi2::ReturnCode fix_bad_voltage_settings(const fapi2::Target<fapi2::TARGET_TYP FAPI_TRY( check_status(p, l_failing_dll_cntrl), "%s check_status() failed", mss::c_str(p)); + }// mca fapi_try_exit: return fapi2::current_err; } + } // close namespace dll } // close namespace workarounds } // close namespace mss diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.H b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.H index f7dd7b711..f6ea56402 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/workarounds/dll_workarounds.H @@ -52,6 +52,7 @@ struct dll_map MCA_DDRPHY_DP16_DLL_VREG_COARSE0_P0_1_01_REGS_RXDLL_DAC_COARSE_LEN; static constexpr uint64_t DLL_CNTL_CAL_ERROR = MCA_DDRPHY_DP16_DLL_CNTL0_P0_1_01_CAL_ERROR; static constexpr uint64_t DLL_CNTL_CAL_ERROR_FINE = MCA_DDRPHY_DP16_DLL_CNTL0_P0_1_01_CAL_ERROR_FINE; + static constexpr uint64_t DLL_CAL_GOOD = MCA_DDRPHY_DP16_DLL_CNTL0_P0_1_01_CAL_GOOD; // Value for UPPER and LOWER DAC are the same // Used LOWER DAC enumeration...just because @@ -91,6 +92,13 @@ namespace dll { /// +/// @brief Clears the DLL firs +/// @param[in] i_target the MCA target +/// @return returns true unless if scom errors +/// +fapi2::ReturnCode clear_dll_fir( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target ); + +/// /// @brief Checks if CAL_ERROR and CAL_ERROR_FINE bits are set /// @param[in] i_dll_cntrl_data DLL CNTRL data /// @return bool |