diff options
11 files changed, 319 insertions, 52 deletions
diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_check_idle_stop_done.C b/src/import/chips/p9/procedures/hwp/pm/p9_check_idle_stop_done.C index 688097974..9433e2cc7 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_check_idle_stop_done.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_check_idle_stop_done.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -43,7 +43,10 @@ #include <p9_ppe_defs.H> #include <p9_ppe_utils.H> #include <p9_eq_clear_atomic_lock.H> +#include <p9_pm_recovery_ffdc_sgpe.H> +#include <p9_pm_recovery_ffdc_cme.H> +using namespace p9_stop_recov_ffdc; namespace p9_check_idle_stop { @@ -180,6 +183,15 @@ class CmeState return iv_xsrRegValue; } + /** + * @brief collects the FFDC from SRAM of CME + * @param[in] i_procChipTgt fapi2 target for proc chip + * @param[in] i_ffdcVarBuf variable buffer + * @return FAPI2_RC_SUCCESS for success, error code otherwise. + */ + fapi2::ReturnCode collectSramFfdc( fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP >& i_procChipTgt, + fapi2::variable_buffer& i_ffdcVarBuf ); + private: uint8_t iv_cmePos; // CME Position uint16_t iv_cmeHcodeState; // State of CME @@ -418,6 +430,36 @@ void CmeState::dumpCmeState() //---------------------------------------------------------------------------------------------- +fapi2::ReturnCode CmeState::collectSramFfdc( fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP >& i_procChipTgt, + fapi2::variable_buffer& i_ffdcVarBuf ) +{ + FAPI_DBG(">> CmeState::collectSramFfdc"); + uint32_t l_ffdcLength = i_ffdcVarBuf.template getLength<uint8_t>(); + uint8_t l_exPos = 0; + PlatCme l_cmeFfdc( i_procChipTgt ); + + auto l_exList = i_procChipTgt.getChildren< fapi2::TARGET_TYPE_EX > (); + + for ( auto ex : l_exList ) + { + FAPI_TRY( FAPI_ATTR_GET( fapi2::ATTR_CHIP_UNIT_POS, ex, l_exPos ), + "FAPI_ATTR_GET Failed To Read EX Position" ); + + if( l_exPos == getCmePosition() ) + { + l_cmeFfdc.collectPartialFfdc( (uint8_t*)i_ffdcVarBuf.pointer(), DASH_BOARD_VAR, ex, l_ffdcLength ); + FAPI_DBG("CME Globals Size %d", l_ffdcLength ); + break; + } + } + +fapi_try_exit: + FAPI_DBG("<< CmeState::collectSramFfdc"); + return fapi2::current_err; +} + +//---------------------------------------------------------------------------------------------- + /** * @brief Models SGPE State * @note Collect hardware state of SGPE by reading some SPRs and status register. @@ -460,6 +502,8 @@ class SgpeState * @return fapi2 RC */ fapi2::ReturnCode init( fapi2::Target< fapi2::TARGET_TYPE_EX >& i_exTgt ); + fapi2::ReturnCode collectSramFfdc( fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP >& i_procChipTgt, + fapi2::variable_buffer& i_ffdcVarBuf ); /** * @brief dumps state of SGPE @@ -601,6 +645,22 @@ void SgpeState::dumpSgpeState( ) #endif } + +//---------------------------------------------------------------------------------------------- + +fapi2::ReturnCode SgpeState::collectSramFfdc( fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP >& i_procChipTgt, + fapi2::variable_buffer& i_ffdcVarBuf ) +{ + FAPI_DBG(">> SgpeState::collectSramFfdc"); + uint32_t l_ffdcLength = i_ffdcVarBuf.template getLength<uint8_t>(); + PlatSgpe l_sgpeFfdc( i_procChipTgt ); + + l_sgpeFfdc.collectPartialFfdc( (uint8_t*)i_ffdcVarBuf.pointer(), DASH_BOARD_VAR, l_ffdcLength ); + FAPI_DBG("SGPE Globals Size %d", l_ffdcLength ); + FAPI_DBG("<< SgpeState::collectSramFfdc"); + return fapi2::current_err; +} + //---------------------------------------------------------------------------------------------- class StopFfdcRules @@ -693,8 +753,8 @@ class StopFfdcRules private: - SgpeState iv_SgpeState; // Summarizes state of SGPE - CmeState iv_CmeState; // Summarizes state of CME + SgpeState iv_sgpeState; // Summarizes state of SGPE + CmeState iv_cmeState; // Summarizes state of CME fapi2::Target < fapi2::TARGET_TYPE_CORE > iv_coreTgt; // fapi2 core target fapi2::Target < fapi2::TARGET_TYPE_EX > iv_exTgt; // fapi2 ex target fapi2::Target < fapi2::TARGET_TYPE_EQ > iv_eqTgt; // fapi2 eq target @@ -712,10 +772,10 @@ fapi2::ReturnCode StopFfdcRules::init() iv_eqTgt = iv_exTgt.getParent<fapi2::TARGET_TYPE_EQ>(); iv_procTgt = iv_exTgt.getParent<fapi2::TARGET_TYPE_PROC_CHIP>(); - FAPI_TRY( iv_SgpeState.init( iv_exTgt ), + FAPI_TRY( iv_sgpeState.init( iv_exTgt ), "SGPE Init Failed" ); - if( !iv_CmeState.checkCmeStatus( iv_exTgt ) && iv_SgpeState.isSgpeRunning() ) + if( !iv_cmeState.checkCmeStatus( iv_exTgt ) && iv_sgpeState.isSgpeRunning() ) { //SGPE is running but CME is not accessible. It might be because of //atomic lock taken by SGPE. So, halt SGPE and drop atomic lock to make @@ -728,11 +788,11 @@ fapi2::ReturnCode StopFfdcRules::init() "Failed To Clear Atomic Lock" ); } - FAPI_TRY( iv_CmeState.init( iv_coreTgt ), + FAPI_TRY( iv_cmeState.init( iv_coreTgt ), "Failure In Getting CME State" ); - iv_SgpeState.dumpSgpeState(); - iv_CmeState.dumpCmeState(); + iv_sgpeState.dumpSgpeState(); + iv_cmeState.dumpCmeState(); fapi_try_exit: FAPI_DBG("<< StopFfdcRules::init"); @@ -741,6 +801,8 @@ fapi_try_exit: //---------------------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------------------- + fapi2::ReturnCode StopFfdcRules::forceSgpeHalt( ) { FAPI_DBG(">> StopFfdcRules::forceSgpeHalt" ); @@ -800,13 +862,13 @@ fapi2::ReturnCode StopFfdcRules::analyze( ) //------------------------------------------------------------------------- //************************************************************************* - if( !iv_SgpeState.isSgpeRunning() ) + if( !iv_sgpeState.isSgpeRunning() ) { - if( iv_SgpeState.isSgpeHcodeHalted() ) + if( iv_sgpeState.isSgpeHcodeHalted() ) { l_retCode = assertSgpeHcodeHalted(); } - else if( iv_SgpeState.isSgpeHalted() ) + else if( iv_sgpeState.isSgpeHalted() ) { l_retCode = assertSgpeHardwareHalted(); } @@ -816,23 +878,23 @@ fapi2::ReturnCode StopFfdcRules::analyze( ) } } - else if( !iv_CmeState.isCmeOnLine() ) + else if( !iv_cmeState.isCmeOnLine() ) { l_retCode = assertCmeNotAccessible(); } - else if( iv_CmeState.isCoreReportingSpecialAttn() ) + else if( iv_cmeState.isCoreReportingSpecialAttn() ) { l_retCode = assertCoreAttention(); } - else if( iv_CmeState.isCmeHcodeHalted() ) + else if( iv_cmeState.isCmeHcodeHalted() ) { l_retCode = assertCmeHcodeHalt(); } - else if ( iv_CmeState.isCmeHalted() ) + else if ( iv_cmeState.isCmeHalted() ) { l_retCode = assertCmeHalted(); } - else if( !iv_CmeState.isPmActive() && !iv_CmeState.isStopGated() ) + else if( !iv_cmeState.isPmActive() && !iv_cmeState.isStopGated() ) { l_retCode = assertCoreRunning(); } @@ -863,6 +925,8 @@ fapi2::ReturnCode StopFfdcRules::assertSgpeHardwareHalted() std::vector<uint64_t> l_sgpeBaseAddress; fapi2::buffer<uint64_t> l_occLfirBuf; fapi2::buffer<uint64_t> l_sshCore[MAX_CORE_PER_QUAD]; + fapi2::variable_buffer l_sgpeFfdc( HALF_KB * 8 ); + //Since we need to assert RC anyway, we will ignore getScom //error and procced all the way till end. @@ -897,6 +961,7 @@ fapi2::ReturnCode StopFfdcRules::assertSgpeHardwareHalted() } l_sgpeBaseAddress.push_back( SGPE_BASE_ADDRESS ); + iv_sgpeState.collectSramFfdc( iv_procTgt, l_sgpeFfdc ); FAPI_ASSERT( false, fapi2::SGPE_HW_HALTED() @@ -905,11 +970,12 @@ fapi2::ReturnCode StopFfdcRules::assertSgpeHardwareHalted() .set_PPE_STATE_MODE( HALT ) .set_PPE_BASE_ADDRESS_LIST( l_sgpeBaseAddress ) .set_OCC_LFIR( l_occLfirBuf ) - .set_EDR( iv_SgpeState.getEdrValue() ) + .set_EDR( iv_sgpeState.getEdrValue() ) .set_SSH_CORE_0( l_sshCore[0] ) .set_SSH_CORE_1( l_sshCore[1] ) .set_SSH_CORE_2( l_sshCore[2] ) - .set_SSH_CORE_3( l_sshCore[3] ), + .set_SSH_CORE_3( l_sshCore[3] ) + .set_SGPE_GLOBAL_VARS( l_sgpeFfdc ), "SGPE Is Halted Due To HW Error" ); fapi_try_exit: @@ -933,6 +999,7 @@ fapi2::ReturnCode StopFfdcRules::assertSgpeHcodeHalted( ) fapi2::buffer<uint64_t> l_occLfirBuf; std::vector<uint64_t> l_sgpeBaseAddress; fapi2::ReturnCode l_retCode = fapi2::FAPI2_RC_SUCCESS; + fapi2::variable_buffer l_sgpeFfdc( HALF_KB * 8 ); //Since we need to assert RC anyway, we will ignore getScom //error and procced all the way till end. @@ -944,6 +1011,7 @@ fapi2::ReturnCode StopFfdcRules::assertSgpeHcodeHalted( ) } l_sgpeBaseAddress.push_back( SGPE_BASE_ADDRESS ); + iv_sgpeState.collectSramFfdc( iv_procTgt, l_sgpeFfdc ); FAPI_ASSERT( false, @@ -952,7 +1020,8 @@ fapi2::ReturnCode StopFfdcRules::assertSgpeHcodeHalted( ) .set_CHIP( iv_procTgt ) .set_PPE_STATE_MODE( HALT ) .set_PPE_BASE_ADDRESS_LIST( l_sgpeBaseAddress ) - .set_OCC_LFIR( l_occLfirBuf ), + .set_OCC_LFIR( l_occLfirBuf ) + .set_SGPE_GLOBAL_VARS( l_sgpeFfdc ), "SGPE Hcode Is Halted" ); fapi_try_exit: @@ -981,7 +1050,7 @@ fapi2::ReturnCode StopFfdcRules::assertCoreAttention() FAPI_ASSERT( false, fapi2::CORE_ATTENTION() .set_CORE( iv_coreTgt ) - .set_XSR_VALUE( iv_CmeState.getXsrRegValue() ) + .set_XSR_VALUE( iv_cmeState.getXsrRegValue() ) .set_SISR_VALUE( l_sisrRegVal ), "Core Reporting Special Attention" ); @@ -1008,9 +1077,11 @@ fapi2::ReturnCode StopFfdcRules::assertCmeHcodeHalt() fapi2::buffer<uint64_t> l_sshCore[MAX_CORE_PER_EX]; fapi2::buffer<uint64_t> l_occLfirBuf; fapi2::ReturnCode l_retCode = fapi2::FAPI2_RC_SUCCESS; + fapi2::variable_buffer l_sgpeFfdc( HALF_KB * 8 ); + fapi2::variable_buffer l_cmeFfdc( HALF_KB * 8 ); uint8_t l_coreId = 0; std::vector<uint64_t> l_cmeBaseAddress; - l_cmeBaseAddress.push_back( getCmeBaseAddress( iv_CmeState.getCmePosition() ) ); + l_cmeBaseAddress.push_back( getCmeBaseAddress( iv_cmeState.getCmePosition() ) ); auto l_coreList = iv_exTgt.getChildren<fapi2::TARGET_TYPE_CORE>( fapi2::TARGET_STATE_PRESENT ); //Since we need to assert RC anyway, we will ignore getScom @@ -1039,6 +1110,9 @@ fapi2::ReturnCode StopFfdcRules::assertCmeHcodeHalt() l_coreId++; } + iv_sgpeState.collectSramFfdc( iv_procTgt, l_sgpeFfdc ); + iv_cmeState.collectSramFfdc( iv_procTgt, l_cmeFfdc ); + FAPI_ASSERT( false, fapi2::CME_HCODE_HALTED() .set_EQ_TARGET( iv_eqTgt ) @@ -1048,7 +1122,9 @@ fapi2::ReturnCode StopFfdcRules::assertCmeHcodeHalt() .set_OCC_LFIR( l_occLfirBuf ) .set_SSH_CORE_0( l_sshCore[0] ) .set_SSH_CORE_1( l_sshCore[1] ) - .set_EX( iv_exTgt ), + .set_EX( iv_exTgt ) + .set_CME_GLOBAL_VARS( l_cmeFfdc ) + .set_SGPE_GLOBAL_VARS( l_sgpeFfdc ), "CME Hcode Invoking Halt" ); fapi_try_exit: @@ -1077,9 +1153,11 @@ fapi2::ReturnCode StopFfdcRules::assertCmeHalted() fapi2::buffer<uint64_t> l_netCtrl[MAX_CORE_PER_EX]; fapi2::buffer<uint64_t> l_occLfirBuf; fapi2::ReturnCode l_retCode = fapi2::FAPI2_RC_SUCCESS; + fapi2::variable_buffer l_sgpeFfdc( HALF_KB * 8 ); + fapi2::variable_buffer l_cmeFfdc( HALF_KB * 8 ); uint8_t l_coreId = 0; std::vector<uint64_t> l_cmeBaseAddress; - l_cmeBaseAddress.push_back( getCmeBaseAddress( iv_CmeState.getCmePosition() ) ); + l_cmeBaseAddress.push_back( getCmeBaseAddress( iv_cmeState.getCmePosition() ) ); //Since we need to assert RC anyway, we will ignore getScom //error and procced all the way till end. @@ -1111,6 +1189,9 @@ fapi2::ReturnCode StopFfdcRules::assertCmeHalted() l_coreId++; } + iv_sgpeState.collectSramFfdc( iv_procTgt, l_sgpeFfdc ); + iv_cmeState.collectSramFfdc( iv_procTgt, l_cmeFfdc ); + FAPI_ASSERT( false, fapi2::CME_ERROR_HALT() .set_EQ_TARGET( iv_eqTgt ) @@ -1126,7 +1207,9 @@ fapi2::ReturnCode StopFfdcRules::assertCmeHalted() .set_GPMMR_0( l_gpmmr[0] ) .set_GPMMR_1( l_gpmmr[1] ) .set_SSH_CORE_0( l_sshCore[0] ) - .set_SSH_CORE_1( l_sshCore[1] ), + .set_SSH_CORE_1( l_sshCore[1] ) + .set_CME_GLOBAL_VARS( l_cmeFfdc ) + .set_SGPE_GLOBAL_VARS( l_sgpeFfdc ), "CME Halted Due To HW Error" ); fapi_try_exit: @@ -1170,14 +1253,11 @@ fapi_try_exit: fapi2::ReturnCode StopFfdcRules::assertCoreRunning() { FAPI_DBG( ">> StopFfdcRules::assertCoreRunning" ); - - FAPI_ASSERT( false, - fapi2::CORE_POWERED_AND_RUNNING(), - "Core(s) Is Not In Any STOP State And Running" ); - -fapi_try_exit: + //PM Complex is healthy and Cores are powered up + //and accessible. Hence, simply return SUCCESS FAPI_DBG( "<< StopFfdcRules::assertCoreRunning" ); - return fapi2::current_err; + return fapi2::FAPI2_RC_SUCCESS; + } //---------------------------------------------------------------------------------------------- @@ -1201,10 +1281,12 @@ fapi2::ReturnCode StopFfdcRules::assertPmUnknown() fapi2::buffer<uint64_t> l_netCtrl[MAX_CORE_PER_EX]; fapi2::buffer<uint64_t> l_occLfirBuf; fapi2::ReturnCode l_retCode = fapi2::FAPI2_RC_SUCCESS; + fapi2::variable_buffer l_sgpeFfdc( HALF_KB * 8 ); + fapi2::variable_buffer l_cmeFfdc( HALF_KB * 8 ); uint8_t l_coreId = 0; std::vector<uint64_t> l_cmeBaseAddress; - l_cmeBaseAddress.push_back( getCmeBaseAddress( iv_CmeState.getCmePosition() ) ); + l_cmeBaseAddress.push_back( getCmeBaseAddress( iv_cmeState.getCmePosition() ) ); auto l_coreList = iv_exTgt.getChildren<fapi2::TARGET_TYPE_CORE>( fapi2::TARGET_STATE_PRESENT ); //Since we need to assert RC anyway, we will ignore getScom @@ -1235,8 +1317,11 @@ fapi2::ReturnCode StopFfdcRules::assertPmUnknown() l_coreId++; } + iv_sgpeState.collectSramFfdc( iv_procTgt, l_sgpeFfdc ); + iv_cmeState.collectSramFfdc( iv_procTgt, l_cmeFfdc ); + FAPI_ASSERT( false, - fapi2::CME_ERROR_HALT() + fapi2::UNKNOWN_PM_STATE() .set_EQ_TARGET( iv_eqTgt ) .set_CHIP( iv_procTgt ) .set_EX( iv_exTgt ) @@ -1250,7 +1335,9 @@ fapi2::ReturnCode StopFfdcRules::assertPmUnknown() .set_GPMMR_0( l_gpmmr[0] ) .set_GPMMR_1( l_gpmmr[1] ) .set_SSH_CORE_0( l_sshCore[0] ) - .set_SSH_CORE_1( l_sshCore[1] ), + .set_SSH_CORE_1( l_sshCore[1] ) + .set_CME_GLOBAL_VARS( l_cmeFfdc ) + .set_SGPE_GLOBAL_VARS( l_sgpeFfdc ), "An Unknown Problem In PM Complex" ); fapi_try_exit: diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_check_idle_stop_done.mk b/src/import/chips/p9/procedures/hwp/pm/p9_check_idle_stop_done.mk index cf036a513..b6b5aab85 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_check_idle_stop_done.mk +++ b/src/import/chips/p9/procedures/hwp/pm/p9_check_idle_stop_done.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2017 +# Contributors Listed Below - COPYRIGHT 2017,2018 # [+] International Business Machines Corp. # # @@ -26,5 +26,11 @@ PROCEDURE = p9_check_idle_stop_done HWP_INC = $(ROOTPATH)/chips/p9/common/pmlib/include/registers/ HWP_INC += $(ROOTPATH)/chips/p9/procedures/hwp/lib lib$(PROCEDURE)_DEPLIBS += p9_eq_clear_atomic_lock +lib$(PROCEDURE)_DEPLIBS += p9_cme_sram_access +lib$(PROCEDURE)_DEPLIBS += p9_pm_ocb_indir_setup_linear +lib$(PROCEDURE)_DEPLIBS += p9_pm_ocb_indir_access +lib$(PROCEDURE)_DEPLIBS += p9_pm_recovery_ffdc_base +lib$(PROCEDURE)_DEPLIBS += p9_pm_recovery_ffdc_sgpe +lib$(PROCEDURE)_DEPLIBS += p9_pm_recovery_ffdc_cme $(call ADD_MODULE_INCDIR,$(PROCEDURE),$(HWP_INC)) $(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.C index ac78cfe65..dc866929a 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -475,6 +475,23 @@ namespace p9_stop_recov_ffdc //--------------------------------------------------------------------------------------------- + fapi2::ReturnCode PlatPmComplex::collectPartialFfdc( void * i_pBuf, FfdcDataType i_dataType, + fapi2::Target<fapi2::TARGET_TYPE_EX >& i_exTgt, + uint32_t & o_ffdcLength ) + { + return fapi2::FAPI2_RC_SUCCESS; + } + + //--------------------------------------------------------------------------------------------- + + fapi2::ReturnCode PlatPmComplex::collectPartialFfdc( void * i_pBuf, FfdcDataType i_dataType, + uint32_t & o_ffdcLength ) + { + return fapi2::FAPI2_RC_SUCCESS; + } + + //--------------------------------------------------------------------------------------------- + extern "C" { fapi2::ReturnCode p9_pm_recovery_ffdc_base ( @@ -520,4 +537,5 @@ extern "C" } -} //namespace p9_stop_recov_ffdc ends + +}//namespace p9_stop_recov_ffdc ends diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.H b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.H index c8b56f6da..4e9ca5f06 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.H +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_base.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -82,6 +82,28 @@ namespace p9_stop_recov_ffdc /// @brief returns proc chip target associated with platform fapi2::Target< fapi2::TARGET_TYPE_PROC_CHIP > getProcChip() const { return iv_procChip; } + /// @brief collects FFDC pertaining to a given target. + /// @param[in] i_pBuf points to base of FFDC buffer. + /// @param[in] i_dataType indicates the content type to collect + /// @param[in] i_exTgt ex target + /// @param[in] o_ffdcLength length of FFDC in bytes + /// @return fapi2 return code. + /// @note function intends to copy FFDC pertaining to CME and SGPE to + /// an error log. + virtual fapi2::ReturnCode collectPartialFfdc( void * i_pBuf, FfdcDataType i_dataType, + fapi2::Target<fapi2::TARGET_TYPE_EX >& i_exTgt, + uint32_t & o_ffdcLength ); + + /// @brief collects FFDC pertaining to a given target. + /// @param[in] i_pBuf points to base of FFDC buffer. + /// @param[in] i_dataType indicates the content type to collect + /// @param[in] o_ffdcLength length of FFDC in bytes + /// @return fapi2 return code. + /// @note function intends to copy FFDC pertaining to CME and SGPE to + /// an error log. + virtual fapi2::ReturnCode collectPartialFfdc( void * i_pBuf, FfdcDataType i_dataType, + uint32_t & o_ffdcLength ); + /// @brief sets start address of platform's trace buffer. void setTraceBufAddr (uint32_t i_addr) { iv_traceBufBaseAddress = i_addr; } diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_cme.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_cme.C index 5be51b1e9..2b6f5cc0f 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_cme.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_cme.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -227,6 +227,56 @@ //----------------------------------------------------------------------- + fapi2::ReturnCode PlatCme::collectPartialFfdc( void * i_pBuf, FfdcDataType i_dataType, + fapi2::Target<fapi2::TARGET_TYPE_EX >& i_exTgt, + uint32_t & o_ffdcLength ) + { + FAPI_DBG(">> PlatSgpe::collectPartialFfdc"); + fapi2::ReturnCode l_retCode = fapi2::FAPI2_RC_SUCCESS; + uint32_t l_maxSize = o_ffdcLength; + FAPI_DBG("Max buf size %d", o_ffdcLength ); + + switch( i_dataType ) + { + case IMAGE_HEADER: + o_ffdcLength = FFDC_PPE_IMG_HDR_SIZE; + break; + case DASH_BOARD_VAR: + o_ffdcLength = FFDC_PPE_SCORE_BOARD_SIZE; + break; + case TRACES: + o_ffdcLength = FFDC_PPE_TRACES_SIZE; + break; + default: + FAPI_ERR("Bad FFDC Data type. Skipping 0x%d", (uint32_t)i_dataType ); + goto fapi_try_exit; + break; + } + + if( !i_pBuf ) + { + FAPI_ERR("Bad FFDC Buffer" ); + goto fapi_try_exit; + } + + if( o_ffdcLength > l_maxSize ) + { + o_ffdcLength = l_maxSize; + } + + FAPI_TRY( PlatPmComplex::collectSramInfo( i_exTgt, + (uint8_t*)i_pBuf, + i_dataType, + o_ffdcLength ), + "Failed To Collect CME SRAM FFDC" ); + + fapi_try_exit: + FAPI_DBG("<< PlatSgpe::collectPartialFfdc"); + return fapi2::current_err; + } + + //----------------------------------------------------------------------- + fapi2::ReturnCode PlatCme::collectTrace( uint8_t * i_pTraceBuf, const fapi2::Target<fapi2::TARGET_TYPE_EX >& i_exTgt ) { diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_cme.H b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_cme.H index f61f22dab..0538bebaa 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_cme.H +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_cme.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -67,6 +67,18 @@ namespace p9_stop_recov_ffdc fapi2::ReturnCode collectFfdc( void* i_pHomerBuf, uint8_t i_ffdcType = ALL ); + /// @brief collects FFDC pertaining to a given CME target. + /// @param[in] i_pBuf points to base of FFDC buffer. + /// @param[in] i_dataType indicates the content type to collect + /// @param[in] i_exTgt ex target + /// @param[in] o_ffdcLength length of FFDC in bytes + /// @return fapi2 return code. + /// @note function intends to copy FFDC pertaining to CME and SGPE to + /// an error log. + fapi2::ReturnCode collectPartialFfdc( void * i_pBuf, FfdcDataType i_dataType, + fapi2::Target<fapi2::TARGET_TYPE_EX >& i_exTgt, + uint32_t & o_ffdcLength ); + private: /// @brief collects trace info from a given CME SRAM buffer. /// @param[in] i_pHomerBuf points to location of HOMER meant for CME Trace info. diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_sgpe.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_sgpe.C index 512b8b91e..57730ebde 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_sgpe.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_sgpe.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -165,6 +165,56 @@ //----------------------------------------------------------------------- + fapi2::ReturnCode PlatSgpe::collectPartialFfdc( void * i_pBuf, FfdcDataType i_dataType, + uint32_t & o_ffdcLength ) + { + FAPI_DBG(">> PlatSgpe::collectPartialFfdc"); + fapi2::ReturnCode l_retCode = fapi2::FAPI2_RC_SUCCESS; + uint32_t l_maxSize = o_ffdcLength; + FAPI_DBG("Max buf size %d", o_ffdcLength ); + + switch( i_dataType ) + { + case IMAGE_HEADER: + o_ffdcLength = FFDC_PPE_IMG_HDR_SIZE; + break; + case DASH_BOARD_VAR: + o_ffdcLength = OCC_SRAM_SGPE_DASHBOARD_SIZE; + break; + case TRACES: + o_ffdcLength = FFDC_PPE_TRACES_SIZE; + break; + default: + FAPI_ERR("Bad FFDC Data type. Skipping 0x%d", (uint32_t)i_dataType ); + goto fapi_try_exit; + break; + } + + if( !i_pBuf ) + { + FAPI_ERR("Bad Buffer Ptr" ); + goto fapi_try_exit; + } + + if( o_ffdcLength > l_maxSize ) + { + o_ffdcLength = l_maxSize; + } + + FAPI_TRY( PlatPmComplex::collectSramInfo( PlatPmComplex::getProcChip(), + (uint8_t*)i_pBuf, + i_dataType, + o_ffdcLength ), + "Failed To Collect SGPE SRAM FFDC" ); + + + fapi_try_exit: + FAPI_DBG("<< PlatSgpe::collectPartialFfdc"); + return fapi2::current_err; + } + + //----------------------------------------------------------------------- + fapi2::ReturnCode PlatSgpe::collectTrace( uint8_t * i_pTraceBuf ) { FAPI_DBG(">> PlatSgpe::collectTrace" ); @@ -189,6 +239,7 @@ fapi2::ReturnCode PlatSgpe::collectGlobals( uint8_t * i_pSgpeGlobals ) { FAPI_DBG(">> PlatSgpe::collectGlobals" ); + PpeFfdcLayout * l_pSgpeFfdc = ( PpeFfdcLayout *) ( i_pSgpeGlobals ); uint8_t * l_pTraceLoc = &l_pSgpeFfdc->iv_ppeGlobals[0]; @@ -201,6 +252,7 @@ fapi_try_exit: + FAPI_DBG("<< PlatSgpe::collectGlobals" ); return fapi2::current_err; } diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_sgpe.H b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_sgpe.H index 640cc0651..5d46658da 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_sgpe.H +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_recovery_ffdc_sgpe.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* Contributors Listed Below - COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -67,6 +67,9 @@ namespace p9_stop_recov_ffdc fapi2::ReturnCode collectFfdc( void* i_pHomerBuf, uint8_t i_ffdcType = ALL ); + virtual fapi2::ReturnCode collectPartialFfdc( void * i_pHomerBuf, FfdcDataType i_ffdcType , + uint32_t & o_ffdcLength ); + private: /// @brief collects trace info from SGPE's SRAM buffer. /// @param[in] i_pHomerBuf points to location of HOMER meant for SGPE Trace info. diff --git a/src/import/chips/p9/procedures/xml/error_info/p9_check_idle_stop_done_errors.xml b/src/import/chips/p9/procedures/xml/error_info/p9_check_idle_stop_done_errors.xml index 8c4113431..bd87f71e6 100644 --- a/src/import/chips/p9/procedures/xml/error_info/p9_check_idle_stop_done_errors.xml +++ b/src/import/chips/p9/procedures/xml/error_info/p9_check_idle_stop_done_errors.xml @@ -5,7 +5,7 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- Contributors Listed Below - COPYRIGHT 2015,2017 --> +<!-- Contributors Listed Below - COPYRIGHT 2015,2018 --> <!-- [+] International Business Machines Corp. --> <!-- --> <!-- --> @@ -53,6 +53,8 @@ <targetType>TARGET_TYPE_PROC_CHIP</targetType> </collectRegisterFfdc> + <buffer>SGPE_GLOBAL_VARS</buffer> + </hwpError> <!-- *********************************************************************** --> @@ -87,6 +89,7 @@ <target>CHIP</target> <targetType>TARGET_TYPE_PROC_CHIP</targetType> </collectRegisterFfdc> + <buffer>SGPE_GLOBAL_VARS</buffer> </hwpError> @@ -178,6 +181,8 @@ <target>EX</target> <targetType>TARGET_TYPE_EX</targetType> </collectRegisterFfdc> + <buffer>CME_GLOBAL_VARS</buffer> + <buffer>SGPE_GLOBAL_VARS</buffer> </hwpError> <!-- *********************************************************************** --> @@ -223,13 +228,8 @@ <target>EX</target> <targetType>TARGET_TYPE_EX</targetType> </collectRegisterFfdc> - </hwpError> - - <!-- *********************************************************************** --> - - <hwpError> - <rc>RC_CORE_POWERED_AND_RUNNING</rc> - <description> Core is powered up and not in any STOP state, therefore active</description> + <buffer>CME_GLOBAL_VARS</buffer> + <buffer>SGPE_GLOBAL_VARS</buffer> </hwpError> <!-- *********************************************************************** --> @@ -268,6 +268,9 @@ <targetType>TARGET_TYPE_EX</targetType> </collectRegisterFfdc> + <buffer>CME_GLOBAL_VARS</buffer> + <buffer>SGPE_GLOBAL_VARS</buffer> + </hwpError> <!-- *********************************************************************** --> diff --git a/src/usr/isteps/istep16/makefile b/src/usr/isteps/istep16/makefile index cbf4811ef..8ceb38149 100644 --- a/src/usr/isteps/istep16/makefile +++ b/src/usr/isteps/istep16/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2015,2017 +# Contributors Listed Below - COPYRIGHT 2015,2018 # [+] International Business Machines Corp. # # @@ -57,6 +57,12 @@ include ${PROCEDURES_PATH}/hwp/nest/p9_rng_init_phase2.mk include ${PROCEDURES_PATH}/hwp/io/p9_io_xbus_image_build.mk include ${PROCEDURES_PATH}/hwp/io/p9_io_obus_image_build.mk include ${PROCEDURES_PATH}/hwp/pm/p9_check_idle_stop_done.mk +include ${PROCEDURES_PATH}/hwp/pm/p9_cme_sram_access.mk +include ${PROCEDURES_PATH}/hwp/pm/p9_pm_ocb_indir_setup_linear.mk +include ${PROCEDURES_PATH}/hwp/pm/p9_pm_ocb_indir_access.mk +include ${PROCEDURES_PATH}/hwp/pm/p9_pm_recovery_ffdc_base.mk +include ${PROCEDURES_PATH}/hwp/pm/p9_pm_recovery_ffdc_sgpe.mk +include ${PROCEDURES_PATH}/hwp/pm/p9_pm_recovery_ffdc_cme.mk include ${ROOTPATH}/config.mk diff --git a/src/usr/isteps/pm/pm.mk b/src/usr/isteps/pm/pm.mk index cda283bed..6085fcb4a 100644 --- a/src/usr/isteps/pm/pm.mk +++ b/src/usr/isteps/pm/pm.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2016,2017 +# Contributors Listed Below - COPYRIGHT 2016,2018 # [+] International Business Machines Corp. # # @@ -120,3 +120,11 @@ include ${HWP_PM_PATH}/p9_pstate_parameter_block.mk include ${HWP_PM_PATH}/p9_pm_get_poundv_bucket.mk include ${HWP_PM_PATH}/p9_pm_pstate_gpe_init.mk include ${HWP_PM_PATH}/p9_check_proc_config.mk +include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_base.mk +include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_cme.mk +include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_sgpe.mk +include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_pgpe.mk +include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_cppm.mk +include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_qppm.mk +include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_occ.mk +include ${HWP_PM_PATH}/p9_cme_sram_access.mk |