Skip to content

Commit

Permalink
PRD: Update parser for DRAM repairs
Browse files Browse the repository at this point in the history
Change-Id: I421cd1b1ba5b5e8eecb3e98aae9cc16458282daf
RTC: 176880
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43057
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@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/43357
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
cnpalmer authored and zane131 committed Jul 20, 2017
1 parent 93de0bf commit e43ee27
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 36 deletions.
12 changes: 6 additions & 6 deletions src/usr/diag/prdf/common/plugins/prdfDramRepairUsrData.H
Expand Up @@ -45,7 +45,7 @@ namespace FSP
{
#endif

/* @brief Represent the header information for DRAM Repair data of a MBA
/* @brief Represent the header information for DRAM Repair data
*/
struct DramRepairDataHdr
{
Expand Down Expand Up @@ -151,19 +151,19 @@ struct DramRepairRankData

/** @brief Represent DRAM Repair data of a MBA
*/
struct DramRepairMbaData
struct DramRepairUsrData
{
DramRepairDataHdr header;
std::vector<DramRepairRankData> rankDataList;

/**
* @brief append DramRepairMbaData to UtilStream buffer
* @brief append DramRepairUsrData to UtilStream buffer
* @param i_left UtilStream object
* @param i_right DRAM Repair Mba data object
* @return Upddated Utilstream object
*/
friend UtilStream& operator<<( UtilStream& i_left,
DramRepairMbaData& i_right )
DramRepairUsrData& i_right )
{
i_left << i_right.header;

Expand All @@ -175,13 +175,13 @@ struct DramRepairMbaData
}

/**
* @brief Retrieve DramRepairMbaData from UtilStream buffer
* @brief Retrieve DramRepairUsrData from UtilStream buffer
* @param i_left UtilStream object
* @param i_right DRAM Repair rank data object
* @return Upddated Utilstream object
*/
friend UtilStream& operator>>( UtilStream& i_left,
DramRepairMbaData& i_right)
DramRepairUsrData& i_right)
{
//Retrieve Header
i_left >> i_right.header;
Expand Down
8 changes: 4 additions & 4 deletions src/usr/diag/prdf/common/plugins/prdfLogParse_common.C
Expand Up @@ -433,20 +433,20 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen,
parseMemRceTable( sigData, sigDataSize, i_parser );
}
*/
/* TODO: RTC 164707
else if ( Util::hashString("DRAM_REPAIRS_DATA") == sigId )
{
parseDramRepairsData( sigData, sigDataSize, i_parser );
}
else if ( Util::hashString("DRAM_REPAIRS_VPD") == sigId )
{
parseDramRepairsVpd( sigData, sigDataSize, i_parser );
parseDramRepairsVpd( sigData, sigDataSize, i_parser,
l_targetType );
}
else if ( Util::hashString("BAD_DQ_BITMAP") == sigId )
{
parseBadDqBitmap( sigData, sigDataSize, i_parser );
parseBadDqBitmap( sigData, sigDataSize, i_parser,
l_targetType );
}
*/
else if ( (Util::hashString(TD_CTLR_DATA::START) == sigId) ||
(Util::hashString(TD_CTLR_DATA::END) == sigId) )
{
Expand Down
54 changes: 30 additions & 24 deletions src/usr/diag/prdf/common/plugins/prdfMemLogParse.C
Expand Up @@ -38,7 +38,6 @@
#include <prdfDramRepairUsrData.H>
#include <prdfParserEnums.H>
#include <prdfParserUtils.H>
#include <attributeenums.H> // For TARGETING::TYPE enum

namespace PRDF
{
Expand Down Expand Up @@ -2774,7 +2773,6 @@ uint8_t dqSiteIdx2DramSiteIdx( uint8_t i_dqSiteIdx, bool i_isX4Dram )
// Helper functions
//------------------------------------------------------------------------------

/* TODO RTC 164707
// Displays symbol value. If symbol is not valid, will display '--' in output.
void getDramRepairSymbolStr( uint8_t i_value, char * o_str, uint32_t i_strSize )
{
Expand All @@ -2789,14 +2787,23 @@ void getDramRepairSymbolStr( uint8_t i_value, char * o_str, uint32_t i_strSize )
}

// Gets the string representation for a single bad DQ bitmap entry.
void getBadDqBitmapEntry( uint8_t * i_buffer, char * o_str )
void getBadDqBitmapEntry( uint8_t * i_buffer, char * o_str, TYPE i_type )
{
UtilMem membuf( i_buffer, DQ_BITMAP::ENTRY_SIZE );
uint8_t dimmsPerRank = MCA_DIMMS_PER_RANK;
uint32_t entrySize = DQ_BITMAP::MCA_ENTRY_SIZE;

if ( TYPE_MBA == i_type )
{
dimmsPerRank = MBA_DIMMS_PER_RANK;
entrySize = DQ_BITMAP::MBA_ENTRY_SIZE;
}

UtilMem membuf( i_buffer, entrySize );

uint8_t rank; membuf >> rank;
snprintf( o_str, DATA_SIZE, "R:%1d", rank );

for ( int32_t p = 0; p < MBA_DIMMS_PER_RANK; p++ )
for ( int32_t p = 0; p < dimmsPerRank; p++ )
{
char temp[DATA_SIZE];

Expand All @@ -2810,7 +2817,6 @@ void getBadDqBitmapEntry( uint8_t * i_buffer, char * o_str )
}
}
}
*/

//------------------------------------------------------------------------------
// Function definitions
Expand Down Expand Up @@ -3234,7 +3240,6 @@ bool parseMemRceTable( uint8_t * i_buffer, uint32_t i_buflen,

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

/* TODO RTC 164707
bool parseDramRepairsData( uint8_t * i_buffer, uint32_t i_buflen,
ErrlUsrParser & i_parser )
{
Expand All @@ -3244,10 +3249,10 @@ bool parseDramRepairsData( uint8_t * i_buffer, uint32_t i_buflen,
{
UtilMem l_membuf( i_buffer, i_buflen );

DramRepairMbaData mbaData;
l_membuf >> mbaData;
DramRepairUsrData usrData;
l_membuf >> usrData;

uint8_t rankCount = mbaData.header.rankCount;
uint8_t rankCount = usrData.header.rankCount;

i_parser.PrintNumber( " DRAM_REPAIRS_DATA", "%d", rankCount );

Expand All @@ -3258,7 +3263,7 @@ bool parseDramRepairsData( uint8_t * i_buffer, uint32_t i_buflen,
char temp[64];
char symbolStr[10];

DramRepairRankData rankEntry = mbaData.rankDataList[rankIdx];
DramRepairRankData rankEntry = usrData.rankDataList[rankIdx];
snprintf(temp, 64, "Rank: %d", rankEntry.rank);
snprintf(data, 64, temp);

Expand All @@ -3271,7 +3276,7 @@ bool parseDramRepairsData( uint8_t * i_buffer, uint32_t i_buflen,
snprintf(data, 64, temp);

// Display DRAM spare information if spare DRAM is supported.
if ( mbaData.header.isSpareDram )
if ( usrData.header.isSpareDram )
{
getDramRepairSymbolStr(rankEntry.port0Spare, symbolStr, 10);
snprintf(temp, 64, "%s Sp0: %s", data, symbolStr);
Expand All @@ -3283,7 +3288,7 @@ bool parseDramRepairsData( uint8_t * i_buffer, uint32_t i_buflen,
}

// Display ECC spare information for X4 DRAMs
if ( mbaData.header.isX4Dram )
if ( usrData.header.isX4Dram )
{
getDramRepairSymbolStr( rankEntry.eccSpare, symbolStr, 10 );
snprintf(temp, 64, "%s EccSp: %s", data, symbolStr);
Expand All @@ -3300,60 +3305,61 @@ bool parseDramRepairsData( uint8_t * i_buffer, uint32_t i_buflen,

return rc;
}
*/

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

/* TODO RTC 164707
bool parseDramRepairsVpd( uint8_t * i_buffer, uint32_t i_buflen,
ErrlUsrParser & i_parser )
ErrlUsrParser & i_parser, TARGETING::TYPE i_type )
{
bool rc = true;

if ( NULL == i_buffer ) return false; // Something failed in parser.

const uint32_t entries = i_buflen / DQ_BITMAP::ENTRY_SIZE;
uint32_t entrySize = DQ_BITMAP::MCA_ENTRY_SIZE;
if ( TYPE_MBA == i_type ) entrySize = DQ_BITMAP::MBA_ENTRY_SIZE;

const uint32_t entries = i_buflen / entrySize;

i_parser.PrintNumber( " DRAM_REPAIRS_VPD", "%d", entries );

for ( uint32_t i = 0; i < entries; i++ )
{
char data[DATA_SIZE];
getBadDqBitmapEntry( &i_buffer[i*DQ_BITMAP::ENTRY_SIZE], data );
getBadDqBitmapEntry( &i_buffer[i*entrySize], data, i_type );

i_parser.PrintString( "", data );
}

return rc;
}
*/

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

/* TODO RTC 164707
bool parseBadDqBitmap( uint8_t * i_buffer, uint32_t i_buflen,
ErrlUsrParser & i_parser )
ErrlUsrParser & i_parser, TARGETING::TYPE i_type )
{
bool rc = true;

if ( NULL == i_buffer ) return false; // Something failed in parser.

if ( DQ_BITMAP::ENTRY_SIZE > i_buflen ) // Data is expected to be one entry.
uint32_t entrySize = DQ_BITMAP::MCA_ENTRY_SIZE;
if ( TYPE_MBA == i_type ) entrySize = DQ_BITMAP::MBA_ENTRY_SIZE;

if ( entrySize > i_buflen ) // Data is expected to be one entry.
{
i_parser.PrintString( " BAD_DQ_BITMAP", "" );
i_parser.PrintHexDump(i_buffer, i_buflen);
}
else
{
char data[DATA_SIZE];
getBadDqBitmapEntry( i_buffer, data );
getBadDqBitmapEntry( i_buffer, data, i_type );

i_parser.PrintString( " BAD_DQ_BITMAP", data );
}

return rc;
}
*/

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

Expand Down
7 changes: 5 additions & 2 deletions src/usr/diag/prdf/common/plugins/prdfMemLogParse.H
Expand Up @@ -32,6 +32,7 @@

#include <stdint.h>
#include <prdfMemoryMruData.H>
#include <attributeenums.H> // For TARGETING::TYPE enum

class ErrlUsrParser;

Expand Down Expand Up @@ -110,18 +111,20 @@ bool parseDramRepairsData( uint8_t * i_buffer, uint32_t i_buflen,
* @param i_buffer The data buffer.
* @param i_buflen The buffer length.
* @param i_parser The error log parser.
* @param i_type The target type
*/
bool parseDramRepairsVpd( uint8_t * i_buffer, uint32_t i_buflen,
ErrlUsrParser & i_parser );
ErrlUsrParser & i_parser, TARGETING::TYPE i_type );

/**
* @brief Parses Bad DQ Bitmap data (Used in IPL UE isolation).
* @param i_buffer The data buffer.
* @param i_buflen The buffer length.
* @param i_parser The error log parser.
* @param i_type The target type
*/
bool parseBadDqBitmap( uint8_t * i_buffer, uint32_t i_buflen,
ErrlUsrParser & i_parser );
ErrlUsrParser & i_parser, TARGETING::TYPE i_type );

/**
* @brief Parses TD Controller state data.
Expand Down

0 comments on commit e43ee27

Please sign in to comment.