Skip to content

Commit

Permalink
DRAM sparing support functions
Browse files Browse the repository at this point in the history
Updated mssGetSteerMux()/mssSetSteerMux() and getDimmSpareConfig()

Change-Id: Ic4883a35b9994aef4f5accc06c24e26c9441b354
RTC:189221
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59201
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60135
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
  • Loading branch information
mderkse1 authored and zane131 committed Jun 9, 2018
1 parent cecaeb3 commit e38d6b0
Show file tree
Hide file tree
Showing 6 changed files with 218 additions and 178 deletions.
140 changes: 8 additions & 132 deletions src/usr/diag/prdf/common/plat/prdfPlatServices_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,9 @@ int32_t setBadDqBitmap<DIMMS_PER_RANK::MBA>(
const MemDqBitmap<DIMMS_PER_RANK::MBA> & i_bitmap );

//------------------------------------------------------------------------------

/* TODO RTC 157888
int32_t mssGetMarkStore( TargetHandle_t i_mba, const CenRank & i_rank,
CenMark & o_mark )
/*
int32_t mssGetMarkStore( TargetHandle_t i_mba, const MemRank & i_rank,
MemMark & o_mark )
{
#define PRDF_FUNC "[PlatServices::mssGetMarkStore] "
Expand All @@ -397,7 +396,8 @@ int32_t mssGetMarkStore( TargetHandle_t i_mba, const CenRank & i_rank,
{
errlHndl_t errl = NULL;
uint8_t symbolMark, chipMark;
FAPI_INVOKE_HWP( errl, mss_get_mark_store, getFapiTarget(i_mba),
fapi2::Target<fapi2::TARGET_TYPE_MBA> fapiMba(i_mba);
FAPI_INVOKE_HWP( errl, mss_get_mark_store, fapiMba,
i_rank.getMaster(), symbolMark, chipMark );
if ( NULL != errl )
Expand All @@ -408,11 +408,11 @@ int32_t mssGetMarkStore( TargetHandle_t i_mba, const CenRank & i_rank,
o_rc = FAIL; break;
}
CenSymbol sm = CenSymbol::fromSymbol( i_mba, i_rank, symbolMark );
CenSymbol cm = CenSymbol::fromSymbol( i_mba, i_rank, chipMark );
MemSymbol sm = MemSymbol::fromSymbol( i_mba, i_rank, symbolMark );
MemSymbol cm = MemSymbol::fromSymbol( i_mba, i_rank, chipMark );
// Check if the chip or symbol mark are on any of the spares.
CenSymbol sp0, sp1, ecc;
MemSymbol sp0, sp1, ecc;
o_rc = mssGetSteerMux( i_mba, i_rank, sp0, sp1, ecc );
if ( SUCCESS != o_rc )
{
Expand Down Expand Up @@ -508,130 +508,6 @@ int32_t mssSetMarkStore( TargetHandle_t i_mba, const CenRank & i_rank,
}
*/

//------------------------------------------------------------------------------

/* TODO RTC 157888
int32_t mssGetSteerMux( TargetHandle_t i_mba, const CenRank & i_rank,
CenSymbol & o_port0Spare, CenSymbol & o_port1Spare,
CenSymbol & o_eccSpare )
{
int32_t o_rc = SUCCESS;
errlHndl_t errl = NULL;
uint8_t port0Spare, port1Spare, eccSpare;
FAPI_INVOKE_HWP( errl, mss_check_steering, getFapiTarget(i_mba),
i_rank.getMaster(), port0Spare, port1Spare, eccSpare );
if ( NULL != errl )
{
PRDF_ERR( "[PlatServices::mssGetSteerMux] mss_check_steering() "
"failed. HUID: 0x%08x rank: %d",
getHuid(i_mba), i_rank.getMaster() );
PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
o_rc = FAIL;
}
else
{
o_port0Spare = CenSymbol::fromSymbol( i_mba, i_rank, port0Spare );
o_port1Spare = CenSymbol::fromSymbol( i_mba, i_rank, port1Spare );
o_eccSpare = CenSymbol::fromSymbol( i_mba, i_rank, eccSpare );
}
return o_rc;
}
*/

//------------------------------------------------------------------------------

/* TODO RTC 157888
int32_t mssSetSteerMux( TargetHandle_t i_mba, const CenRank & i_rank,
const CenSymbol & i_symbol, bool i_x4EccSpare )
{
int32_t o_rc = SUCCESS;
errlHndl_t errl = NULL;
FAPI_INVOKE_HWP( errl, mss_do_steering, getFapiTarget(i_mba),
i_rank.getMaster(), i_symbol.getDramSymbol(),
i_x4EccSpare );
if ( NULL != errl )
{
PRDF_ERR( "[PlatServices::mssSetSteerMux] mss_do_steering "
"failed. HUID: 0x%08x rank: %d symbol: %d eccSpare: %c",
getHuid(i_mba), i_rank.getMaster(), i_symbol.getSymbol(),
i_x4EccSpare ? 'T' : 'F' );
PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
o_rc = FAIL;
}
return o_rc;
}
*/

//------------------------------------------------------------------------------

/* TODO RTC
int32_t getDimmSpareConfig( TargetHandle_t i_mba, CenRank i_rank,
uint8_t i_ps, uint8_t & o_spareConfig )
{
#define PRDF_FUNC "[PlatServices::getDimmSpareConfig] "
int32_t o_rc = SUCCESS;
using namespace fapi;
ATTR_VPD_DIMM_SPARE_Type attr;
o_spareConfig = ENUM_ATTR_VPD_DIMM_SPARE_NO_SPARE;
do
{
if( TYPE_MBA != getTargetType( i_mba ) )
{
PRDF_ERR( PRDF_FUNC "Invalid Target:0x%08X", getHuid( i_mba ) );
o_rc = FAIL; break;
}
if ( MAX_PORT_PER_MBA <= i_ps )
{
PRDF_ERR( PRDF_FUNC "Invalid parameters i_ps:%u", i_ps );
o_rc = FAIL; break;
}
fapi::Target fapiMba = getFapiTarget(i_mba);
ReturnCode l_rc = FAPI_ATTR_GET( ATTR_VPD_DIMM_SPARE, &fapiMba, attr );
errlHndl_t errl = fapi::fapiRcToErrl(l_rc);
if ( NULL != errl )
{
PRDF_ERR( PRDF_FUNC "Failed to get ATTR_VPD_DIMM_SPARE for Target:"
"0x%08X", getHuid( i_mba ) );
PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT );
o_rc = FAIL; break;
}
o_spareConfig = attr[i_ps][i_rank.getDimmSlct()][i_rank.getRankSlct()];
// Check for valid values
// For X4 DRAM, we can not have full byte as spare config. Also for X8
// DRAM we can not have nibble as spare.
if( ENUM_ATTR_VPD_DIMM_SPARE_NO_SPARE == o_spareConfig) break;
bool isFullByte = ( ENUM_ATTR_VPD_DIMM_SPARE_FULL_BYTE ==
o_spareConfig );
bool isX4Dram = isDramWidthX4(i_mba);
if ( ( isX4Dram && isFullByte ) || ( !isX4Dram && !isFullByte ) )
{
PRDF_ERR( PRDF_FUNC "Invalid Configuration: o_spareConfig:%u",
o_spareConfig );
o_rc = FAIL; break;
}
}while(0);
return o_rc;
#undef PRDF_FUNC
}
*/

//------------------------------------------------------------------------------
template<>
Expand Down
45 changes: 1 addition & 44 deletions src/usr/diag/prdf/common/plat/prdfPlatServices_common.H
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ int32_t setBadDqBitmap( TARGETING::TargetHandle_t i_trgt,
* @param o_mark The returned mark.
* @return Non-SUCCESS in internal function fails, SUCCESS otherwise.
*/
/* TODO RTC 157888
/*
int32_t mssGetMarkStore( TARGETING::TargetHandle_t i_mba,
const CenRank & i_rank, CenMark & o_mark );
*/
Expand Down Expand Up @@ -264,50 +264,7 @@ int32_t mssSetMarkStore( TARGETING::TargetHandle_t i_mba,
bool i_allowWriteBlocked = false );
*/

/**
* @brief Invokes the get steer mux hardware procedure.
* @param i_mba Target MBA.
* @param i_rank Target rank.
* @param o_port0Spare A symbol associated with the spare on port 0.
* @param o_port1Spare A symbol associated with the spare on port 1.
* @param o_eccSpare A symbol associated with the ECC spare (x4 mode only).
* @return Non-SUCCESS in internal function fails, SUCCESS otherwise.
*/
/* TODO RTC 157888
int32_t mssGetSteerMux( TARGETING::TargetHandle_t i_mba, const CenRank & i_rank,
CenSymbol & o_port0Spare, CenSymbol & o_port1Spare,
CenSymbol & o_eccSpare );
*/

/**
* @brief Invokes the set steer mux hardware procedure.
* @param i_mba Target MBA.
* @param i_rank Target rank.
* @param i_symbol A symbol associated with the DRAM to be spared.
* @param i_x4EccSpare If true, will set ECC spare instead (x4 mode only).
* @note The procedure will be able to derive the port from the given symbol.
* @return Non-SUCCESS in internal function fails, SUCCESS otherwise.
*/
/* TODO RTC 157888
int32_t mssSetSteerMux( TARGETING::TargetHandle_t i_mba, const CenRank & i_rank,
const CenSymbol & i_symbol, bool i_x4EccSpare );
*/

/**
* @brief Get spare DRAM information on a DIMM.
* @param i_mba MBA target.
* @param i_rank Rank.
* @param i_ps MBA port select.
* @param o_spareConfig Spare DRAM config information.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
* @note On a DIMM its possible that spare is not present. Also on X4 DRAM
* spare can be on High nibble or low nibble. This function will
* populate spare config information in o_spareConfig.
*/
/* TODO RTC 157888
int32_t getDimmSpareConfig( TARGETING::TargetHandle_t i_mba, CenRank i_rank,
uint8_t i_ps, uint8_t & o_spareConfig );
*/

/**
* @brief Returns the raw card type of a buffered DIMM.
Expand Down
24 changes: 23 additions & 1 deletion src/usr/diag/prdf/common/plugins/prdfParserUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -256,6 +256,28 @@ uint8_t symbol2Byte<TARGETING::TYPE_MCA>( uint8_t i_symbol )
: MCA_BYTES_PER_RANK;
}


/**
* @brief Find the first symbol of the given DRAM index
* @param i_dram The Dram
* @param i_isX4Dram TRUE if DRAM is x4
* @return The Symbol
*/
template<>
uint8_t dram2Symbol<TARGETING::TYPE_MBA>( uint8_t i_dram, bool i_isX4Dram )
{
const uint8_t dramsPerRank = i_isX4Dram ? MBA_NIBBLES_PER_RANK
: MBA_BYTES_PER_RANK;

const uint8_t symbolsPerDram = i_isX4Dram ? MBA_SYMBOLS_PER_NIBBLE
: MBA_SYMBOLS_PER_BYTE;

return (dramsPerRank > i_dram) ? (i_dram * symbolsPerDram)
: SYMBOLS_PER_RANK;
}



} // namespace PARSERUTILS

#if defined(PRDF_HOSTBOOT_ERRL_PLUGIN) || defined(PRDF_FSP_ERRL_PLUGIN)
Expand Down
11 changes: 10 additions & 1 deletion src/usr/diag/prdf/common/plugins/prdfParserUtils.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -110,6 +110,15 @@ uint8_t symbol2Nibble( uint8_t i_symbol );
template<TARGETING::TYPE T>
uint8_t symbol2Byte( uint8_t i_symbol );

/**
* @brief Find the first symbol of the given DRAM index
* @param i_dram The Dram
* @param i_isX4Dram TRUE if DRAM is x4
* @return The Symbol
*/
template<TARGETING::TYPE T>
uint8_t dram2Symbol( uint8_t i_dram, bool i_isX4Dram );

} // namespace PARSERUTILS

#if defined(PRDF_HOSTBOOT_ERRL_PLUGIN) || defined(PRDF_FSP_ERRL_PLUGIN)
Expand Down

0 comments on commit e38d6b0

Please sign in to comment.