Skip to content

Commit

Permalink
Fixes LRDIM dual-drop 4R frequency/plug rules bugs
Browse files Browse the repository at this point in the history
Change-Id: Ibe1fd639b5812ffb1b7baa418dccb07f869a800b
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73512
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com>
Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com>
Dev-Ready: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73520
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
sglancy6 authored and crgeddes committed Apr 16, 2019
1 parent ffe6b03 commit 9826757
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ fapi2::ReturnCode check_rank_config(const fapi2::Target<TARGET_TYPE_MCA>& i_targ
l_dimm1_kind = &k;
}

l_rank_count += k.iv_master_ranks;
l_rank_count += k.iv_dimm_type == fapi2::ENUM_ATTR_EFF_DIMM_TYPE_LRDIMM ? 1 : k.iv_master_ranks;
}

// If we get here and we see there's no DIMM in slot 0, we did something very wrong. We shouldn't have
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,19 @@ fapi2::ReturnCode num_master_ranks_per_dimm<mss::proc_type::NIMBUS>(const fapi2:
return mss::eff_num_master_ranks_per_dimm(i_target, o_master_ranks);
}

///
/// @brief Gets the DIMM type for a specific DIMM - specialization for the NIMBUS processor type
/// @param[in] i_target DIMM target
/// @param[out] o_dimm_type DIMM type on the DIMM target
/// @return FAPI2_RC_SUCCESS iff ok
///
template<>
fapi2::ReturnCode get_dimm_type<mss::proc_type::NIMBUS>(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
uint8_t& o_dimm_type)
{
return mss::eff_dimm_type(i_target, o_dimm_type);
}

///
/// @brief Calls out the target if no DIMM frequencies are supported - specialization for NIMBUS and MCBIST
/// @param[in] i_target target on which to operate
Expand Down
22 changes: 20 additions & 2 deletions src/import/generic/memory/lib/utils/freq/mss_freq_scoreboard.H
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ template<mss::proc_type P>
fapi2::ReturnCode num_master_ranks_per_dimm(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
uint8_t& o_master_ranks);

///
/// @brief Gets the DIMM type for a specific DIMM
/// @tparam P mss::proc_type on which to operate
/// @param[in] i_target DIMM target
/// @param[out] o_dimm_type DIMM type on the DIMM target
/// @return FAPI2_RC_SUCCESS iff ok
///
template<mss::proc_type P>
fapi2::ReturnCode get_dimm_type(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
uint8_t& o_dimm_type);

///
/// @brief Gets the attribute for the maximum allowed dimm frequency
/// @tparam P mss::proc_type on which to operate
Expand Down Expand Up @@ -583,8 +594,11 @@ inline fapi2::ReturnCode limit_freq_by_mrw(const fapi2::Target<TT::FREQ_TARGET_T
for (const auto& d : l_dimms)
{
uint8_t l_num_master_ranks = 0;
uint8_t l_dimm_type = 0;
uint8_t l_rank_index = 0;
size_t l_index = 0xFF;
FAPI_TRY( num_master_ranks_per_dimm<P>(d, l_num_master_ranks) );
FAPI_TRY( get_dimm_type<P>(d, l_dimm_type));

// Just a quick check but we're in deep yogurt if this triggers
FAPI_ASSERT( (l_num_master_ranks <= TT::MAX_PRIMARY_RANK_PER_DIMM),
Expand All @@ -595,7 +609,11 @@ inline fapi2::ReturnCode limit_freq_by_mrw(const fapi2::Target<TT::FREQ_TARGET_T
l_dimms_on_port,
mss::c_str(d));

l_index = l_indexes[l_dimms_on_port - 1][l_num_master_ranks - 1];
// If we have an LRDIMM, it's treated as a one rank DIMM from the memory controller's perspective
l_rank_index = l_dimm_type == TT::LRDIMM_TYPE ? 0 : l_num_master_ranks - 1;
l_index = l_indexes[l_dimms_on_port - 1][l_rank_index];
FAPI_INF("%s is %s. rank_index%u index:%u", spd::c_str(d), l_dimm_type == TT::LRDIMM_TYPE ? "LRDIMM" : "RDIMM",
l_rank_index, l_index);

FAPI_ASSERT( (l_index < NUM_MAX_FREQS),
fapi2::MSS_FREQ_INDEX_TOO_LARGE()
Expand All @@ -609,7 +627,7 @@ inline fapi2::ReturnCode limit_freq_by_mrw(const fapi2::Target<TT::FREQ_TARGET_T

FAPI_INF("%s rank config %d drop %d yields max freq attribute index of %d (%d)",
mss::c_str(d), l_num_master_ranks, l_dimms_on_port,
l_indexes[l_dimms_on_port - 1][l_num_master_ranks - 1],
l_indexes[l_dimms_on_port - 1][l_rank_index],
i_max_mrw_freqs[l_index] );

l_port_max_freq = std::min(l_port_max_freq, i_max_mrw_freqs[l_index]);
Expand Down

0 comments on commit 9826757

Please sign in to comment.