Skip to content

Commit

Permalink
PRD: Update calloutMemoryMru function
Browse files Browse the repository at this point in the history
Change-Id: I5386e8b9d964ecadb4554261db8cec88a480b3f3
RTC: 168770
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36886
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37282
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
cnpalmer authored and zane131 committed Mar 2, 2017
1 parent 552f94f commit 490f862
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 190 deletions.
86 changes: 86 additions & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.C
Expand Up @@ -27,6 +27,7 @@

// Framework includes
#include <iipCaptureData.h>
#include <prdfErrlUtil.H>

// Platform includes
#include <prdfPlatServices.H>
Expand Down Expand Up @@ -100,6 +101,91 @@ void addEccData<TYPE_MBA>( ExtensibleChip * i_chip,

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

void addExtMemMruData( const MemoryMru & i_memMru, errlHndl_t io_errl )
{
#define PRDF_FUNC "[addExtMemMruData] "

MemoryMruData::ExtendedData extMemMru ( i_memMru.toUint32() );

do
{
int32_t l_rc = SUCCESS;

TargetHandle_t trgt = i_memMru.getTrgt();

// Get the DRAM width.
extMemMru.isX4Dram = isDramWidthX4( trgt ) ? 1 : 0;

// Get the DIMM type.
bool isBufDimm = false;
l_rc = isMembufOnDimm( trgt, isBufDimm );
if ( SUCCESS != l_rc )
{
PRDF_ERR( PRDF_FUNC "isMembufOnDimm() failed. Trgt:0x%08x",
getHuid(trgt) );
break;
}
extMemMru.isBufDimm = isBufDimm ? 1 : 0;

if ( isBufDimm )
{
// TODO RTC 169956
//// Get the raw card type (Centaur DIMMs only).
//CEN_SYMBOL::WiringType cardType = CEN_SYMBOL::WIRING_INVALID;
//l_rc = getMemBufRawCardType( trgt, cardType );
//if ( SUCCESS != l_rc )
//{
// PRDF_ERR( PRDF_FUNC "getMemBufRawCardType() failed. MBA:0x%08x",
// getHuid(trgt) );
// break;
//}
//extMemMru.cardType = cardType;
}
else
{
// Get the 80-byte DQ map (ISDIMMs only). This is only needed if the
// MemoryMru contains a single DIMM callout with a valid symbol.
if ( i_memMru.getSymbol().isValid() )
{
TargetHandleList partList = i_memMru.getCalloutList();
if ( 1 != partList.size() ||
TYPE_DIMM != getTargetType(partList[0]) )
{
PRDF_ERR( PRDF_FUNC "Symbol is valid but callout is not a "
"single DIMM." );
break;
}
getDimmDqAttr( trgt, extMemMru.dqMapping );
}
}

// If we reach this point, nothing failed and the data is valid.
extMemMru.isValid = 1;

}while(0);

size_t sz_buf = sizeof(extMemMru);
BitStringBuffer bsb( sz_buf*8 );
uint32_t curPos = 0;

bsb.setFieldJustify( curPos, 32, extMemMru.mmMeld.u ); curPos+=32;
bsb.setFieldJustify( curPos, 8, extMemMru.cardType ); curPos+= 8;
bsb.setFieldJustify( curPos, 1, extMemMru.isBufDimm ); curPos+= 1;
bsb.setFieldJustify( curPos, 1, extMemMru.isX4Dram ); curPos+= 1;
bsb.setFieldJustify( curPos, 1, extMemMru.isValid ); curPos+= 1;

BitString bs( sizeof(extMemMru.dqMapping)*8,
(CPU_WORD *)extMemMru.dqMapping );
bsb.setString( bs, 0, bs.getBitLen(), curPos );

// Add the extended MemoryMru to the error log.
PRDF_ADD_FFDC( io_errl, bsb.getBufAddr(), sz_buf, ErrlVer1, ErrlMruData );

#undef PRDF_FUNC
}

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

} //end namespace MemCaptureData

} // end namespace PRDF
Expand Down
14 changes: 11 additions & 3 deletions src/usr/diag/prdf/common/plat/mem/prdfMemCaptureData.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -37,12 +37,20 @@ namespace MemCaptureData

/**
* @brief Adds memory ECC FFDC to an SDC.
* @param i_mbaChip MCBIST, MCA, or MBA.
* @param io_sc Step code data struct.
* @param i_chip MCBIST, MCA, or MBA.
* @param io_sc Step code data struct.
*/
template<TARGETING::TYPE T>
void addEccData( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc );

/**
* @brief Adds a new user data section to the error log containing a MemoryMru
* plus extended data for extra FFDC.
* @param i_memMru The memory mru
* @param io_errl Target error log.
*/
void addExtMemMruData( const MemoryMru & i_memMru, errlHndl_t io_errl );

} // end namespace MemCaptureData

} // end namespace PRDF
Expand Down
39 changes: 19 additions & 20 deletions src/usr/diag/prdf/common/plat/prdfPlatServices_common.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -735,33 +735,32 @@ int32_t getDimmSpareConfig( TargetHandle_t i_mba, CenRank i_rank,
*/

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

/* TODO RTC
errlHndl_t getFapiDimmDqAttr( TargetHandle_t i_target,
uint8_t *io_dqMapPtr )
void getDimmDqAttr( TargetHandle_t i_target,
uint8_t (&o_dqMapPtr)[DQS_PER_DIMM] )
{
uint8_t (&l_wiringData)[DIMM_DQ_NUM_DQS] =
*(reinterpret_cast<uint8_t(*)[DIMM_DQ_NUM_DQS]>(io_dqMapPtr));
#define PRDF_FUNC "[PlatServices::getDimmDqAttr] "

// We have a DIMM target to get the DQ map for
// (need FAPI target from normal HWSV target)
fapi::Target l_fapiDimm = getFapiTarget(i_target);
PRDF_ASSERT( TYPE_MCA == getTargetType(i_target) );

// Read the attribute
// (suppose to return a 1:1 mapping for Centaur DIMMs)
fapi::ReturnCode l_fapiRc;
l_fapiRc = FAPI_ATTR_GET(ATTR_CEN_DQ_TO_DIMM_CONN_DQ,
&l_fapiDimm, l_wiringData );
TargetHandle_t mcs = getConnectedParent( i_target, TYPE_MCS );

errlHndl_t l_fapiElog = fapi::fapiRcToErrl(l_fapiRc);
uint32_t mcaRelMcs = getTargetPosition( i_target ) % MAX_MCA_PER_MCS;
uint8_t tmpData[MAX_MCA_PER_MCS][DQS_PER_DIMM];

return(l_fapiElog);
} // end function getFapiDimmDqAttr
*/
if ( !mcs->tryGetAttr<ATTR_MSS_VPD_DQ_MAP>(tmpData) )
{
PRDF_ERR( PRDF_FUNC "Failed to get ATTR_MSS_VPD_DQ_MAP" );
PRDF_ASSERT( false );
}

memcpy( &o_dqMapPtr[0], &tmpData[mcaRelMcs][0], DQS_PER_DIMM );

#undef PRDF_FUNC
} // end function getDimmDqAttr

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

/* TODO RTC
/* TODO RTC 169956
int32_t getMemBufRawCardType( TargetHandle_t i_mba,
WiringType & o_cardType )
{
Expand Down
10 changes: 4 additions & 6 deletions src/usr/diag/prdf/common/plat/prdfPlatServices_common.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -359,7 +359,7 @@ int32_t getDimmSpareConfig( TARGETING::TargetHandle_t i_mba, CenRank i_rank,
* the raw card type currently is not supported.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
/* TODO RTC 136126
/* TODO RTC 169956
int32_t getMemBufRawCardType( TARGETING::TargetHandle_t i_mbaTarget,
CEN_SYMBOL::WiringType & o_wiringType );
*/
Expand All @@ -370,10 +370,8 @@ int32_t getMemBufRawCardType( TARGETING::TargetHandle_t i_mbaTarget,
* @param io_dqMapPtr Pointer to area to receive DIMM DQ map (80 bytes)
* @return Non-Null if error log occurs
*/
/* TODO RTC 136126
errlHndl_t getFapiDimmDqAttr( TARGETING::TargetHandle_t i_target,
uint8_t *io_dqMapPtr );
*/
void getDimmDqAttr( TARGETING::TargetHandle_t i_target,
uint8_t (&io_dqMapPtr)[DQS_PER_DIMM] );

//##############################################################################
//## Maintenance Command class wrapper
Expand Down
23 changes: 13 additions & 10 deletions src/usr/diag/prdf/common/plugins/prdfLogParse_common.C
Expand Up @@ -52,6 +52,7 @@
//#include <prdfProcLogParse.H> TODO: RTC 136050
#include <prdfParserEnums.H>
#include <prdfMemoryMruData.H>
#include <prdfBitString.H>

#include <hwas/common/hwasCallout.H>

Expand Down Expand Up @@ -764,20 +765,22 @@ bool parseExtMemMru( void * i_buffer, uint32_t i_buflen,
}
else
{
uint8_t * buf = (uint8_t *)i_buffer;

MemoryMruData::ExtendedData extMemMru;

extMemMru.mmMeld.u = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
BitString bs( (i_buflen*8), (CPU_WORD*)i_buffer );
uint32_t curPos = 0;

extMemMru.cardType = buf[4];
MemoryMruData::ExtendedData extMemMru;

extMemMru.isBufDimm = (buf[5] >> 7) & 0x1;
extMemMru.isX4Dram = (buf[5] >> 6) & 0x1;
extMemMru.isValid = (buf[5] >> 5) & 0x1;
extMemMru.mmMeld.u = bs.getFieldJustify( curPos, 32 ); curPos+=32;
extMemMru.cardType = bs.getFieldJustify( curPos, 8 ); curPos+= 8;
extMemMru.isBufDimm = bs.getFieldJustify( curPos, 1 ); curPos+= 1;
extMemMru.isX4Dram = bs.getFieldJustify( curPos, 1 ); curPos+= 1;
extMemMru.isValid = bs.getFieldJustify( curPos, 1 ); curPos+= 1;

memcpy( &extMemMru.dqMapping[0], &buf[8],
sizeof(extMemMru.dqMapping) );
for ( uint32_t i = 0; i < sizeof(extMemMru.dqMapping); i++ )
{
extMemMru.dqMapping[i] = bs.getFieldJustify( curPos+(i*8), 8 );
}

char heading[72];
snprintf( heading, 72, "Extended MemoryMru (0x%08x)",
Expand Down
6 changes: 3 additions & 3 deletions src/usr/diag/prdf/common/plugins/prdfMemoryMruData.H
Expand Up @@ -141,9 +141,9 @@ struct ExtendedData
///< 0=otherwise. Needed just in case there
///< was a failure to gather extended data.
uint32_t reserved :21; ///< Future use / nice boundary
uint8_t dqMapping[80]; ///< Centaur DQ to DIMM DQ mapping (only used
///< when the MemoryMru contains a single
///< IS DIMM callout).
uint8_t dqMapping[DQS_PER_DIMM]; ///< Centaur DQ to DIMM DQ mapping
///< (only used when the MemoryMru
///< contains a single IS DIMM callout).

/** Default contructor */
ExtendedData() :
Expand Down
20 changes: 12 additions & 8 deletions src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C
Expand Up @@ -36,14 +36,14 @@
#include <prdfPfa5Data.h>
#include <prdf_service_codes.H>

// Pegasus includes
// Mem includes
#include <prdfP9McaExtraSig.H>
#include <prdfMemIplCeStats.H>
#include <prdfParserUtils.H>
#include <prdfMemThresholds.H>
#include <prdfMemUtils.H>
#include <prdfMemoryMru.H>
//#include <prdfPlatCalloutUtil.H>
#include <prdfMemCaptureData.H>

using namespace TARGETING;

Expand Down Expand Up @@ -460,12 +460,16 @@ template<TYPE T>
void MemIplCeStats<T>::addMruAndCommitErrl( const MemoryMru & i_memmru,
errlHndl_t i_errl )
{
// Add MemoryMru callouts and FFDC
//TODO RTC 168770
//CalloutUtil::calloutMemoryMru( i_errl, i_memmru,
// SRCI_PRIORITY_HIGH,
// HWAS::DELAYED_DECONFIG,
// HWAS::GARD_Predictive );
// Add all parts to the error log.
TargetHandleList partList = i_memmru.getCalloutList();
for ( auto &it : partList )
{
i_errl->addHwCallout( it, SRCI_PRIORITY_HIGH, HWAS::DELAYED_DECONFIG,
HWAS::GARD_Predictive );
}

// Add the MemoryMru to the capture data.
MemCaptureData::addExtMemMruData( i_memmru, i_errl );

// Add traces
i_errl->collectTrace( PRDF_COMP_NAME, 512 );
Expand Down
19 changes: 12 additions & 7 deletions src/usr/diag/prdf/plat/pegasus/prdfDramRepairs.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -40,7 +40,6 @@
#include "common/plat/pegasus/prdfCenSymbol.H"
#include "common/plat/pegasus/prdfMemoryMru.H"
#include "framework/service/prdfPlatServices.H"
#include "plat/pegasus/prdfPlatCalloutUtil.H"

using namespace HWAS;
using namespace std;
Expand Down Expand Up @@ -188,11 +187,17 @@ bool processRepairedRanks( TargetHandle_t i_mba, uint8_t i_repairedRankMask )
{
if ( !it->isValid() ) continue;

CalloutUtil::calloutMemoryMru( errl,
MemoryMru(i_mba, rank, *it),
SRCI_PRIORITY_HIGH,
HWAS::DELAYED_DECONFIG,
HWAS::GARD_Predictive );
// Add all parts to the error log.
TargetHandleList partList = i_memmru.getCalloutList();
for ( auto &part : partList )
{
errl->addHwCallout( part, SRCI_PRIORITY_HIGH,
HWAS::DELAYED_DECONFIG,
HWAS::GARD_Predictive );
}

// Add the MemoryMru to the capture data.
MemCaptureData::addExtMemMruData( i_memmru, errl );
}

o_calloutMade = true;
Expand Down

0 comments on commit 490f862

Please sign in to comment.