Skip to content

Commit

Permalink
STOP_Recovery: Added hwp changes to support error log parser.
Browse files Browse the repository at this point in the history
Commit updates STOP recovery HWP to be able to support error log
parsing. STOP recovery HWP incorporates an idea of section id for
various sub-sections of STOP recovery summary section. In case of
PM Malfunction, p9_pm_callout adds those sub-section to an error
log in form of user data sub-section.

Key_Cronus_Test=PM_REGRESS

Change-Id: I3210921fd64d27b58c6ee6319da6d9090e61f5e0
CQ: SW438713
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63784
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/63809
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
premsjha authored and dcrowell77 committed Aug 3, 2018
1 parent af6f77c commit c5efa55
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 46 deletions.
37 changes: 20 additions & 17 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_callout.C
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ enum
CFG_PM_MUX_DISABLE = 7,
TP_FENCE_PCB = 25,
OCC_FLAG2_SCOM1_ADDR = 0x0006C18B,
STATE_CONFIG_SECTN = 0x00,
SGPE_SECTN = 0x01,
PGPE_SECTN = 0x02,
CME_SECTN = 0x03,
QPPM_SECTN = 0x04,
CPPM_SECTN = 0x05,
SGPE_GLOBAL_VAR_SECTN = 0x06,
PGPE_GLOBAL_VAR_SECTN = 0x07,
CME_GLOBAL_VAR_SECTN = 0x08,
MAX_FFDC_SUMMARY_SECTN_CNT = 0x09,
};

/**
Expand Down Expand Up @@ -305,6 +295,7 @@ extern "C"
using namespace p9_stop_recov_ffdc;
FAPI_IMP(">> p9_pm_callout" );

errlver_t l_summSectn;
HomerFfdcRegion* l_pHomerFfdc =
( HomerFfdcRegion*)( (uint8_t*)i_pHomerBase + FFDC_REGION_HOMER_BASE_OFFSET );
uint8_t* l_pSummary = NULL;
Expand All @@ -330,53 +321,61 @@ extern "C"

l_coreActn.getDeadCoreVector( o_deadCores ); //retrieve Phyp generated dead core vector

for( uint8_t l_ffdcSecId = 0; l_ffdcSecId < MAX_FFDC_SUMMARY_SECTN_CNT;
l_ffdcSecId++ )
for( uint8_t l_secId = 0; l_secId < MAX_FFDC_SUMMARY_SECTN_CNT;
l_secId++ )
{
switch( l_ffdcSecId )
switch( l_secId )
{
case STATE_CONFIG_SECTN:
l_pSummary = (uint8_t*) &l_pHomerFfdc->iv_ffdcSummaryRegion.iv_sysState;
l_sectnSize = sizeof(SysState);
l_summSectn = STATE_CONFIG_SECTN;
break;

case SGPE_SECTN:
l_pSummary = &l_pHomerFfdc->iv_ffdcSummaryRegion.iv_sgpeSummary[0];
l_sectnSize = FFDC_SUMMARY_SIZE_SGPE;
l_summSectn = SGPE_SECTN;
break;

case PGPE_SECTN:
l_pSummary = &l_pHomerFfdc->iv_ffdcSummaryRegion.iv_pgpeSummary[0];
l_sectnSize = FFDC_SUMMARY_SIZE_PGPE;
l_summSectn = PGPE_SECTN;
break;

case CME_SECTN:
l_pSummary = &l_pHomerFfdc->iv_ffdcSummaryRegion.iv_cmeSummary[0][0];
l_sectnSize = (FFDC_SUMMARY_SIZE_CME * MAX_CMES_PER_CHIP);
l_summSectn = CME_SECTN;
break;

case QPPM_SECTN:
//QPPM FFDC section is small in size. So, let us lump it all as one user data
//section of error log.
l_pSummary = &l_pHomerFfdc->iv_ffdcSummaryRegion.iv_qpmmRegSummary[0][0];
l_sectnSize = (FFDC_SUMMARY_SIZE_QPPM_REG * MAX_QUADS_PER_CHIP);
l_summSectn = QPPM_SECTN;
break;

case CPPM_SECTN:
//CPPM FFDC section is small in size. So, let us lump it all as one user data
//section of error log.
l_pSummary = &l_pHomerFfdc->iv_ffdcSummaryRegion.iv_cpmmRegSummary[0][0];
l_sectnSize = (FFDC_SUMMARY_SIZE_CPPM_REG * MAX_CORES_PER_CHIP);
l_summSectn = CPPM_SECTN;
break;

case SGPE_GLOBAL_VAR_SECTN:
l_pSummary = l_pHomerFfdc->iv_ffdcSummaryRegion.iv_sgpeScoreBoard.iv_dataPtr;
l_sectnSize = l_pHomerFfdc->iv_ffdcSummaryRegion.iv_sgpeScoreBoard.iv_dataSize;
l_summSectn = SGPE_GLOBAL_VAR_SECTN;
break;

case PGPE_GLOBAL_VAR_SECTN:
l_pSummary = l_pHomerFfdc->iv_ffdcSummaryRegion.iv_pgpeScoreBoard.iv_dataPtr;
l_sectnSize = l_pHomerFfdc->iv_ffdcSummaryRegion.iv_pgpeScoreBoard.iv_dataSize;
l_summSectn = PGPE_GLOBAL_VAR_SECTN;
break;

case CME_GLOBAL_VAR_SECTN:
Expand All @@ -387,21 +386,25 @@ extern "C"
{
l_pSummary = l_pHomerFfdc->iv_ffdcSummaryRegion.iv_cmeScoreBoard[l_corePos].iv_dataPtr;
l_sectnSize = l_pHomerFfdc->iv_ffdcSummaryRegion.iv_cmeScoreBoard[l_corePos].iv_dataSize;
StopErrLogSectn l_coreGlobalVarSectn( l_pSummary, l_sectnSize );
StopErrLogSectn l_coreGlobalVarSectn( l_pSummary, l_sectnSize, CME_GLOBAL_VAR_SECTN );
o_ffdcList.push_back( l_coreGlobalVarSectn );
}
}

l_summSectn = CME_GLOBAL_VAR_SECTN;
break;

default:
//Skip the addition of this section to error log
FAPI_ERR("Section Number %d Not Defined in STOP Recovery Summary", l_ffdcSecId );
FAPI_ERR("Section Number %d Not Defined in STOP Recovery Summary", l_secId );
continue;
}

StopErrLogSectn l_ffdcSubSectn( l_pSummary, l_sectnSize );
o_ffdcList.push_back( l_ffdcSubSectn );
if( l_summSectn < MAX_FFDC_SUMMARY_SECTN_CNT )
{
StopErrLogSectn l_ffdcSubSectn( l_pSummary, l_sectnSize, l_summSectn );
o_ffdcList.push_back( l_ffdcSubSectn );
}
}

if( o_ffdcList.size() > 0 )
Expand Down
18 changes: 1 addition & 17 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_callout.H
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,7 @@
// Includes
// ------------------------------------------------------------------------------
#include <fapi2.H>

///@brief models a sub-section of STOP Recovery summary.
///@note caller of HWP passes in an empty vector however,
///HWP populates it with pointers to all summary sub-section.
struct StopErrLogSectn
{
uint8_t* iv_pBufPtr;
uint16_t iv_bufSize;
StopErrLogSectn( uint8_t* i_bufPtr, uint16_t i_bufSize )
: iv_pBufPtr( i_bufPtr ), iv_bufSize( i_bufSize )
{ }

StopErrLogSectn( )
: iv_pBufPtr( NULL ),
iv_bufSize( 0 )
{ }
};
#include <p9_pm_recovery_ffdc_defines.H>

enum RasAction
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ namespace p9_stop_recov_ffdc
{
FAPI_DBG( ">> PlatPmComplex::initRegList" );
iv_summaryReg.clear();
//NOTE: Update major or minor number as appropriate if this list
//ever changes. Failing to do so can break the error log parser.
iv_summaryReg.push_back( XSR );
iv_summaryReg.push_back( IAR );
iv_summaryReg.push_back( IR );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@
l_pHomerFfdc->iv_ffdcSummaryRegion.iv_cmeScoreBoard[l_exPos].iv_dataSize = FFDC_PPE_SCORE_BOARD_SIZE;

l_pCmeSummaryHdr->iv_subSectnId = PLAT_CME;
l_pCmeSummaryHdr->iv_majorNum = 1;
l_pCmeSummaryHdr->iv_minorNum = 0;
l_pCmeSummaryHdr->iv_majorNum = CME_MAJ_NUM;
l_pCmeSummaryHdr->iv_minorNum = CME_MIN_NUM;
l_pCmeSummaryHdr->iv_secValid = l_pCmeLayout->iv_ppeFfdcHdr.iv_ppeFfdcHdr.iv_sectionsValid;

if( !l_pCmeSummaryHdr->iv_secValid )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
void CppmRegs::initRegList()
{
std::vector < uint32_t> l_scomRegList;
//NOTE: Update major or minor number as appropriate if this list
//ever changes. Failing to do so can break the error log parser.
l_scomRegList.push_back( C_PPM_SSHSRC );
l_scomRegList.push_back( C_PPM_VDMCR );
PlatPmComplex::updateSummaryList( l_scomRegList );
Expand Down Expand Up @@ -169,8 +171,8 @@

PpmFfdcHeader * l_CppmFfdcHdr = (PpmFfdcHeader *) i_pHomerBuf ;
l_CppmFfdcHdr->iv_ppmMagicWord = htobe32(FFDC_CPPM_MAGIC_NUM);
l_CppmFfdcHdr->iv_versionMajor = 1;
l_CppmFfdcHdr->iv_versionMinor = 0;
l_CppmFfdcHdr->iv_versionMajor = CPPM_MAJ_NUM;
l_CppmFfdcHdr->iv_versionMinor = CPPM_MIN_NUM;
l_CppmFfdcHdr->iv_Instance = i_corePos; // CHIP_UNIT_POS
l_CppmFfdcHdr->iv_ppmHeaderSize = htobe16 (sizeof(PpmFfdcHeader));
l_CppmFfdcHdr->iv_sectionSize = htobe16 (FFDC_CPPM_REGION_SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,45 @@
( (((WORD) >> 8) & 0x00FF) | (((WORD) << 8) & 0xFF00) )
#endif

typedef uint8_t errlver_t;

///@brief models a sub-section of STOP Recovery summary.
///@note caller of p9_pm_callout passes in an empty vector
/// however, HWP populates it with pointers to all
/// summary sub-section.
struct StopErrLogSectn
{
uint8_t* iv_pBufPtr;
uint16_t iv_bufSize;
errlver_t iv_subsec;
StopErrLogSectn( uint8_t* i_bufPtr, uint16_t i_bufSize, errlver_t i_subSectn )
: iv_pBufPtr( i_bufPtr ), iv_bufSize( i_bufSize ), iv_subsec( i_subSectn )
{ }

StopErrLogSectn( )
: iv_pBufPtr( NULL ),
iv_bufSize( 0 ),
iv_subsec( 0 )
{ }
};

/**
* @brief sections of STOP Recovery FFDC summary
*/
enum VerList_t
{
STATE_CONFIG_SECTN = 0x00,
SGPE_SECTN = 0x01,
PGPE_SECTN = 0x02,
CME_SECTN = 0x03,
QPPM_SECTN = 0x04,
CPPM_SECTN = 0x05,
SGPE_GLOBAL_VAR_SECTN = 0x06,
PGPE_GLOBAL_VAR_SECTN = 0x07,
CME_GLOBAL_VAR_SECTN = 0x08,
MAX_FFDC_SUMMARY_SECTN_CNT = 0x09,
};

namespace p9_stop_recov_ffdc
{

Expand Down Expand Up @@ -67,6 +106,25 @@ enum PmResetStep
PM_RESET_DONE = 0xFF // Always the last
};

/**
* @brief miscellaneous constants
*/
enum SectionVer
{
SYS_CONFIG_MAJ_NUM = 1,
SYS_CONFIG_MIN_NUM = 0,
SGPE_MAJ_NUM = 1,
SGPE_MIN_NUM = 0,
PGPE_MAJ_NUM = 1,
PGPE_MIN_NUM = 0,
CME_MAJ_NUM = 1,
CME_MIN_NUM = 0,
QPPM_MAJ_NUM = 1,
QPPM_MIN_NUM = 0,
CPPM_MAJ_NUM = 1,
CPPM_MIN_NUM = 0,
};

/**
* @brief enumerates all the platforms involved with STOP Recovery.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ namespace p9_stop_recov_ffdc
{
FAPI_DBG (">> PlatOcc::initRegList" );
std::vector < uint32_t> l_scomRegList;
//NOTE: Update major or minor number as appropriate if this list
//ever changes. Failing to do so can break the error log parser.
l_scomRegList.push_back( PU_OCB_OCI_CCSR_SCOM );
l_scomRegList.push_back( PU_OCB_OCI_QSSR_SCOM );
l_scomRegList.push_back( P9N2_PU_OCB_OCI_OCCFLG_SCOM );
Expand Down Expand Up @@ -479,8 +481,8 @@ namespace p9_stop_recov_ffdc
FfdcSummSubSectHdr * l_pSysConfigHdr =
(FfdcSummSubSectHdr *)&l_pSysConfig->iv_subSecHdr;
l_pSysConfigHdr->iv_subSectnId = PLAT_OCC;
l_pSysConfigHdr->iv_majorNum = 1;
l_pSysConfigHdr->iv_minorNum = 0;
l_pSysConfigHdr->iv_majorNum = SYS_CONFIG_MAJ_NUM;
l_pSysConfigHdr->iv_minorNum = SYS_CONFIG_MIN_NUM;
l_pSysConfigHdr->iv_secValid = l_pOccFfdcHdr->iv_sectionsValid;

if( l_pSysConfigHdr->iv_secValid )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@

FfdcSummSubSectHdr * l_pPgpeSummaryHdr = (FfdcSummSubSectHdr *)&l_pHomerFfdc->iv_ffdcSummaryRegion.iv_pgpeSummary[0];
l_pPgpeSummaryHdr->iv_subSectnId = PLAT_PGPE;
l_pPgpeSummaryHdr->iv_majorNum = 1;
l_pPgpeSummaryHdr->iv_minorNum = 0;
l_pPgpeSummaryHdr->iv_majorNum = PGPE_MAJ_NUM;
l_pPgpeSummaryHdr->iv_minorNum = PGPE_MIN_NUM;
l_pPgpeSummaryHdr->iv_secValid = l_pPgpeFfdcHdr->iv_sectionsValid;

if( l_pPgpeSummaryHdr->iv_secValid )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
void QppmRegs::initRegList()
{
std::vector < uint32_t> l_scomRegList;
//NOTE: Update major or minor number as appropriate if this list
//ever changes. Failing to do so can break the error log parser.
l_scomRegList.push_back( EQ_PPM_GPMMR_SCOM );
l_scomRegList.push_back( EQ_PPM_SSHSRC );
l_scomRegList.push_back( EQ_QPPM_DPLL_FREQ );
Expand Down Expand Up @@ -181,8 +183,8 @@
FfdcSummSubSectHdr * l_pQppmSummaryHdr
= (FfdcSummSubSectHdr *)&l_pHomerFfdc->iv_ffdcSummaryRegion.iv_qpmmRegSummary[l_ppmPos][0];
l_pQppmSummaryHdr->iv_subSectnId = PLAT_QPPM;
l_pQppmSummaryHdr->iv_majorNum = 1;
l_pQppmSummaryHdr->iv_minorNum = 0;
l_pQppmSummaryHdr->iv_majorNum = QPPM_MAJ_NUM;
l_pQppmSummaryHdr->iv_minorNum = QPPM_MIN_NUM;
l_pQppmSummaryHdr->iv_secValid = htobe16(l_pQppmHdr->iv_ffdcValid);

if( !l_pQppmSummaryHdr->iv_secValid )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@
PpeFfdcHeader* l_pSgpeFfdcHdr = ( PpeFfdcHeader* )&l_pHomerFfdc->iv_sgpeFfdcRegion;
FfdcSummSubSectHdr * l_pSgpeSummaryHdr = (FfdcSummSubSectHdr *)&l_pHomerFfdc->iv_ffdcSummaryRegion.iv_sgpeSummary[0];
l_pSgpeSummaryHdr->iv_subSectnId = PLAT_SGPE;
l_pSgpeSummaryHdr->iv_majorNum = 1;
l_pSgpeSummaryHdr->iv_minorNum = 0;
l_pSgpeSummaryHdr->iv_majorNum = SGPE_MAJ_NUM;
l_pSgpeSummaryHdr->iv_minorNum = SGPE_MIN_NUM;
l_pSgpeSummaryHdr->iv_secValid = l_pSgpeFfdcHdr->iv_sectionsValid;

if( l_pSgpeSummaryHdr->iv_secValid )
Expand Down

0 comments on commit c5efa55

Please sign in to comment.