diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup_lib.H b/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup_lib.H index cd43194278a..08fc4b73ad8 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup_lib.H +++ b/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup_lib.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -542,7 +542,7 @@ fapi2::ReturnCode _spwkup_deassert( const fapi2::Target& i_chipletTarget, FAPI_TRY(fapi2::putScom(l_parentTarget, i_address, l_data64), "PutScom of Special Wake-up register failed"); FAPI_DBG(" %s: After clear putscom of SPWKUP_REG (0x%08llx) => 0x%016llx", - *(p9specialWakeup::SPWK_MSG_LIST[i_msgId]), + (p9specialWakeup::SPWK_MSG_LIST[i_msgId]), i_address, l_data64); } @@ -551,7 +551,7 @@ fapi2::ReturnCode _spwkup_deassert( const fapi2::Target& i_chipletTarget, FAPI_TRY(fapi2::getScom(l_parentTarget, i_address, l_data64), "GetScom of Special Wake-up failed"); FAPI_DBG(" %s: After read (delay) of SPWKUP_REG (0x%08llx) 0x%016llx", - *(p9specialWakeup::SPWK_MSG_LIST[i_msgId]), + (p9specialWakeup::SPWK_MSG_LIST[i_msgId]), i_address, l_data64); @@ -620,22 +620,24 @@ fapi2::ReturnCode _special_wakeup(const fapi2::Target& i_chipletTarget, do { - // Read system checkstop indicator - FAPI_TRY(fapi2::getScom(l_parentTarget, - PU_OCB_OCI_OCCFLG_SCOM, - occFlagReg), - "GetScom of OCC Flag Register Failed"); - - if( !occFlagReg.getBit() ) - { - FAPI_INF("SGPE not active. STOP Sub-System not ready for special wakeup" ); - break; - } - switch (i_operation) { case p9specialWakeup::SPCWKUP_ENABLE: + // Check if PM subsystem is ready for SPW + // Moved under wakeup enable, because always want to let + // SPW to be cleared + FAPI_TRY(fapi2::getScom(l_parentTarget, + PU_OCB_OCI_OCCFLG_SCOM, + occFlagReg), + "GetScom of OCC Flag Register Failed"); + + if( !occFlagReg.getBit() ) + { + FAPI_INF("SGPE not active. STOP Sub-System not ready for special wakeup" ); + break; + } + // Select the addresses to use based on the entity FAPI_TRY(spwkup_setup_entity(i_chipletTarget, i_entity, processing_info), "Error: spwkup_setup_entity failed");