Skip to content

Commit

Permalink
Updates MRS API issue b-side iff an RCD is present
Browse files Browse the repository at this point in the history
Explorer WR VREF shmoos were failing for a single supplier.
The b-side MRS6 commands were causing corruption on the DRAM.
Tthe fix was to not issue b-side MRS commands. B-side MRS commands
only need to be issued if an RCD is present.

Change-Id: I2c855be4f3e88e2daa44d9fb9628d3129ea087ae
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/96567
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Dev-Ready: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@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: Mark Pizzutillo <mark.pizzutillo@ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/96602
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
sglancy6 authored and dcrowell77 committed May 21, 2020
1 parent 239b11b commit d3e376b
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 17 deletions.
Expand Up @@ -50,6 +50,36 @@ namespace mss
namespace unmask
{

///
/// @brief Check if any dimms exist that have RCD enabled - explorer/DIMM specialization
/// @param[in] i_target - the fapi2::Target we are starting from
/// @param[out] o_has_rcd - true iff any DIMM with RCD detected
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
///
template<>
fapi2::ReturnCode has_rcd<mss::mc_type::EXPLORER>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
bool& o_has_rcd )
{
// Assume RCD is not supported at beginning of check
o_has_rcd = false;

uint8_t l_dimm_type = 0;
uint8_t l_rcd_supported = 0;

FAPI_TRY(mss::attr::get_dimm_type(i_target, l_dimm_type));
FAPI_TRY(mss::attr::get_supported_rcd(i_target, l_rcd_supported));

// OR with tmp_rcd to maintain running true/false if RCD on *any* DIMM
o_has_rcd |= ((l_dimm_type == fapi2::ENUM_ATTR_MEM_EFF_DIMM_TYPE_RDIMM) ||
(l_dimm_type == fapi2::ENUM_ATTR_MEM_EFF_DIMM_TYPE_LRDIMM));

o_has_rcd |= (l_rcd_supported == fapi2::ENUM_ATTR_MEM_EFF_SUPPORTED_RCD_RCD_PER_CHANNEL_1);

fapi_try_exit:

return fapi2::current_err;
}

///
/// @brief Check if any dimms exist that have RCD enabled - explorer/PORT specialization
/// @param[in] i_target - the fapi2::Target we are starting from
Expand All @@ -66,17 +96,9 @@ fapi2::ReturnCode has_rcd<mss::mc_type::EXPLORER>( const fapi2::Target<fapi2::TA
// Loop over all DIMM's and determine if we have an RCD
for(const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(i_target))
{
uint8_t l_dimm_type = 0;
uint8_t l_rcd_supported = 0;

FAPI_TRY(mss::attr::get_dimm_type(l_dimm, l_dimm_type));
FAPI_TRY(mss::attr::get_supported_rcd(l_dimm, l_rcd_supported));

// OR with tmp_rcd to maintain running true/false if RCD on *any* DIMM
o_has_rcd |= ((l_dimm_type == fapi2::ENUM_ATTR_MEM_EFF_DIMM_TYPE_RDIMM) ||
(l_dimm_type == fapi2::ENUM_ATTR_MEM_EFF_DIMM_TYPE_LRDIMM));

o_has_rcd |= (l_rcd_supported == fapi2::ENUM_ATTR_MEM_EFF_SUPPORTED_RCD_RCD_PER_CHANNEL_1);
bool l_current_dimm_rcd = false;
FAPI_TRY(has_rcd<mss::mc_type::EXPLORER>(l_dimm, l_current_dimm_rcd));
o_has_rcd |= l_current_dimm_rcd;
}

return fapi2::FAPI2_RC_SUCCESS;
Expand Down
28 changes: 27 additions & 1 deletion src/import/chips/p9/procedures/hwp/memory/lib/fir/unmask.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* Contributors Listed Below - COPYRIGHT 2016,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -54,6 +54,32 @@ namespace mss
namespace unmask
{

///
/// @brief Check if any dimms exist that have RCD enabled - nimbus/DIMM specialization
/// @param[in] i_target - the fapi2::Target we are starting from
/// @param[out] o_has_rcd - true iff any DIMM with RCD detected
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff ok
///
template<>
fapi2::ReturnCode has_rcd<mss::mc_type::NIMBUS>( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
bool& o_has_rcd )
{
// Assume RCD is not supported at beginning of check
o_has_rcd = false;

uint8_t l_dimm_type = 0;

FAPI_TRY(mss::eff_dimm_type(i_target, l_dimm_type));

// Set RCD if we have an RDIMM or LRDIMM type
o_has_rcd = ((l_dimm_type == fapi2::ENUM_ATTR_EFF_DIMM_TYPE_RDIMM) ||
(l_dimm_type == fapi2::ENUM_ATTR_EFF_DIMM_TYPE_LRDIMM));

fapi_try_exit:

return fapi2::current_err;
}

///
/// @brief Unmask and setup actions performed after draminit_mc
/// @param[in] i_target the fapi2::Target of the MCBIST
Expand Down
18 changes: 13 additions & 5 deletions src/import/generic/memory/lib/dimm/ddr4/mrs_load_ddr4.H
Expand Up @@ -44,6 +44,7 @@
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
#include <generic/memory/lib/ccs/ccs_traits.H>
#include <generic/memory/lib/ccs/ccs.H>
#include <generic/memory/lib/utils/fir/gen_mss_unmask.H>

namespace mss
{
Expand Down Expand Up @@ -243,6 +244,7 @@ fapi2::ReturnCode mrs_engine( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_ta
ccs::instruction_t l_inst_a_side = ccs::mrs_command(i_rank, i_data.iv_mrs);
ccs::instruction_t l_inst_b_side;
bool l_is_a17 = false;
bool l_has_rcd = false;

// Thou shalt send 2 MRS, one for the a-side and the other inverted for the b-side.
// If we're on an odd-rank then we need to mirror
Expand Down Expand Up @@ -275,12 +277,18 @@ fapi2::ReturnCode mrs_engine( const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_ta

FAPI_INF("MRS%02d (%d) 0x%016llx:0x%016llx %s:rank %d a-side", uint8_t(i_data.iv_mrs), i_delay_in_cycles,
l_inst_a_side.arr0, l_inst_a_side.arr1, mss::c_str(i_target), i_rank);
FAPI_INF("MRS%02d (%d) 0x%016llx:0x%016llx %s:rank %d b-side", uint8_t(i_data.iv_mrs), i_delay_in_cycles,
l_inst_b_side.arr0, l_inst_b_side.arr1, mss::c_str(i_target), i_rank);

// Add both to the CCS program
io_inst.push_back(l_inst_a_side);
io_inst.push_back(l_inst_b_side);


// Only issue b-side if we have an RCD
FAPI_TRY(mss::unmask::has_rcd<MC>( i_target, l_has_rcd ));

if(l_has_rcd)
{
FAPI_INF("MRS%02d (%d) 0x%016llx:0x%016llx %s:rank %d b-side", uint8_t(i_data.iv_mrs), i_delay_in_cycles,
l_inst_b_side.arr0, l_inst_b_side.arr1, mss::c_str(i_target), i_rank);
io_inst.push_back(l_inst_b_side);
}

fapi_try_exit:
return fapi2::current_err;
Expand Down

0 comments on commit d3e376b

Please sign in to comment.