Skip to content

Commit

Permalink
Clear DLL CNTL ERROR and FIR bits for workaround
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
JacobHarvey authored and dcrowell77 committed May 25, 2017
1 parent e912642 commit c5c7957
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/import/chips/p9/procedures/hwp/memory/lib/fir/check.C
Expand Up @@ -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>()
Expand Down
Expand Up @@ -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>

Expand Down Expand Up @@ -139,6 +141,33 @@ namespace workarounds
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
Expand Down Expand Up @@ -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) )
Expand All @@ -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",
Expand All @@ -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) );
Expand Down Expand Up @@ -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
Expand Up @@ -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
Expand Down Expand Up @@ -90,6 +91,13 @@ namespace workarounds
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
Expand Down

0 comments on commit c5c7957

Please sign in to comment.