diff options
4 files changed, 72 insertions, 17 deletions
diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_init.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_init.C index 44f921347..1c3526b13 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_init.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_init.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -121,6 +121,8 @@ fapi2::ReturnCode pm_init( FAPI_INF("Entering pm_init..."); fapi2::ReturnCode l_rc; + fapi2::ATTR_PM_MALF_CYCLE_Type l_malfCycle = + fapi2::ENUM_ATTR_PM_MALF_CYCLE_INACTIVE; // ************************************************************************ // Initialize Cores and Quads @@ -215,11 +217,26 @@ fapi2::ReturnCode pm_init( // ************************************************************************ // Take all EX chiplets out of special wakeup // ************************************************************************ - FAPI_DBG("Disable special wakeup for all functional EX targets."); - FAPI_TRY(special_wakeup_all(i_target, - false),//Disable splwkup - "ERROR: Failed to remove EX chiplets from special wakeup"); - FAPI_TRY(p9_pm_glob_fir_trace(i_target, "After EX out of special wakeup")); + FAPI_TRY (FAPI_ATTR_GET (fapi2::ATTR_PM_MALF_CYCLE, i_target, + l_malfCycle)); + + if (l_malfCycle == fapi2::ENUM_ATTR_PM_MALF_CYCLE_INACTIVE) + { + FAPI_DBG("Disable special wakeup for all functional EX targets."); + FAPI_TRY(special_wakeup_all(i_target, + false),//Disable splwkup + "ERROR: Failed to remove EX chiplets from special wakeup"); + FAPI_TRY(p9_pm_glob_fir_trace(i_target, "After EX out of special wakeup")); + } + else + { + // Do not deassert wakeup's in Malf path, as we did not assert them in Reset + // as well and reset the attribute. + FAPI_INF("MALF Handling in progress! Skipped Disable Special Wakeup"); + l_malfCycle = fapi2::ENUM_ATTR_PM_MALF_CYCLE_INACTIVE; + FAPI_TRY (FAPI_ATTR_SET (fapi2::ATTR_PM_MALF_CYCLE, i_target, + l_malfCycle)); + } // ************************************************************************ // Start OCC PPC405 diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C index cdf661796..efca95da7 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.C @@ -111,6 +111,9 @@ fapi2::ReturnCode p9_pm_reset( fapi2::ATTR_INITIATED_PM_RESET_Type l_pmResetActive = fapi2::ENUM_ATTR_INITIATED_PM_RESET_ACTIVE; + fapi2::ATTR_PM_MALF_CYCLE_Type l_pmMalfCycle = + fapi2::ENUM_ATTR_PM_MALF_CYCLE_INACTIVE; + fapi2::buffer<uint64_t> l_data64; fapi2::ReturnCode l_rc; fapi2::ATTR_SKIP_WAKEUP_Type l_skip_wakeup; @@ -214,6 +217,9 @@ fapi2::ReturnCode p9_pm_reset( } else { + // Put a mark that we are in a PM Reset as part of handling a PM Malf Alert + l_pmMalfCycle = fapi2::ENUM_ATTR_PM_MALF_CYCLE_ACTIVE; + FAPI_TRY (FAPI_ATTR_SET (fapi2::ATTR_PM_MALF_CYCLE, i_target, l_pmMalfCycle)); FAPI_TRY(p9_pm_glob_fir_trace(i_target, "Skip special wakeup in malf alert path")); } @@ -227,8 +233,8 @@ fapi2::ReturnCode p9_pm_reset( } else { - FAPI_INF("Skipping enabling special wakup and setting" - "auto-special wakeup because SKIP_WAKEUP attribute is set"); + FAPI_INF("Skipping enabling special wakeup and auto-special wakeup" + " because SKIP_WAKEUP attribute is set"); } // ************************************************************************ @@ -628,6 +634,8 @@ p9_pm_set_auto_spwkup(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_targe fapi2::buffer<uint64_t> l_gpmmr; fapi2::buffer<uint64_t> l_lmcr; uint32_t l_bit; + fapi2::ATTR_PM_MALF_CYCLE_Type l_malfAlertActive = + fapi2::ENUM_ATTR_PM_MALF_CYCLE_INACTIVE; fapi2::ATTR_CHIP_UNIT_POS_Type l_ex_num; FAPI_TRY(FAPI_ATTR_GET( fapi2::ATTR_CHIP_UNIT_POS, @@ -657,11 +665,29 @@ p9_pm_set_auto_spwkup(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_targe } else { - FAPI_ASSERT (false, - fapi2::PM_RESET_SPWKUP_DONE_ERROR() - .set_CORE_TARGET(l_core) - .set_GPMMR(l_gpmmr), - "Core expected to be in special wake-up is not prior to setting auto special wake-up mode"); + FAPI_TRY (FAPI_ATTR_GET (fapi2::ATTR_PM_MALF_CYCLE, i_target, + l_malfAlertActive)); + + if (l_malfAlertActive == fapi2::ENUM_ATTR_PM_MALF_CYCLE_INACTIVE) + { + FAPI_ASSERT (false, + fapi2::PM_RESET_SPWKUP_DONE_ERROR() + .set_CORE_TARGET(l_core) + .set_GPMMR(l_gpmmr), + "Core expected to be in special wake-up is not " + "prior to setting auto special wake-up mode"); + } + else + { + // It is possible that special wakeup had failed as we are in PM MALF path + // Log a info error and continue with the Reset flow + FAPI_ASSERT_NOEXIT ( false, + fapi2::PM_RESET_SPWKUP_DONE_ERROR() + .set_CORE_TARGET(l_core) + .set_GPMMR(l_gpmmr), + "Core expected to be in special wake-up is not " + "prior to setting auto special wake-up mode" ); + } } } } diff --git a/src/import/chips/p9/procedures/xml/attribute_info/pm_hwp_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/pm_hwp_attributes.xml index 0738ffbca..505d87522 100644 --- a/src/import/chips/p9/procedures/xml/attribute_info/pm_hwp_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/pm_hwp_attributes.xml @@ -546,4 +546,17 @@ <writeable/> </attribute> <!-- ********************************************************************* --> + <attribute> + <id>ATTR_PM_MALF_CYCLE</id> + <targetType>TARGET_TYPE_PROC_CHIP</targetType> + <description> + Attribute is set in PM Reset and cleared in the immediate subsequent PM + Init, when handling a PM Malfunction related PM Complex reset/init cycle. + </description> + <valueType>uint8</valueType> + <enum>INACTIVE = 0x00, ACTIVE = 0x01</enum> + <writeable/> + <initToZero/> + </attribute> + <!-- ********************************************************************* --> </attributes> diff --git a/src/import/chips/p9/procedures/xml/attribute_info/pm_plat_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/pm_plat_attributes.xml index b4ef3e03c..9d3abc6c3 100644 --- a/src/import/chips/p9/procedures/xml/attribute_info/pm_plat_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/pm_plat_attributes.xml @@ -2215,8 +2215,8 @@ </description> <valueType>uint8</valueType> <enum>FALSE = 0x00, TRUE = 0x01</enum> - <platInit/> - <default>FALSE</default> + <writeable/> + <initToZero/> </attribute> <!-- ********************************************************************* --> <attribute> @@ -2233,8 +2233,7 @@ <valueType>uint8</valueType> <enum>FALSE = 0x00, TRUE = 0x01</enum> <writeable/> - <platInit/> - <default>FALSE</default> + <initToZero/> </attribute> <!-- ********************************************************************* --> |