diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2017-01-10 16:53:57 -0600 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2017-01-25 17:33:46 -0500 |
commit | 38aa7b996846d5b403fa96e27799bfab1abf13a8 (patch) | |
tree | cdb2306af6a7313ff1c688e64c2539f6766927f3 /src | |
parent | 049679c48e1fce3c18f7ca9547ec6b7ac565b879 (diff) | |
download | talos-hostboot-38aa7b996846d5b403fa96e27799bfab1abf13a8.tar.gz talos-hostboot-38aa7b996846d5b403fa96e27799bfab1abf13a8.zip |
PRD: Error parser support for CE Table
Change-Id: I86d45b4689e4cd5e922f3e8965bf4eff602d676d
RTC: 165381
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34743
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@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/35415
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src')
4 files changed, 96 insertions, 79 deletions
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C index 639ed139d..c9919ace7 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C @@ -190,12 +190,30 @@ void MemCeTable::addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ) // Centaur specific info. uint8_t isMba = 0; uint8_t mbaPos = 0; + uint8_t rcType = CEN_SYMBOL::WIRING_INVALID; if ( TYPE_MBA == i_chip->getType() ) { isMba = 1; mbaPos = getTargetPosition( i_chip->getTrgt() ); + + /* TODO: RTC 157888 + if ( SUCCESS != getMemBufRawCardType(i_chip->getTrgt(), rcType) ) + { + PRDF_ERR( "[MemCeTable::addCapData] getMemBufRawCardType(0x%08x) " + "failed", i_chip->getHuid() ); + rcType = CEN_SYMBOL::WIRING_INVALID; // Just in case. + } + */ } + // Fill in the header info. + data[0] = (isMba << 7) | (mbaPos << 6); // 6 spare bits + data[1] = rcType; + // Bytes 2-7 are currently unused. + + sz_actData += METADATA_SIZE; + + // Fill in the entry info. for ( CeTable::iterator it = iv_table.begin(); it != iv_table.end(); it++ ) { uint32_t mrnk = it->addr.getRank().getMaster(); // 3-bit @@ -217,9 +235,8 @@ void MemCeTable::addCapData( ExtensibleChip * i_chip, CaptureData & io_cd ) uint8_t isEcc = it->isEccSpared ? 1 : 0; data[sz_actData ] = it->count; - data[sz_actData+1] = // 3 bits spare here. - (mbaPos << 4) | (it->portSlct << 3) | - (isSp << 2) | (isEcc << 1) | isMba; + data[sz_actData+1] = // 5 bits spare here. + (isSp << 2) | (isEcc << 1) | it->portSlct; data[sz_actData+2] = (isHard << 7) | (active << 6) | (it->dram & 0x3f); data[sz_actData+3] = it->dramPins; data[sz_actData+4] = (mrnk << 5) | (srnk << 2) | row0_1; diff --git a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C index 0741fd99e..cb2510c8e 100644 --- a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C +++ b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C @@ -426,11 +426,11 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen, { parseMemUeTable( sigData, sigDataSize, i_parser ); } -/* TODO: RTC 136126 else if ( Util::hashString("MEM_CE_TABLE") == sigId ) { parseMemCeTable( sigData, sigDataSize, i_parser ); } +/* TODO: RTC 136126 else if ( Util::hashString("MEM_RCE_TABLE") == sigId ) { parseMemRceTable( sigData, sigDataSize, i_parser ); diff --git a/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C b/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C index bb2ede2dd..dfcf2be44 100644 --- a/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C +++ b/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -3055,7 +3055,6 @@ bool parseMemUeTable( uint8_t * i_buffer, uint32_t i_buflen, //------------------------------------------------------------------------------ -/* TODO RTC 136126 bool parseMemCeTable( uint8_t * i_buffer, uint32_t i_buflen, ErrlUsrParser & i_parser ) { @@ -3064,8 +3063,10 @@ bool parseMemCeTable( uint8_t * i_buffer, uint32_t i_buflen, bool o_rc = true; if ( NULL == i_buffer ) return false; // Something failed in parser. + if ( i_buflen < METADATA_SIZE ) + return false; // Something failed in parser. - const uint32_t entries = i_buflen / ENTRY_SIZE; + const uint32_t entries = (i_buflen - METADATA_SIZE ) / ENTRY_SIZE; i_parser.PrintNumber( " MEM_CE_TABLE", "%d", entries ); @@ -3076,94 +3077,92 @@ bool parseMemCeTable( uint8_t * i_buffer, uint32_t i_buflen, hd = "---- - ---- ------- ------ ---- ---- - - ------"; i_parser.PrintString( hh, hd ); - for ( uint32_t i = 0; i < entries; i++ ) - { - uint32_t idx = i * ENTRY_SIZE; - - uint32_t count = i_buffer[idx]; // 8-bit - - uint32_t type13 = (i_buffer[idx+1] >> 5) & 0x7; // 3-bit - uint32_t mbaPos = (i_buffer[idx+1] >> 4) & 0x1; // 1-bit - uint32_t ps = (i_buffer[idx+1] >> 3) & 0x1; // 1-bit - uint32_t isSp = (i_buffer[idx+1] >> 2) & 0x1; // 1-bit - uint32_t isEcc = (i_buffer[idx+1] >> 1) & 0x1; // 1-bit - uint32_t type0 = i_buffer[idx+1] & 0x1; // 1-bit - - uint32_t type = type0 << 3 | type13; - - uint8_t isHard = (i_buffer[idx+2] >> 7) & 0x1; // 1-bit - uint8_t active = (i_buffer[idx+2] >> 6) & 0x1; // 1-bit - uint8_t dram = i_buffer[idx+2] & 0x3f; // 6-bit - - uint32_t dramPins = i_buffer[idx+3]; // 8-bit + // Get the metadata info. + uint8_t isMba = (i_buffer[0] >> 7) & 0x1; // 1-bit + uint8_t mbaPos = (i_buffer[0] >> 6) & 0x1; // 1-bit + // 6 spare bits // 6-bit + uint8_t rcType = i_buffer[1]; // 8-bit + // Bytes 2-7 are currently unused. - uint32_t mrnk = (i_buffer[idx+4] >> 5) & 0x7; // 3-bit - uint32_t srnk = (i_buffer[idx+4] >> 2) & 0x7; // 3-bit - uint32_t svld = (i_buffer[idx+4] >> 1) & 0x1; // 1-bit - - uint32_t row0 = i_buffer[idx+4] & 0x1; - uint32_t row1_8 = i_buffer[idx+5]; - uint32_t row9_16 = i_buffer[idx+6]; - uint32_t row = (row0 << 16) | (row1_8 << 8) | row9_16; // 17-bit - - uint32_t bnk = i_buffer[idx+7] >> 4; // 4-bit + // Get the entry info. + for ( uint32_t idx = METADATA_SIZE; idx < i_buflen; + idx += CE_TABLE::ENTRY_SIZE ) + { + uint32_t count = i_buffer[idx ]; // 8-bit + // 5 spare bits // 5-bit + uint32_t isSp = (i_buffer[idx+1] >> 2) & 0x1; // 1-bit + uint32_t isEcc = (i_buffer[idx+1] >> 1) & 0x1; // 1-bit + uint32_t ps = i_buffer[idx+1] & 0x1; // 1-bit + uint32_t isHard = (i_buffer[idx+2] >> 7) & 0x1; // 1-bit + uint32_t active = (i_buffer[idx+2] >> 6) & 0x1; // 1-bit + uint32_t dram = i_buffer[idx+2] & 0x3f; // 6-bit + uint32_t dramPins = i_buffer[idx+3]; // 8-bit + uint32_t mrnk = (i_buffer[idx+4] >> 5) & 0x7; // 3-bit + uint32_t srnk = (i_buffer[idx+4] >> 2) & 0x7; // 3-bit + uint32_t row0_1 = i_buffer[idx+4] & 0x3; // 2-bit + uint32_t row2_9 = i_buffer[idx+5]; // 8-bit + uint32_t row10_17 = i_buffer[idx+6]; // 8-bit + uint32_t bnk = (i_buffer[idx+7] >> 3) & 0x1f; // 5-bit + // 2 spare bits // 2-bit + uint32_t col0 = i_buffer[idx+7] & 0x1; // 1-bit + uint32_t col1_8 = i_buffer[idx+8]; // 8-bit - uint32_t col0_3 = i_buffer[idx+7] & 0xf; - uint32_t col4_11 = i_buffer[idx+8]; - uint32_t col = (col0_3 << 8) | col4_11; // 12-bit + uint32_t row = (row0_1 << 16) | (row2_9 << 8) | row10_17; + uint32_t col = (col0 << 8) | col1_8; char active_char = ( 1 == active ) ? 'Y':'N'; char isHard_char = ( 1 == isHard ) ? 'Y':'N'; char isSp_char = ( 1 == isSp ) ? 'Y':'N'; char isEcc_char = ( 1 == isEcc ) ? 'Y':'N'; - // Get the DRAM site location information. - const char * cardName; - const char ** dqMap; - const char ** dramMap; - int32_t l_rc = getDramSiteInfo( type, mbaPos, ps, mrnk, - cardName, dqMap, dramMap ); - - // Check if DIMM has x4 DRAMs. - bool x4Dram; - l_rc |= isX4Dram( type, x4Dram ); - - // Get the DRAM site string. + const char * cardName_str = ""; + const char * portSlct_str = " "; // intentionally an empty space. const char * dramSite_str = ""; - if ( (SUCCESS == l_rc) && - (dram < (x4Dram ? X4DRAMS_PER_RANK : X8DRAMS_PER_RANK)) ) - { - // Get the DRAM index for site location table. - uint8_t symbol = transEccSpare( dram2Symbol(dram, x4Dram), - (1 == isEcc) ); - uint8_t dqIdx = transDramSpare( symbol2Dq(symbol), - (1 == isSp) ); - uint8_t dramIdx = dqSiteIdx2DramSiteIdx( dqIdx, x4Dram ); - - dramSite_str = dramMap[dramIdx]; - } - // Get the rank string. - char rank_str[DATA_SIZE]; // 4 characters - if ( 1 == svld ) + if ( 1 == isMba ) { - snprintf( rank_str, DATA_SIZE, "m%ds%d", mrnk, srnk ); - } - else - { - snprintf( rank_str, DATA_SIZE, "m%d ", mrnk ); + // Get the DRAM site location information. + const char ** dqMap; + const char ** dramMap; + int32_t l_rc = getDramSiteInfo( rcType, mbaPos, ps, mrnk, + cardName_str, dqMap, dramMap ); + + // Check if DIMM has x4 DRAMs. + bool x4Dram; + l_rc |= isX4Dram( rcType, x4Dram ); + + // Get the DRAM site string. + if ( (SUCCESS == l_rc) && + (dram < (x4Dram ? MBA_NIBBLES_PER_RANK : MBA_BYTES_PER_RANK)) ) + { + uint8_t tmp = x4Dram ? nibble2Symbol<TYPE_MBA>(dram) + : byte2Symbol <TYPE_MBA>(dram); + + // Get the DRAM index for site location table. + uint8_t symbol = transEccSpare( tmp, (1 == isEcc) ); + uint8_t dqIdx = transDramSpare( symbol2Dq<TYPE_MBA>(symbol), + (1 == isSp) ); + uint8_t dramIdx = dqSiteIdx2DramSiteIdx( dqIdx, x4Dram ); + + dramSite_str = dramMap[dramIdx]; + } + + // Get the port select string. + char tmp[DATA_SIZE] = { '\0' }; + snprintf( tmp, DATA_SIZE, "%1d", ps ); + portSlct_str = tmp; } // Build the header string. char header[HEADER_SIZE] = { '\0' }; - snprintf( header, HEADER_SIZE, " %c %c 0x%02x %s ", active_char, - isHard_char, count, cardName ); + snprintf( header, HEADER_SIZE, " %c %c %3d %s ", active_char, + isHard_char, count, cardName_str ); // Build the data string. char data[DATA_SIZE] = { '\0' }; snprintf( data, DATA_SIZE, - "%s %1d 0x%1x 0x%05x 0x%03x %2d 0x%02x %c %c %s", - rank_str, ps, bnk, row, col, dram, dramPins, + "m%ds%d %s 0x%02x 0x%05x 0x%03x %2d 0x%02x %c %c %s", + mrnk, srnk, portSlct_str, bnk, row, col, dram, dramPins, isSp_char, isEcc_char, dramSite_str ); // Print the line. @@ -3172,7 +3171,6 @@ bool parseMemCeTable( uint8_t * i_buffer, uint32_t i_buflen, return o_rc; } -*/ //------------------------------------------------------------------------------ diff --git a/src/usr/diag/prdf/common/plugins/prdfParserEnums.H b/src/usr/diag/prdf/common/plugins/prdfParserEnums.H index 45ce959d1..59bcc9be3 100644 --- a/src/usr/diag/prdf/common/plugins/prdfParserEnums.H +++ b/src/usr/diag/prdf/common/plugins/prdfParserEnums.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -136,10 +136,12 @@ namespace CE_TABLE { enum { + METADATA_SIZE = 8, ///< Number of bytes for the table metadata. + MAX_ENTRIES = 32, ///< Maximum number of entries allow in table. ENTRY_SIZE = 9, ///< Number of bytes per entry. - MAX_SIZE = MAX_ENTRIES * ENTRY_SIZE, ///< Maximum table size. + MAX_SIZE = METADATA_SIZE + MAX_ENTRIES * ENTRY_SIZE, ///< Maximum size. }; } // namespace CE_TABLE |