diff options
| author | Caleb Palmer <cnpalmer@us.ibm.com> | 2017-02-13 14:08:44 -0600 |
|---|---|---|
| committer | Zane C. Shelley <zshelle@us.ibm.com> | 2017-02-17 13:54:20 -0500 |
| commit | bb5b0d4f27a75272f74e10a78d36df322fe3c348 (patch) | |
| tree | d26e2776690f1c29c7e005b75adc3f53cf2f2626 /src/usr/diag/prdf/common/plugins | |
| parent | b0b1c62e528e8756282afb304e853c4411c21ac9 (diff) | |
| download | blackbird-hostboot-bb5b0d4f27a75272f74e10a78d36df322fe3c348.tar.gz blackbird-hostboot-bb5b0d4f27a75272f74e10a78d36df322fe3c348.zip | |
PRD: TD Ctlr add parsing code in errl parser
Change-Id: I195fdab9a0a40760554ae81fcde06d31c0134339
RTC: 164706
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36380
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Tested-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36520
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/common/plugins')
| -rw-r--r-- | src/usr/diag/prdf/common/plugins/prdfLogParse_common.C | 2 | ||||
| -rw-r--r-- | src/usr/diag/prdf/common/plugins/prdfMemLogParse.C | 200 |
2 files changed, 86 insertions, 116 deletions
diff --git a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C index cf9033fcf..c459d12c8 100644 --- a/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C +++ b/src/usr/diag/prdf/common/plugins/prdfLogParse_common.C @@ -447,12 +447,12 @@ bool parseCaptureData( void * i_buffer, uint32_t i_buflen, { parseBadDqBitmap( sigData, sigDataSize, i_parser ); } +*/ else if ( (Util::hashString(TD_CTLR_DATA::START) == sigId) || (Util::hashString(TD_CTLR_DATA::END) == sigId) ) { parseTdCtlrStateData( sigData, sigDataSize, i_parser, sigId ); } -*/ /*TODO: RTC 136050 else if ( Util::hashString(SLW_FFDC_DATA::title) == sigId ) { diff --git a/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C b/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C index 14f1db9e4..bcd44edd1 100644 --- a/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C +++ b/src/usr/diag/prdf/common/plugins/prdfMemLogParse.C @@ -34,6 +34,7 @@ #include <UtilHash.H> #include <utilmem.H> #include <iipconst.h> +#include <prdfBitString.H> #include <prdfDramRepairUsrData.H> #include <prdfParserEnums.H> #include <prdfParserUtils.H> @@ -3345,7 +3346,6 @@ bool parseBadDqBitmap( uint8_t * i_buffer, uint32_t i_buflen, //------------------------------------------------------------------------------ -/* TODO RTC 136126 bool parseTdCtlrStateData( uint8_t * i_buffer, uint32_t i_buflen, ErrlUsrParser & i_parser, uint32_t i_sigId ) { @@ -3356,91 +3356,115 @@ bool parseTdCtlrStateData( uint8_t * i_buffer, uint32_t i_buflen, else if ( Util::hashString(TD_CTLR_DATA::END) == i_sigId ) i_parser.PrintString( " TDCTLR_STATE_DATA_END", "" ); - // These are copies of the enums in prdfCenMbaTdCtlr_common.H. This is not - // elegant nor robust. It is a quick fix simply to deliver this parser code - // quickly. We can make a better fix later. - enum + // These are copies of the enums in prdfMemTdQueue.H and prdfParserEnums.H. + enum TdType { VCM_EVENT = 0, TPS_EVENT, + }; - NO_OP = 0, - VCM_PHASE_1, - VCM_PHASE_2, - DSD_PHASE_1, - DSD_PHASE_2, - TPS_PHASE_1, - TPS_PHASE_2, + enum Phase + { + TD_PHASE_0, + TD_PHASE_1, + TD_PHASE_2, }; - uint32_t idx = 0; + enum Version + { + IPL = 1, + RT = 2, + }; do { - if ( NULL == i_buffer ) { o_rc = false; break; } + if ( NULL == i_buffer ) + { + o_rc = false; + break; + } + + BitString bs( (i_buflen*8), (CPU_WORD*)i_buffer ); + + if ( bs.getBitLen() < 22 ) + { + o_rc = false; + break; + } + + uint32_t curPos = 0; + //###################################################################### - // Header data (4 bytes) + // Header data (18 bits) //###################################################################### - if ( i_buflen < (idx + 4) ) { o_rc = false; break; } + uint8_t version = bs.getFieldJustify( curPos, 4 ); curPos+=4; + uint8_t mrnk = bs.getFieldJustify( curPos, 3 ); curPos+=3; + uint8_t srnk = bs.getFieldJustify( curPos, 3 ); curPos+=3; + uint8_t phase = bs.getFieldJustify( curPos, 4 ); curPos+=4; + uint8_t type = bs.getFieldJustify( curPos, 4 ); curPos+=4; - uint8_t rescount = i_buffer[idx]; - uint8_t badRankMask = i_buffer[idx+1]; - uint8_t state = (i_buffer[idx+2] >> 4) & 0xf; - uint8_t mrnk = (i_buffer[idx+2] >> 1) & 0x7; - uint8_t fetchMsk = i_buffer[idx+2] & 0x1; - uint8_t srnk = (i_buffer[idx+3] >> 5) & 0x7; + const char * version_str = " "; + switch ( version ) + { + case IPL: version_str = "IPL"; break; + case RT : version_str = "RT "; break; + } - idx += 4; + const char * type_str = " "; + switch ( type ) + { + case VCM_EVENT: type_str = "VCM_EVENT"; break; + case TPS_EVENT: type_str = "TPS_EVENT"; break; + default : type_str = "INVALID_EVENT"; break; + } - const char * state_str = " "; - switch ( state ) + const char * phase_str = " "; + switch ( phase ) { - case NO_OP: state_str = "NO_OP "; break; - case VCM_PHASE_1: state_str = "VCM_PHASE_1"; break; - case VCM_PHASE_2: state_str = "VCM_PHASE_2"; break; - case DSD_PHASE_1: state_str = "DSD_PHASE_1"; break; - case DSD_PHASE_2: state_str = "DSD_PHASE_2"; break; - case TPS_PHASE_1: state_str = "TPS_PHASE_1"; break; - case TPS_PHASE_2: state_str = "TPS_PHASE_2"; break; + case TD_PHASE_0: phase_str = "TD_PHASE_0"; break; + case TD_PHASE_1: phase_str = "TD_PHASE_1"; break; + case TD_PHASE_2: phase_str = "TD_PHASE_2"; break; } char rank_str[DATA_SIZE] = " "; - switch ( state ) + switch ( type ) { - case VCM_PHASE_1: case VCM_PHASE_2: - case DSD_PHASE_1: case DSD_PHASE_2: - snprintf( rank_str, DATA_SIZE, "m%d ", mrnk ); break; - case TPS_PHASE_1: case TPS_PHASE_2: - snprintf( rank_str, DATA_SIZE, "m%ds%d", mrnk, srnk ); break; + case VCM_EVENT: + snprintf( rank_str, DATA_SIZE, "m%d ", mrnk ); break; + case TPS_EVENT: + snprintf( rank_str, DATA_SIZE, "m%ds%d", mrnk, srnk ); break; + default: + snprintf( rank_str, DATA_SIZE, "n/a "); break; } - i_parser.PrintString( " TD State", state_str ); - i_parser.PrintString( " Target Rank", rank_str ); - i_parser.PrintNumber( " Resume Counter", "0x%02X", rescount ); - i_parser.PrintBool( " Fetch Attns Masked", 0 != fetchMsk ); - i_parser.PrintNumber( " Bad Master Ranks", "0x%02X", badRankMask ); + i_parser.PrintString( " Version", version_str ); + i_parser.PrintString( " TD Type", type_str ); + i_parser.PrintString( " TD Phase", phase_str ); + i_parser.PrintString( " Target Rank", rank_str ); + //###################################################################### - // TD Request Queue (min 1 byte, max 33 bytes) + // TD Request Queue (min 4 bits, max 164 bits) //###################################################################### - if ( i_buflen < (idx + 1) ) { o_rc = false; break; } + uint8_t queueCount = bs.getFieldJustify( curPos, 4 ); curPos+=4; - uint8_t dataCount = i_buffer[idx] * 2; - idx += 1; - - if ( i_buflen < (idx + dataCount) ) { o_rc = false; break; } + if ( bs.getBitLen() <= (curPos+(queueCount*10)) ) + { + o_rc = false; + break; + } - for ( uint8_t i = 0; i < dataCount; i += 2 ) + for ( uint8_t i = 0; i < queueCount; i++ ) { - uint8_t type = i_buffer[idx+i]; - uint8_t mr = (i_buffer[idx+i+1] >> 5) & 0x7; - uint8_t sr = (i_buffer[idx+i+1] >> 2) & 0x7; + uint8_t queueMrnk = bs.getFieldJustify( curPos, 3 ); curPos+=3; + uint8_t queueSrnk = bs.getFieldJustify( curPos, 3 ); curPos+=3; + uint8_t queueType = bs.getFieldJustify( curPos, 4 ); curPos+=4; const char * type_str = " "; - switch ( type ) + switch ( queueType ) { case VCM_EVENT: type_str = "VCM_EVENT"; break; case TPS_EVENT: type_str = "TPS_EVENT"; break; @@ -3450,74 +3474,21 @@ bool parseTdCtlrStateData( uint8_t * i_buffer, uint32_t i_buflen, switch ( type ) { case VCM_EVENT: - snprintf( rank_str, DATA_SIZE, "m%d ", mr ); break; + snprintf( rank_str, DATA_SIZE, "m%d ", queueMrnk ); + break; case TPS_EVENT: - snprintf( rank_str, DATA_SIZE, "m%ds%d", mr, sr ); break; + snprintf( rank_str, DATA_SIZE, "m%ds%d", queueMrnk, + queueSrnk ); + break; } char data[DATA_SIZE] = ""; - snprintf( data, DATA_SIZE, "%s on %s", type_str, rank_str ); + snprintf( data, DATA_SIZE, "%s on %s", type_str, rank_str ); i_parser.PrintString( " TD Request", data ); } - idx += dataCount; - - //###################################################################### - // VCM Rank Data (min 1 byte, max 17 bytes) - //###################################################################### - - if ( i_buflen < (idx + 1) ) { o_rc = false; break; } - - dataCount = i_buffer[idx] * 2; - idx += 1; - - if ( i_buflen < (idx + dataCount) ) { o_rc = false; break; } - - for ( uint8_t i = 0; i < dataCount; i += 2 ) - { - uint8_t faCount = i_buffer[idx+i]; - uint8_t mr = (i_buffer[idx+i+1] >> 5) & 0x7; - - char data[DATA_SIZE] = ""; - snprintf( data, DATA_SIZE, - "rank=m%d FA count=0x%02x", - mr, faCount ); - - i_parser.PrintString( " VCM Rank Data", data ); - } - - idx += dataCount; - - //###################################################################### - // TPS Rank Data (min 1 byte, max 129 bytes) - //###################################################################### - - if ( i_buflen < (idx + 1) ) { o_rc = false; break; } - - dataCount = i_buffer[idx] * 2; - idx += 1; - - if ( i_buflen < (idx + dataCount) ) { o_rc = false; break; } - - for ( uint8_t i = 0; i < dataCount; i += 2 ) - { - uint8_t faCount = i_buffer[idx+i]; - uint8_t mr = (i_buffer[idx+i+1] >> 5) & 0x7; - uint8_t sr = (i_buffer[idx+i+1] >> 2) & 0x7; - uint8_t isBan = (i_buffer[idx+i+1] >> 1) & 0x1; - - char data[DATA_SIZE] = ""; - snprintf( data, DATA_SIZE, - "rank=m%ds%d FA count=0x%02x banned=%s", - mr, sr, faCount, (0 != isBan) ? "true" : "false" ); - - i_parser.PrintString( " TPS Rank Data", data ); - } - - idx += dataCount; - - } while (0); + }while(0); if ( !o_rc ) { @@ -3526,7 +3497,6 @@ bool parseTdCtlrStateData( uint8_t * i_buffer, uint32_t i_buflen, return o_rc; } -*/ //------------------------------------------------------------------------------ |

