From e26a4e0173c8cf6413f8c6d2a46bdb68095004e7 Mon Sep 17 00:00:00 2001 From: Greg Still Date: Mon, 25 Sep 2017 17:45:36 -0500 Subject: [PATCH] PM: p9_pm_init, p9_pm_utils clean-up - Clarify OCC special wake-up clearing - Use unit_pos for traces vs target addresses - Add ATTR_PM_GLOBAL_FIR_TRACE_EN as an override attribute to control tracing - Enable p9_pm_glob_fir_trace unit above attribute control - Use EXTRALIBS to ensure .so is built Change-Id: I1ea4764ca15862e82acb0751fe867d281cf00c12 RTC: 174349 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46715 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: Hostboot CI Tested-by: PPE CI Reviewed-by: AMIT J. TENDOLKAR Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA Reviewed-by: Daniel M. Crowell Reviewed-by: Matt K. Light Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46718 Reviewed-by: Hostboot Team Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW --- .../p9/procedures/hwp/pm/p9_pm_cme_firinit.mk | 3 +- .../p9/procedures/hwp/pm/p9_pm_firinit.mk | 7 ++- .../chips/p9/procedures/hwp/pm/p9_pm_init.C | 18 ++++--- .../chips/p9/procedures/hwp/pm/p9_pm_init.mk | 13 +++-- .../chips/p9/procedures/hwp/pm/p9_pm_reset.mk | 15 ++++-- .../chips/p9/procedures/hwp/pm/p9_pm_utils.C | 51 ++++++++----------- .../xml/attribute_info/pm_plat_attributes.xml | 17 +++++-- 7 files changed, 75 insertions(+), 49 deletions(-) diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_cme_firinit.mk b/src/import/chips/p9/procedures/hwp/pm/p9_pm_cme_firinit.mk index 4b5bef48f8c..339fce589d2 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_cme_firinit.mk +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_cme_firinit.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2016 +# Contributors Listed Below - COPYRIGHT 2016,2017 # [+] International Business Machines Corp. # # @@ -23,4 +23,5 @@ # # IBM_PROLOG_END_TAG PROCEDURE=p9_pm_cme_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_query_cache_access_state $(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.mk b/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.mk index 3dd88101898..1a56da0a7a9 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.mk +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_firinit.mk @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2015,2016 +# Contributors Listed Below - COPYRIGHT 2015,2017 # [+] International Business Machines Corp. # # @@ -23,5 +23,8 @@ # # IBM_PROLOG_END_TAG PROCEDURE=p9_pm_firinit -#libp9_pm_firinit_DEPLIBS += p9_pm_occ_firinit p9_pm_pba_firinit p9_pm_ppm_firinit p9_pm_cme_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pba_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_ppm_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_cme_firinit $(call BUILD_PROCEDURE) 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 f8c29e45ffb..44f92134749 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 @@ -207,10 +207,10 @@ fapi2::ReturnCode pm_init( // ************************************************************************ // Switch off OCC initiated special wakeup on EX to allowSTOP functionality // ************************************************************************ - FAPI_DBG("Clear off the wakeup"); + FAPI_DBG("Clearing OCC special wake-up to be sure"); FAPI_TRY(clear_occ_special_wakeups(i_target), "ERROR: Failed to clear off the wakeup"); - FAPI_TRY(p9_pm_glob_fir_trace(i_target, "EX targets off special wakeup")); + FAPI_TRY(p9_pm_glob_fir_trace(i_target, "EX targets OCC clear special wakeup")); // ************************************************************************ // Take all EX chiplets out of special wakeup @@ -242,7 +242,7 @@ fapi_try_exit: fapi2::ReturnCode clear_occ_special_wakeups( const fapi2::Target& i_target) { - FAPI_INF("Entering clear_occ_special_wakeups..."); + FAPI_DBG(">> clear_occ_special_wakeups..."); fapi2::buffer l_data64; auto l_exChiplets = i_target.getChildren @@ -253,15 +253,21 @@ fapi2::ReturnCode clear_occ_special_wakeups( // Iterate through the EX chiplets for (auto l_ex_chplt : l_exChiplets) { - FAPI_DBG("Clear OCC special wakeup on ex chiplet 0x%08X", l_ex_chplt); + fapi2::ATTR_CHIP_UNIT_POS_Type l_ex_num; + FAPI_TRY(FAPI_ATTR_GET( fapi2::ATTR_CHIP_UNIT_POS, + l_ex_chplt, + l_ex_num)); + + FAPI_DBG("Clear OCC special wakeup on ex chiplet 0x%08X", l_ex_num); FAPI_TRY(fapi2::getScom(i_target, EX_PPM_SPWKUP_OCC, l_data64), - "ERROR: Failed to read OCC Spl wkup on EX 0x%08X", l_ex_chplt); + "ERROR: Failed to read OCC Spl wkup on EX 0x%08X", l_ex_num); l_data64.clearBit<0>(); FAPI_TRY(fapi2::putScom(i_target, EX_PPM_SPWKUP_OCC, l_data64), - "ERROR: Failed to clear OCC Spl wkup on EX 0x%08X", l_ex_chplt); + "ERROR: Failed to clear OCC Spl wkup on EX 0x%08X", l_ex_num); } fapi_try_exit: + FAPI_DBG("<< clear_occ_special_wakeups..."); return fapi2::current_err; } diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_init.mk b/src/import/chips/p9/procedures/hwp/pm/p9_pm_init.mk index b45f95d941a..141ea440506 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_init.mk +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_init.mk @@ -23,9 +23,16 @@ # # IBM_PROLOG_END_TAG PROCEDURE=p9_pm_init -libp9_pm_init_DEPLIBS += p9_pm_utils p9_pm_corequad_init p9_pm_ocb_init p9_pm_pss_init -libp9_pm_init_DEPLIBS += p9_pm_pba_init p9_pm_firinit p9_pm_stop_gpe_init p9_pm_pstate_gpe_init -libp9_pm_init_DEPLIBS += p9_pm_occ_control p9_pm_reset p9_check_proc_config +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_reset +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_corequad_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_ocb_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pss_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_stop_gpe_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pstate_gpe_init +lib$(PROCEDURE)_EXTRALIBS+=p9_check_proc_config +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_control $(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/lib) $(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/common/pmlib/include/registers) $(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.mk b/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.mk index 84717235454..500c9b31c9b 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.mk +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_reset.mk @@ -22,11 +22,18 @@ # permissions and limitations under the License. # # IBM_PROLOG_END_TAG - PROCEDURE=p9_pm_reset -libp9_pm_reset_DEPLIBS += p9_pm_utils p9_pm_occ_firinit p9_pm_firinit p9_pm_occ_control -libp9_pm_reset_DEPLIBS += p9_pm_pstate_gpe_init p9_pm_stop_gpe_init p9_pm_occ_gpe_init -libp9_pm_reset_DEPLIBS += p9_pm_corequad_init p9_pm_occ_sram_init p9_pm_ocb_init p9_pm_pss_init +lib$(PROCEDURE)_DEPLIBS+=p9_pm_utils +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_firinit +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_control +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_gpe_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pstate_gpe_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_stop_gpe_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_corequad_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_occ_sram_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_ocb_init +lib$(PROCEDURE)_EXTRALIBS+=p9_pm_pss_init $(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/lib) $(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/common/pmlib/include/registers) $(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C b/src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C index fc08bb0a073..bd52528c9e1 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_pm_utils.C @@ -40,6 +40,7 @@ #include #include #include +#include /// Byte-reverse a 16-bit integer if on a little-endian machine @@ -114,32 +115,26 @@ fapi2::ReturnCode p9_pm_glob_fir_trace( const fapi2::Target& i_target, const char* i_msg) { - FAPI_INF("p9_pm_glob_fir_trace Enter"); - -#if 0 // The CONST_UINT64_T definition in P9 const_common.H takes 4 arguments - - // CONST_UINT64_T(name, expr, unit, meth). Need to figure out the values - // for "unit" and "meth" for the below declarations. - CONST_UINT64_T( GLOB_XSTOP_FIR_0x01040000, ULL(0x01040000) ); - CONST_UINT64_T( GLOB_RECOV_FIR_0x01040001, ULL(0x01040001) ); - CONST_UINT64_T( TP_LFIR_0x0104000A, ULL(0x0104000A) ); -#endif + FAPI_DBG(">> p9_pm_glob_fir_trace"); + + // Multicast read addresses + const uint64_t READ_GLOB_XSTOP_FIR_MC = RULL(0x570F001C); + const uint64_t READ_GLOB_RECOV_FIR_MC = RULL(0x570F001B); // Note: i_msg is put on on each record to allow for trace "greps" // so as to see the "big picture" across when - uint8_t l_traceEnFlag = false; const fapi2::Target FAPI_SYSTEM; fapi2::buffer l_data64; -#if 0 // Uncomment when attribute ATTR_PM_GLOBAL_FIR_TRACE_EN is ready + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PM_GLOBAL_FIR_TRACE_EN, FAPI_SYSTEM, l_traceEnFlag), "FAPI_ATTR_GET for attribute ATTR_PM_GLOBAL_FIR_TRACE_EN"); -#endif // Continue if trace is enabled. - if (false == l_traceEnFlag) + if (!l_traceEnFlag) { goto fapi_try_exit; } @@ -148,11 +143,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace( // Check for xstops and recoverables and put in the trace // ****************************************************************** { -#if 0 // Uncomment when the scom address is defined FAPI_TRY(fapi2::getScom(i_target, - READ_GLOBAL_XSTOP_FIR_0x570F001B, + READ_GLOB_XSTOP_FIR_MC, l_data64)); -#endif if(l_data64) { @@ -161,11 +154,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace( } { -#if 0 // Uncomment when the scom address is defined FAPI_TRY(fapi2::getScom(i_target, - READ_GLOBAL_RECOV_FIR_0x570F001C, + READ_GLOB_RECOV_FIR_MC, l_data64)); -#endif if(l_data64) { @@ -174,11 +165,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace( } { -#if 0 // Uncomment when the scom address is defined FAPI_TRY(fapi2::getScom(i_target, - GLOB_XSTOP_FIR_0x01040000, + PERV_TP_XFIR, l_data64)); -#endif if(l_data64) { @@ -187,11 +176,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace( } { -#if 0 // Uncomment when the scom address is defined FAPI_TRY(fapi2::getScom(i_target, - GLOB_RECOV_FIR_0x01040001, + PERV_TP_RFIR, l_data64)); -#endif if(l_data64) { @@ -200,11 +187,9 @@ fapi2::ReturnCode p9_pm_glob_fir_trace( } { -#if 0 // Uncomment when the scom address is defined FAPI_TRY(fapi2::getScom(i_target, - TP_LFIR_0x0104000A, + PERV_TP_LOCAL_FIR, l_data64)); -#endif if(l_data64) { @@ -213,6 +198,7 @@ fapi2::ReturnCode p9_pm_glob_fir_trace( } fapi_try_exit: + FAPI_DBG("<< p9_pm_glob_fir_trace"); return fapi2::current_err; } @@ -220,7 +206,7 @@ fapi2::ReturnCode special_wakeup_all( const fapi2::Target& i_target, const bool i_enable) { - FAPI_INF("special_wakeup_all Enter"); + FAPI_DBG(">> special_wakeup_all"); fapi2::ReturnCode l_rc; auto l_exChiplets = i_target.getChildren @@ -229,11 +215,16 @@ fapi2::ReturnCode special_wakeup_all( // For each EX target for (auto l_ex_chplt : l_exChiplets) { - FAPI_DBG("Running special wakeup on ex chiplet 0x%08X ", l_ex_chplt); + fapi2::ATTR_CHIP_UNIT_POS_Type l_ex_num; + FAPI_TRY(FAPI_ATTR_GET( fapi2::ATTR_CHIP_UNIT_POS, + l_ex_chplt, + l_ex_num)); + FAPI_DBG("Running special wakeup on ex chiplet 0x%08X ", l_ex_num); FAPI_TRY( fapi2::specialWakeup( l_ex_chplt, i_enable ) ); } fapi_try_exit: + FAPI_DBG("<< special_wakeup_all"); return fapi2::current_err; } 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 ac8bc6c87af..a77e93ffc21 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 @@ -158,8 +158,6 @@ - - ATTR_SAFE_MODE_VOLTAGE_MV @@ -167,7 +165,7 @@ TARGET_TYPE_PROC_CHIP Safe mode voltage in mv - This attribute is used within the hwp to update the + This attribute is used within the hwp to update the VDM config register. Consumer: p9_setup_evid.C @@ -2180,4 +2178,17 @@ + + ATTR_PM_GLOBAL_FIR_TRACE_EN + TARGET_TYPE_SYSTEM + + Enable Global FIR tracing through PM Complex Reset/Initialization + + uint8 + + + + + +