Skip to content

Commit

Permalink
Update explorer CCS to handle A vs B side ranks
Browse files Browse the repository at this point in the history
Change-Id: I8065296dc0f366b7abdd1aa18a0ffb7135177145
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/93170
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@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://rchgit01.rchland.ibm.com/gerrit1/93452
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R Geddes <crgeddes@us.ibm.com>
  • Loading branch information
markypizz authored and crgeddes committed Mar 25, 2020
1 parent 9b6bd57 commit 50da7a4
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 17 deletions.
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -44,9 +44,6 @@ namespace mss
{
namespace ccs
{

// This file ties the two needed header files together

} // namespace ccs
} // namespace mss

Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -43,6 +43,7 @@
#include <generic/memory/lib/utils/shared/mss_generic_consts.H>
#include <generic/memory/lib/mss_generic_attribute_getters.H>
#include <generic/memory/lib/ccs/ccs_traits.H>
#include <exp_attribute_accessors_manual.H>

///
/// @class ccsTraits
Expand Down Expand Up @@ -229,6 +230,34 @@ class ccsTraits<mss::mc_type::EXPLORER>
{ 0b11, 0b10 },
};

///
/// @brief Get and perform CS tied operation if needed
///
/// @param[in] i_target PORT target type
/// @param[in] i_CS01 CS01
/// @param[in,out] io_CS23 CS23, to overwrite if tied
/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS iff success, else error code
///
static fapi2::ReturnCode cs_tied(
const fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT>& i_target,
const uint64_t i_CS01,
uint64_t& io_CS23)
{
bool l_cs_tied = false;
FAPI_TRY(mss::get_cs_tied(i_target, l_cs_tied));

if (l_cs_tied)
{
// Overwrite CS23 with CS01
io_CS23 = i_CS01;
}

// Else, not tied, and we leave them alone

fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Gets the attribute for checking our rank configuration
/// @param[in] i_target the port target on which to operate
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* Contributors Listed Below - COPYRIGHT 2018,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -40,7 +40,7 @@

#include <fapi2.H>
#include <mss_explorer_attribute_getters.H>

#include <mss_generic_attribute_getters.H>
#include <generic/memory/lib/utils/c_str.H>
#include <generic/memory/lib/utils/find.H>

Expand Down Expand Up @@ -189,6 +189,36 @@ fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Get whether the CS configuration should be tied (A0 == B0 A1 == B1)
///
/// @param[in] i_target MEM_PORT target
/// @param[in] o_cs_tied true/false whether CS configuration should be tied
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error code
///
inline fapi2::ReturnCode get_cs_tied(const fapi2::Target<fapi2::TARGET_TYPE_MEM_PORT>& i_target, bool& o_cs_tied)
{
o_cs_tied = false;

bool l_four_rank_mode = false;
bool l_dual_drop = false;

uint8_t l_ranks_per_dimm[2] = {};
uint8_t l_four_rank_mode_attr[2] = {};

FAPI_TRY(mss::attr::get_num_master_ranks_per_dimm(i_target, l_ranks_per_dimm));
l_dual_drop = (l_ranks_per_dimm[0] > 0 && l_ranks_per_dimm[1] > 0) ? true : false;

FAPI_TRY(mss::attr::get_four_rank_mode(i_target, l_four_rank_mode_attr));
l_four_rank_mode = (l_four_rank_mode_attr[0] == fapi2::ENUM_ATTR_MEM_EFF_FOUR_RANK_MODE_ENABLE);

// This logic mirrors the logic for def_cs_tied in explorer.scom.initfile
o_cs_tied = (!l_four_rank_mode && !l_dual_drop);

fapi_try_exit:
return fapi2::current_err;
}

} // ns mss

#endif
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019 */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -243,6 +243,22 @@ class ccsTraits<mss::mc_type::NIMBUS>
{ 0b11, 0b10 },
};

///
/// @brief Get and perform CS tied operation (NO-OP for Nimbus)
///
/// @param[in] i_target MCA target type
/// @param[in] i_CS01 CS01
/// @param[in,out] io_CS23 CS23, to overwrite if tied (NO-OP for Nimbus)
/// @return fapi2::FAPI2_RC_SUCCESS always
///
static fapi2::ReturnCode cs_tied(
const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target,
const uint64_t i_CS01,
uint64_t& io_CS23)
{
return fapi2::FAPI2_RC_SUCCESS;
}

///
/// @brief Gets the attribute for checking our rank configuration
/// @param[in] i_target the port target on which to operate
Expand Down
20 changes: 12 additions & 8 deletions src/import/generic/memory/lib/ccs/ccs.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019 */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -140,8 +140,9 @@ class instruction_t
/// @param[in] i_rank_config the rank configuration
/// @return fapi2::ReturnCode fapi2::FAPI2_RC_SUCCESS if ok
///
fapi2::ReturnCode configure_rank(const fapi2::Target<TT::PORT_TARGET_TYPE>& i_target,
const rank_configuration i_rank_config )
fapi2::ReturnCode configure_rank(
const fapi2::Target<TT::PORT_TARGET_TYPE>& i_target,
const rank_configuration i_rank_config )
{
// If this instrunction is set to not update the rank, then don't update the rank
if(!iv_update_rank)
Expand Down Expand Up @@ -182,8 +183,8 @@ class instruction_t
constexpr uint64_t NON_DIMM_CS = 0b11;

// Assigns the CS based upon which DIMM we're at
const auto CS01 = l_is_dimm0 ? TT::CS_N[l_dimm_rank].first : NON_DIMM_CS;
const auto CS23 = l_is_dimm0 ? NON_DIMM_CS : TT::CS_N[l_dimm_rank].first;
const uint64_t CS01 = l_is_dimm0 ? TT::CS_N[l_dimm_rank].first : NON_DIMM_CS;
const uint64_t CS23 = l_is_dimm0 ? NON_DIMM_CS : TT::CS_N[l_dimm_rank].first;

// Setup that rank
arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1,
Expand All @@ -201,8 +202,11 @@ class instruction_t
const bool l_is_dimm0 = iv_rank < TT::CCS_MAX_RANK_PER_DIMM;

// Assigns the CS based upon which DIMM we're at
const auto CS01 = l_is_dimm0 ? TT::CS_ND[l_dimm_rank].first : TT::CS_ND[l_dimm_rank].second;
const auto CS23 = l_is_dimm0 ? TT::CS_ND[l_dimm_rank].second : TT::CS_ND[l_dimm_rank].first;
const uint64_t CS01 = l_is_dimm0 ? TT::CS_ND[l_dimm_rank].first : TT::CS_ND[l_dimm_rank].second;
uint64_t CS23 = l_is_dimm0 ? TT::CS_ND[l_dimm_rank].second : TT::CS_ND[l_dimm_rank].first;

// Set CS23 <-- CS01 if CS needs to be tied
FAPI_TRY(TT::cs_tied(i_target, CS01, CS23));

// Setup that rank
arr0.insertFromRight<TT::ARR0_DDR_CSN_0_1,
Expand All @@ -215,7 +219,7 @@ class instruction_t
// 1) we are DIMM1
// 2) our DIMM rank is greater than the maximum allowed number of ranks on DIMM1
// So, we pass always if we're DIMM0, or if our DIMM rank is less than the maximum number of DIMM's on rank 1
FAPI_ASSERT(l_dimm_rank < TT::CCS_MAX_RANKS_DIMM1 || l_is_dimm0,
FAPI_ASSERT((l_dimm_rank < TT::CCS_MAX_RANKS_DIMM1) || l_is_dimm0,
fapi2::MSS_INVALID_RANK()
.set_PORT_TARGET(i_target)
.set_RANK(iv_rank)
Expand Down
3 changes: 2 additions & 1 deletion src/usr/isteps/istep12/makefile
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,2019
# Contributors Listed Below - COPYRIGHT 2015,2020
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -57,6 +57,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/obj/genfiles/
EXTRAINCDIR += ${ROOTPATH}/obj/genfiles/chips/ocmb/explorer/procedures/hwp/memory/lib/
EXTRAINCDIR += ${ROOTPATH}/obj/genfiles/generic/memory/lib/
EXTRAINCDIR += ${ROOTPATH}/src/usr/isteps/
EXTRAINCDIR += $(P9_PROCEDURES_PATH)/hwp/ffdc/
EXTRAINCDIR += $(P9_IO_HWP_PATH)
Expand Down

0 comments on commit 50da7a4

Please sign in to comment.