From 79722ffa7bc5e02789127242aee534927ba323af Mon Sep 17 00:00:00 2001 From: Sachin Gupta Date: Thu, 7 Sep 2017 23:10:37 -0500 Subject: [PATCH] Mask special attention in MPIPL RTC: 179365 Change-Id: Ifa3dea480329a977cf46bbf8c456134e17795cdd Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45822 Reviewed-by: RAJA DAS Reviewed-by: Shakeeb A. Pasha B K Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: AMIT J. TENDOLKAR Reviewed-by: Sachin Gupta --- src/sbefw/sbecmdiplcontrol.C | 43 +++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/sbefw/sbecmdiplcontrol.C b/src/sbefw/sbecmdiplcontrol.C index 28a705f3b..55d865476 100644 --- a/src/sbefw/sbecmdiplcontrol.C +++ b/src/sbefw/sbecmdiplcontrol.C @@ -44,6 +44,7 @@ #include "fapi2.H" #include "p9_misc_scom_addresses_fld.H" +#include "p9n2_quad_scom_addresses.H" // Pervasive HWP Header Files ( istep 2) #include #include @@ -210,6 +211,9 @@ ReturnCode updatePhbFunctionalState( void ); //Utility function to clear crest error latch ReturnCode resetCrespErrLatch( void ); +//Utility function to mask special attention +inline ReturnCode maskSpecialAttn( const Target& i_target ); + #ifdef SEEPROM_IMAGE // Using function pointer to force long call. p9_sbe_select_ex_FP_t p9_sbe_select_ex_hwp = &p9_sbe_select_ex; @@ -260,7 +264,8 @@ static istepMap_t g_istepMpiplStartPtrTbl[MPIPL_START_MAX_SUBSTEPS] = // Call suspend powerman { &istepWithProc, { .procHwp = &p9_suspend_powman }}, // Find all the child cores within proc and call hwp to know the - // scom state and call instruction control + // scom state and call instruction control. Also mask spl attention + // from core. { &istepWithCoreState, { .coreScomStateHwp = &p9_query_core_access_state }}, // Reset the TPM and clear the TPM deconfig bit, it's not a // procedure but local SBE function @@ -1074,6 +1079,13 @@ ReturnCode istepWithCoreState( sbeIstepHwp_t i_hwp) break; } }while(++l_thread < SMT4_THREAD_MAX); + + l_rc = maskSpecialAttn(l_coreTgt); + if( l_rc != FAPI2_RC_SUCCESS) + { + SBE_ERROR(SBE_FUNC "maskSpecialAttn failed"); + break; + } } } SBE_EXIT(SBE_FUNC); @@ -1235,6 +1247,7 @@ ReturnCode istepStartMpipl( sbeIstepHwp_t i_hwp) SBE_ERROR(SBE_FUNC "resetCrespErrLatch failed"); break; } + }while(0); SBE_EXIT(SBE_FUNC); @@ -1561,6 +1574,34 @@ ReturnCode resetCrespErrLatch( void ) #undef SBE_FUNC } +//---------------------------------------------------------------------------- +inline ReturnCode maskSpecialAttn( const Target& i_target ) +{ +#define SBE_FUNC "maskSpecialAttn " + SBE_ENTER(SBE_FUNC); + ReturnCode rc = FAPI2_RC_SUCCESS; + do + { + uint64_t maskData = 0; + const uint64_t ecMask = 0xffc0000000000000; + rc = getscom_abs_wrap (&i_target, P9N2_EX_SPA_MASK, &maskData ); + if( rc ) + { + SBE_ERROR(SBE_FUNC" Failed to read P9N2_EX_SPA_MASK"); + break; + } + maskData = maskData | ecMask; + rc = putscom_abs_wrap (&i_target, P9N2_EX_SPA_MASK, maskData ); + if( rc ) + { + SBE_ERROR(SBE_FUNC" Failed to write P9N2_EX_SPA_MASK"); + break; + } + }while(0); + SBE_EXIT(SBE_FUNC); + return rc; +#undef SBE_FUNC +} /////////////////////////////////////////////////////////////////////// // @brief sbeHandleSuspendIO Sbe suspend IO function //