Skip to content

Commit

Permalink
Extend PM Reset flow to collect PM FFDC to HOMER
Browse files Browse the repository at this point in the history
- extend the base flow to ensure ffdc gets collected to homer
- revise error xmls
- misc changes to handle pm recovery flow triggered via Malf Alert

Key_Cronus_Test=PM_REGRESS

Change-Id: I12148ed227efe4613332ae76ff142c1d82855f20
RTC: 153979
CQ: SW416537
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53522
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com>
Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53533
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: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
am10dolkar authored and crgeddes committed Feb 17, 2018
1 parent b74acc4 commit cff2ddb
Show file tree
Hide file tree
Showing 19 changed files with 477 additions and 34 deletions.
43 changes: 41 additions & 2 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.C
Expand Up @@ -333,6 +333,23 @@ namespace p9_stop_recov_ffdc
*l_pSectionsValid );
}

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

void PlatPmComplex::logPmResetPhase (const void* i_pHomerBuf)
{
FAPI_DBG ( ">> PlatPmComplex::logPmResetPhase" );
HomerFfdcRegion* l_pHomerFfdc = ( HomerFfdcRegion* )
((uint8_t*) i_pHomerBuf + FFDC_REGION_HOMER_BASE_OFFSET );
uint8_t* l_pResetPhase = &l_pHomerFfdc->iv_pmFfdcHdrRegion.iv_pmFfdcHdr.iv_phase;

fapi2::ATTR_PM_RESET_PHASE_Type l_phase;
FAPI_ATTR_GET (fapi2::ATTR_PM_RESET_PHASE, iv_procChip, l_phase);
*l_pResetPhase = l_phase;

FAPI_DBG ( "<< PlatPmComplex::logPmResetPhase PM Reset Phase: %d",
l_phase );
}

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

fapi2::ReturnCode PlatPmComplex::readPpeHaltState (
Expand Down Expand Up @@ -665,8 +682,12 @@ extern "C"
{
FAPI_IMP(">> p9_pm_recovery_ffdc_base" );
std::vector<PlatPmComplex*> l_pPlatList;
fapi2::ATTR_PM_RESET_PHASE_Type l_phase = PM_RESET_FFDC_SEC_INIT;

// init all the platform FFDC headers
FAPI_ATTR_SET (fapi2::ATTR_PM_RESET_PHASE, i_procChipTarget,
l_phase);

l_pPlatList.push_back (new PlatPmComplex(i_procChipTarget));
l_pPlatList.push_back (new PlatCme(i_procChipTarget));
l_pPlatList.push_back (new PlatSgpe(i_procChipTarget));
Expand All @@ -684,11 +705,16 @@ extern "C"
}

// Grab FIRs and PPE Halt State in FFDC, before entering Reset Flow
// PPE_HALT_STATE and FIRS are collected together, mark step as FIRS
l_phase = PM_RESET_FFDC_GET_FIRS;
FAPI_ATTR_SET (fapi2::ATTR_PM_RESET_PHASE, i_procChipTarget,
l_phase);
FAPI_INF ("p9_pm_recovery_ffdc_base: Collecting FIR & PPE Halt States");

for ( auto& it : l_pPlatList )
{
FAPI_TRY ( it->collectFfdc (i_pHomerImage, (PPE_HALT_STATE | FIR_STATE)),
"p9_pm_recovery_ffdc_base: Failed to collect FOR & PPE Halt State. Plat %d",
"p9_pm_recovery_ffdc_base: Failed to collect FIR & PPE Halt State. Plat %d",
it->getPlatId () );
}

Expand All @@ -697,7 +723,20 @@ extern "C"
delete it;

FAPI_IMP("<< p9_pm_recovery_ffdc_base" );
return fapi2::FAPI2_RC_SUCCESS;
return fapi2::current_err;
}

fapi2::ReturnCode p9_pm_recovery_ffdc_misc (
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_procChipTarget,
void* i_pHomerImage )
{
FAPI_DBG (">> p9_pm_recovery_ffdc_misc" );
PlatPmComplex l_pmFfdc (i_procChipTarget, PLAT_MISC);

l_pmFfdc.logPmResetPhase (i_pHomerImage);

FAPI_DBG ("<< p9_pm_recovery_ffdc_misc" );
return fapi2::FAPI2_RC_SUCCESS;
}
}

Expand Down
21 changes: 19 additions & 2 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.H
Expand Up @@ -59,7 +59,7 @@ namespace p9_stop_recov_ffdc
/// @param[in] i_globalBaseAddr sram address of start of global variables
PlatPmComplex( const fapi2::Target< fapi2::TARGET_TYPE_PROC_CHIP >
i_procChipTgt,
PmComplexPlatId i_plat = PLAT_NONE,
PmComplexPlatId i_plat = PLAT_INIT,
uint32_t i_imageHdrBaseAddr = 0,
uint32_t i_traceBufBaseAddress = 0,
uint32_t i_globalBaseAddr = 0 );
Expand Down Expand Up @@ -122,6 +122,11 @@ namespace p9_stop_recov_ffdc
///@brief initializes a list of register for generation of FFDC summary.
void initRegList();

///@brief logs the current PM Reset Phase in the PmFfdcHeader
///@param[in] i_pHomerBuf Base address of PM FFDC in HOMER
///@return N.A.
void logPmResetPhase ( const void* i_pHomerBuf );

protected:

/// @brief parses a region of HOMER to extract PPE registers
Expand Down Expand Up @@ -292,7 +297,7 @@ namespace p9_stop_recov_ffdc
// function pointer typedef definition for HWP call support
typedef fapi2::ReturnCode (*p9_pm_recovery_ffdc_base_FP_t)
( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&,
const void* );
void* );

extern "C"
{
Expand All @@ -311,6 +316,18 @@ namespace p9_stop_recov_ffdc
fapi2::ReturnCode p9_pm_recovery_ffdc_base
( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_procChipTarget,
void* i_pHomerImage );

/// @brief Updates the PM FFDC section in HOMER with miscellaneous, platform
/// agnostic FFDC
///
/// @param[in] i_procChipTarget Proc Chip target
/// @param[in] i_pHomerImage Pointer to the base of the chip HOMER region
///
/// @return FAPI2_RC_SUCCESS on success or error return code
///
fapi2::ReturnCode p9_pm_recovery_ffdc_misc
( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_procChipTarget,
void* i_pHomerImage );
}

} //namespace p9_stop_recov_ffdc ends
Expand Down
Expand Up @@ -230,6 +230,7 @@
}

fapi_try_exit:
logPmResetPhase (i_pHomerBuf);
FAPI_DBG("<< PlatCme::collectFfdc");
return fapi2::current_err;
}
Expand Down
Expand Up @@ -154,6 +154,7 @@
}

fapi_try_exit:
logPmResetPhase (i_pHomerBuf);
FAPI_DBG("<< CppmRegs::collectFfdc");
return fapi2::current_err;
}
Expand Down
Expand Up @@ -43,39 +43,43 @@ namespace p9_stop_recov_ffdc
*/
enum PmResetStep
{
PM_RESET_UNKNOWN = 0,
PM_RESET_UNKNOWN = 0x00,
PM_RESET_INIT,
PM_RESET_FFDC_SEC_INIT,
PM_RESET_FFDC_CHK_PPE_HALT,
PM_RESET_FFDC_GET_FIRS,
PM_RESET_FIR_OCC,
PM_RESET_OCC_CTRL,
PM_RESET_SPL_WKUP_EX_ALL,
PM_RESET_SET_AUTO_SPL_WKUP,
PM_RESET_FIR_PBA,
PM_RESET_FIR_PPM,
PM_RESET_FIR_CME,
PM_RESET_OCC_GPE,
PM_RESET_PGPE,
PM_RESET_SGPE,
PM_RESET_EC_EQ,
PM_RESET_DISABLE_RES_CLKS,
PM_RESET_PSAFE_UPDATE,
PM_RESET_OCC_SRAM,
PM_RESET_OCB,
PM_RESET_PSS,
PM_RESET_MAX
PM_RESET_NOTIFY_PRD,
PM_RESET_DONE = 0xFF // Always the last
};

/**
* @brief enumerates all the platforms involved with STOP Recovery.
*/
enum PmComplexPlatId
{
PLAT_NONE = 0x00,
PLAT_INIT = 0x00,
PLAT_CME = 0x01,
PLAT_SGPE = 0x02,
PLAT_PGPE = 0x03,
PLAT_OCC = 0x04,
PLAT_CPPM = 0x05,
PLAT_QPPM = 0x06,
PLAT_MISC = 0x07,
};

/**
Expand Down
Expand Up @@ -76,10 +76,10 @@ namespace p9_stop_recov_ffdc
{
FAPI_DBG (">> PlatOcc::initRegList" );
std::vector < uint32_t> l_scomRegList;
iv_occSummaryReg.push_back( PU_OCB_OCI_CCSR_SCOM );
iv_occSummaryReg.push_back( PU_OCB_OCI_QSSR_SCOM );
iv_occSummaryReg.push_back( P9N2_PU_OCB_OCI_OCCFLG_SCOM );
iv_occSummaryReg.push_back( P9N2_PU_OCB_OCI_OCCFLG2_SCOM );
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 );
l_scomRegList.push_back( P9N2_PU_OCB_OCI_OCCFLG2_SCOM );
PlatPmComplex::updateSummaryList( l_scomRegList );
FAPI_DBG ("<< PlatOcc::initRegList" );
}
Expand Down Expand Up @@ -221,6 +221,7 @@ namespace p9_stop_recov_ffdc
}

fapi_try_exit:
logPmResetPhase (i_pHomerBuf);
FAPI_DBG("<< PlatOcc::collectFfdc");
return fapi2::current_err;
}
Expand Down
Expand Up @@ -107,8 +107,6 @@ namespace p9_stop_recov_ffdc

///@brief initializes a list of register for generation of FFDC summary.
void initRegList();
private:
std::vector<uint32_t> iv_occSummaryReg;
};

//---------------------------------------------------------------------------------------------
Expand Down
Expand Up @@ -167,6 +167,7 @@
}

fapi_try_exit:
logPmResetPhase (i_pHomerBuf);
FAPI_DBG("<< PlatPgpe::collectFfdc");
return fapi2::current_err;
}
Expand Down
Expand Up @@ -135,6 +135,7 @@
}

fapi_try_exit:
logPmResetPhase (i_pHomerBuf);
FAPI_DBG("<< QppmRegs::collectFfdc");
return fapi2::current_err;
}
Expand Down
Expand Up @@ -165,6 +165,7 @@
}

fapi_try_exit:
logPmResetPhase (i_pHomerBuf);
FAPI_DBG("<< PlatSgpe::collectFfdc: 0x%02X", l_ffdcValdityVect);
return fapi2::current_err;
}
Expand Down

0 comments on commit cff2ddb

Please sign in to comment.