diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2014-03-26 12:44:57 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-04-04 10:46:22 -0500 |
commit | 1be9762f6c1112555176ba474fe9a294c2ff1d95 (patch) | |
tree | f9cd540d06baabfbaa6664eb4519315f2005c1cf /src | |
parent | 8c7a27be94470541d184cfec495b6cfe63953733 (diff) | |
download | talos-hostboot-1be9762f6c1112555176ba474fe9a294c2ff1d95.tar.gz talos-hostboot-1be9762f6c1112555176ba474fe9a294c2ff1d95.zip |
Manage core special wakeup state of in HostBoot
Change-Id: I0480f373a93e03722954ca14a95bf0e8f2b2928f
CQ: SW252399
Backport: release-fips810
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9925
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
17 files changed, 460 insertions, 143 deletions
diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_cpu_special_wakeup.H b/src/include/usr/hwpf/hwp/utility_procedures/p8_cpu_special_wakeup.H index b87414ddf..ae95bea07 100644 --- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_cpu_special_wakeup.H +++ b/src/include/usr/hwpf/hwp/utility_procedures/p8_cpu_special_wakeup.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/p8_cpu_special_wakeup.H $ */ +/* $Source: src/include/usr/hwpf/hwp/utility_procedures/p8_cpu_special_wakeup.H $ */ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013 */ +/* COPYRIGHT International Business Machines Corp. 2013,2014 */ /* */ /* p1 */ /* */ diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/proc_cpu_special_wakeup.H b/src/include/usr/hwpf/hwp/utility_procedures/proc_cpu_special_wakeup.H index 9583c227c..d58502ca7 100644 --- a/src/usr/hwpf/hwp/occ/occ_procedures/proc_cpu_special_wakeup.H +++ b/src/include/usr/hwpf/hwp/utility_procedures/proc_cpu_special_wakeup.H @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/proc_cpu_special_wakeup.H $ */ +/* $Source: src/include/usr/hwpf/hwp/utility_procedures/proc_cpu_special_wakeup.H $ */ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013 */ +/* COPYRIGHT International Business Machines Corp. 2013,2014 */ /* */ /* p1 */ /* */ diff --git a/src/usr/hwpf/hwp/build_winkle_images/makefile b/src/usr/hwpf/hwp/build_winkle_images/makefile index 4b4af00c7..778151d15 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/makefile +++ b/src/usr/hwpf/hwp/build_winkle_images/makefile @@ -5,7 +5,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2012,2013 +# COPYRIGHT International Business Machines Corp. 2012,2014 # # p1 # @@ -44,6 +44,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/mvpd_accessors EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ/occ_procedures +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_block_wakeup_intr EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/proc_mailbox_utils diff --git a/src/usr/hwpf/hwp/core_activate/core_activate.C b/src/usr/hwpf/hwp/core_activate/core_activate.C index 2acd03d42..81ac28a3d 100644 --- a/src/usr/hwpf/hwp/core_activate/core_activate.C +++ b/src/usr/hwpf/hwp/core_activate/core_activate.C @@ -74,6 +74,7 @@ #include "proc_post_winkle.H" #include "proc_check_slw_done.H" #include "p8_block_wakeup_intr.H" +#include "p8_cpu_special_wakeup.H" // mss_scrub support #include <diag/prdf/prdfMain.H> @@ -186,6 +187,33 @@ void* call_host_activate_master( void *io_pArgs ) "p8_block_wakeup_intr SUCCESS" ); } + // Clear special wakeup + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Disable special wakeup on master core"); + + FAPI_INVOKE_HWP(l_errl, p8_cpu_special_wakeup, + l_fapi_ex_target, + SPCWKUP_DISABLE, + HOST); + + if(l_errl) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Disable p8_cpu_special_wakeup ERROR : Returning errorlog," + " reason=0x%x", + l_errl->reasonCode() ); + + // capture the target data in the elog + ErrlUserDetailsTarget(l_masterEx).addToLog( l_errl ); + + break; + } + else + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Disable special wakeup on master core SUCCESS"); + } + // put the master into winkle. TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, @@ -248,6 +276,32 @@ void* call_host_activate_master( void *io_pArgs ) "proc_prep_master_winkle SUCCESS" ); } + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Enable special wakeup on master core"); + + FAPI_INVOKE_HWP(l_errl, p8_cpu_special_wakeup, + l_fapi_ex_target, + SPCWKUP_ENABLE, + HOST); + + if(l_errl) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Enable p8_cpu_special_wakeup ERROR : Returning errorlog, " + "reason=0x%x", + l_errl->reasonCode() ); + + // capture the target data in the elog + ErrlUserDetailsTarget(l_masterEx).addToLog( l_errl ); + + break; + } + else + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Enable special wakeup on master core SUCCESS"); + } + } while ( 0 ); // @@@@@ END CUSTOM BLOCK: @@@@@ @@ -464,6 +518,38 @@ void* call_host_activate_slave_cores( void *io_pArgs ) TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "SUCCESS : proc_post_winkle" ); } + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Running p8_cpu_special_wakeup (ENABLE)" + " EX target HUID %.8X", + TARGETING::get_huid(l_exTarget)); + + // Enable special wakeup on core + FAPI_INVOKE_HWP( l_errl, + p8_cpu_special_wakeup, + l_fapi_ex_target, + SPCWKUP_ENABLE, + HOST); + + if( l_errl ) + { + ErrlUserDetailsTarget(l_pChipTarget).addToLog( l_errl ); + + // Create IStep error log and cross ref error that occurred + l_stepError.addErrorDetails( l_errl ); + + // Commit Error + errlCommit( l_errl, HWPF_COMP_ID ); + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR : enable p8_cpu_special_wakeup, PLID=0x%x", + l_errl->plid() ); + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS: enable p8_cpu_special_wakeup"); + } } } // end for diff --git a/src/usr/hwpf/hwp/core_activate/makefile b/src/usr/hwpf/hwp/core_activate/makefile index bb5861b51..c0159a1d6 100644 --- a/src/usr/hwpf/hwp/core_activate/makefile +++ b/src/usr/hwpf/hwp/core_activate/makefile @@ -51,6 +51,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/core_activate/switch_rec_attn EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/core_activate/proc_check_slw_done EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_block_wakeup_intr +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures ## NOTE: add new object files when you add a new HWP @@ -75,6 +76,5 @@ VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/core_activate/switch_rec_attn VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/core_activate/proc_post_winkle VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/core_activate/proc_check_slw_done - include ${ROOTPATH}/config.mk diff --git a/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C b/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C index 228e82383..836cef1d6 100644 --- a/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C +++ b/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C @@ -70,6 +70,7 @@ // Uncomment these files as they become available: // #include "host_coalesce_host/host_coalesce_host.H" #include "p8_block_wakeup_intr/p8_block_wakeup_intr.H" +#include "p8_cpu_special_wakeup.H" namespace ESTABLISH_SYSTEM_SMP { @@ -546,6 +547,36 @@ void *host_sys_fab_iovalid_processing(void* io_ptr ) TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "SUCCESS : p8_block_wakeup_intr(SET)" ); } + + // disable special wakeup + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Running p8_cpu_special_wakeup (DISABLE) on EX target" + " HUID %.8X", + TARGETING::get_huid(l_exTarget)); + + FAPI_INVOKE_HWP(l_errl, + p8_cpu_special_wakeup, + l_fapi_ex_target, + SPCWKUP_DISABLE, + HOST); + + if(l_errl) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Disable p8_cpu_special_wakeup ERROR :" + " Returning errorlog, reason=0x%x", + l_errl->reasonCode() ); + + // capture the target data in the elog + ErrlUserDetailsTarget(l_exTarget).addToLog( l_errl ); + + break; + } + else + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS: Disable special wakeup"); + } } // for ex } // for proc } @@ -560,4 +591,70 @@ void *host_sys_fab_iovalid_processing(void* io_ptr ) return NULL; } + +errlHndl_t enableSpecialWakeup() +{ + errlHndl_t l_errl = NULL; + // loop thru all proc and find all functional ex units + TARGETING::TargetHandleList l_procTargetList; + getAllChips(l_procTargetList, TYPE_PROC); + for (TargetHandleList::const_iterator l_procIter = + l_procTargetList.begin(); + l_procIter != l_procTargetList.end(); + ++l_procIter) + { + const TARGETING::Target* l_pChipTarget = *l_procIter; + + // Get EX list under this proc + TARGETING::TargetHandleList l_exList; + getChildChiplets( l_exList, l_pChipTarget, TYPE_EX ); + + for (TargetHandleList::const_iterator + l_exIter = l_exList.begin(); + l_exIter != l_exList.end(); + ++l_exIter) + { + const TARGETING::Target * l_exTarget = *l_exIter; + + fapi::Target l_fapi_ex_target + ( TARGET_TYPE_EX_CHIPLET, + (const_cast<TARGETING::Target*>(l_exTarget)) ); + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Running p8_cpu_special_wakeup(ENABLE) " + "on EX target HUID %.8X", + TARGETING::get_huid(l_exTarget)); + + FAPI_INVOKE_HWP(l_errl, + p8_cpu_special_wakeup, + l_fapi_ex_target, + SPCWKUP_ENABLE, + HOST); + + if(l_errl) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Enable p8_cpu_special_wakeup ERROR :" + " Returning errorlog, reason=0x%x", + l_errl->reasonCode() ); + + // capture the target data in the elog + ErrlUserDetailsTarget(l_exTarget).addToLog( l_errl ); + + break; + } + else + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS: Enable special wakeup"); + } + } + if(l_errl) + { + break; + } + } + return l_errl; +} + }; // end namespace diff --git a/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H b/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H index 35496d593..20c02a007 100644 --- a/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H +++ b/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H @@ -112,6 +112,14 @@ errlHndl_t call_host_coalesce_host( ); */ void* host_sys_fab_iovalid_processing( void* io_pMsg ); +/** + * @brief enableSpecialWakeup on all functional cores after + * winkle wakeup. + * + * @return error log handle + */ +errlHndl_t enableSpecialWakeup(); + }; // end namespace #endif diff --git a/src/usr/hwpf/hwp/establish_system_smp/makefile b/src/usr/hwpf/hwp/establish_system_smp/makefile index fb4b43df9..e6f00f861 100644 --- a/src/usr/hwpf/hwp/establish_system_smp/makefile +++ b/src/usr/hwpf/hwp/establish_system_smp/makefile @@ -46,7 +46,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/edi_ei_initialization ## EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/establish_system_smp/<HWP_dir> EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar - +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures ## NOTE: add new object files when you add a new HWP OBJS = establish_system_smp.o @@ -56,6 +56,5 @@ OBJS = establish_system_smp.o ## EXAMPLE: # VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/establish_system_smp/<HWP_dir> - include ${ROOTPATH}/config.mk diff --git a/src/usr/hwpf/hwp/occ/makefile b/src/usr/hwpf/hwp/occ/makefile index 34d819ef6..c8c9178ea 100644 --- a/src/usr/hwpf/hwp/occ/makefile +++ b/src/usr/hwpf/hwp/occ/makefile @@ -35,6 +35,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include ## pointer to already consumed procedures. EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures ## NOTE: add the base istep dir here. EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/occ @@ -64,13 +65,11 @@ OBJS = occ.o \ p8_pm_occ_firinit.o \ p8_pm_pba_firinit.o \ p8_pm_pmc_firinit.o \ - p8_cpu_special_wakeup.o \ p8_pm_utils.o #These procedures are included per Stradale's request so #they can implement OCC Reset. OBJS+= p8_pm_prep_for_reset.o \ - proc_cpu_special_wakeup.o \ p8_pmc_force_vsafe.o \ p8_ocb_indir_access.o \ p8_ocb_indir_setup_linear.o diff --git a/src/usr/hwpf/hwp/start_payload/makefile b/src/usr/hwpf/hwp/start_payload/makefile index fe3458284..1d6ebc2fb 100644 --- a/src/usr/hwpf/hwp/start_payload/makefile +++ b/src/usr/hwpf/hwp/start_payload/makefile @@ -5,7 +5,7 @@ # # IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2012,2013 +# COPYRIGHT International Business Machines Corp. 2012,2014 # # p1 # @@ -42,7 +42,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/start_payload ## EXAMPLE: ## EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/start_payload/<HWP_dir> EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar - +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures ## NOTE: add new object files when you add a new HWP OBJS = start_payload.o @@ -52,6 +52,5 @@ OBJS = start_payload.o ## EXAMPLE: # VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/start_payload/<HWP_dir> - include ${ROOTPATH}/config.mk diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C index fcbef580f..182bfd6d5 100644 --- a/src/usr/hwpf/hwp/start_payload/start_payload.C +++ b/src/usr/hwpf/hwp/start_payload/start_payload.C @@ -64,7 +64,7 @@ #include <fapi.H> #include <fapiPlatHwpInvoker.H> #include "p8_set_pore_bar.H" - +#include "p8_cpu_special_wakeup.H" #include "start_payload.H" #include <runtime/runtime.H> @@ -122,6 +122,15 @@ errlHndl_t notifyFsp ( bool i_istepModeFlag, TARGETING::SpFunctions i_spFuncs ); /** + * @brief This function disables the special wakeup that allows scom + * operations on napped cores + * + * @return errlHndl_t error handle + */ +errlHndl_t disableSpecialWakeup(); + + +/** * @brief This function will clear the PORE BARs. Needs to be done * depending on payload type * @@ -446,7 +455,11 @@ void* call_host_start_payload( void *io_pArgs ) if( l_errl == NULL ) { + l_errl = disableSpecialWakeup(); + } + if( l_errl == NULL ) + { // - Call shutdown using payload base, and payload entry. // - base/entry will be from system attributes // - this will start the payload (Phyp) @@ -744,4 +757,72 @@ errlHndl_t broadcastShutdown ( uint64_t i_hbInstance ) return err; } + +errlHndl_t disableSpecialWakeup() +{ + errlHndl_t l_errl = NULL; + + // loop thru all proc and find all functional ex units + TARGETING::TargetHandleList l_procTargetList; + getAllChips(l_procTargetList, TYPE_PROC); + for (TargetHandleList::const_iterator l_procIter = + l_procTargetList.begin(); + l_procIter != l_procTargetList.end(); + ++l_procIter) + { + const TARGETING::Target* l_pChipTarget = *l_procIter; + + // Get EX list under this proc + TARGETING::TargetHandleList l_exList; + getChildChiplets( l_exList, l_pChipTarget, TYPE_EX ); + + for (TargetHandleList::const_iterator + l_exIter = l_exList.begin(); + l_exIter != l_exList.end(); + ++l_exIter) + { + const TARGETING::Target * l_exTarget = *l_exIter; + + fapi::Target l_fapi_ex_target + ( TARGET_TYPE_EX_CHIPLET, + (const_cast<TARGETING::Target*>(l_exTarget)) ); + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Running p8_cpu_special_wakeup(DISABLE) " + "on EX target HUID %.8X", + TARGETING::get_huid(l_exTarget)); + + FAPI_INVOKE_HWP(l_errl, + p8_cpu_special_wakeup, + l_fapi_ex_target, + SPCWKUP_DISABLE, + HOST); + + if(l_errl) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Disable p8_cpu_special_wakeup ERROR :" + " Returning errorlog, reason=0x%x", + l_errl->reasonCode() ); + + // capture the target data in the elog + ERRORLOG::ErrlUserDetailsTarget(l_exTarget).addToLog( l_errl ); + + break; + } + else + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS: Disable special wakeup"); + } + } + if(l_errl) + { + break; + } + } + + return l_errl; +} + }; // end namespace diff --git a/src/usr/hwpf/hwp/thread_activate/makefile b/src/usr/hwpf/hwp/thread_activate/makefile index d911d28f6..9a1b2df57 100644 --- a/src/usr/hwpf/hwp/thread_activate/makefile +++ b/src/usr/hwpf/hwp/thread_activate/makefile @@ -1,25 +1,25 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. # -# $Source: src/usr/hwpf/hwp/thread_activate/makefile $ +# $Source: src/usr/hwpf/hwp/thread_activate/makefile $ # -# IBM CONFIDENTIAL +# IBM CONFIDENTIAL # -# COPYRIGHT International Business Machines Corp. 2012 +# COPYRIGHT International Business Machines Corp. 2012,2014 # -# p1 +# p1 # -# Object Code Only (OCO) source materials -# Licensed Internal Code Source Materials -# IBM HostBoot Licensed Internal Code +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code # -# The source code for this program is not published or other- -# wise divested of its trade secrets, irrespective of what has -# been deposited with the U.S. Copyright Office. +# The source code for this program is not published or otherwise +# divested of its trade secrets, irrespective of what has been +# deposited with the U.S. Copyright Office. # -# Origin: 30 +# Origin: 30 # -# IBM_PROLOG_END_TAG +# IBM_PROLOG_END_TAG ROOTPATH = ../../../../.. MODULE = thread_activate @@ -41,7 +41,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/thread_activate ## EXAMPLE: ## EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/thread_activate/<HWP_dir> EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/thread_activate/proc_thread_control - +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures ## NOTE: add new object files when you add a new HWP OBJS = thread_activate.o \ diff --git a/src/usr/hwpf/hwp/thread_activate/thread_activate.C b/src/usr/hwpf/hwp/thread_activate/thread_activate.C index b8aefd772..31bc9c65a 100644 --- a/src/usr/hwpf/hwp/thread_activate/thread_activate.C +++ b/src/usr/hwpf/hwp/thread_activate/thread_activate.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* COPYRIGHT International Business Machines Corp. 2012,2014 */ /* */ /* p1 */ /* */ @@ -51,6 +51,7 @@ #include <fapiPlatHwpInvoker.H> #include <hwpf/plat/fapiPlatTrace.H> #include <hwpf/hwpf_reasoncodes.H> +#include "p8_cpu_special_wakeup.H" #include <pnor/pnorif.H> #include <vpd/mvpdenums.H> @@ -198,7 +199,7 @@ bool getCacheDeconfig(uint64_t i_masterCoreId) theKeyword ) ); if( l_errl ) { break; } - + if(0 == theData[0]) { cacheDeconfig = false; @@ -276,134 +277,169 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) break; } } - if( l_masterCore == NULL ) - { - TRACFCOMP( g_fapiImpTd, - "Could not find a target for core %d", - l_masterCoreID ); - /*@ - * @errortype - * @moduleid fapi::MOD_THREAD_ACTIVATE - * @reasoncode fapi::RC_NO_MASTER_CORE_TARGET - * @userdata1 Master cpu id (NNNCCCPPPPTTT) - * @userdata2 Master processor chip huid - * @devdesc activate_threads> Could not find a target - * for the master core - */ - l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, - fapi::MOD_THREAD_ACTIVATE, - fapi::RC_NO_MASTER_CORE_TARGET, - cpuid, - TARGETING::get_huid(l_masterProc)); - l_errl->collectTrace("TARG",256); - l_errl->collectTrace(FAPI_TRACE_NAME,256); - l_errl->collectTrace(FAPI_IMP_TRACE_NAME,256); - io_rtaskRetErrl = l_errl; - return; - } - TRACFCOMP( g_fapiTd, - "Master CPU : c%d t%d (HUID=%.8X)", - l_masterCoreID, l_masterThreadID, - TARGETING::get_huid(l_masterCore) ); - - // cast OUR type of target to a FAPI type of target. - const fapi::Target l_fapiCore( fapi::TARGET_TYPE_EX_CHIPLET, - (const_cast<TARGETING::Target*>(l_masterCore))); - - // AVPs might enable a subset of the available threads - uint64_t max_threads = cpu_thread_count(); - TARGETING::Target* sys = NULL; - TARGETING::targetService().getTopLevelTarget(sys); - assert( sys != NULL ); - uint64_t en_threads = sys->getAttr<TARGETING::ATTR_ENABLED_THREADS>(); - - for( uint64_t thread = 0; thread < max_threads; thread++ ) + do { - // Skip the thread that we're running on - if( thread == l_masterThreadID ) + if( l_masterCore == NULL ) { - continue; + TRACFCOMP( g_fapiImpTd, + "Could not find a target for core %d", + l_masterCoreID ); + /*@ + * @errortype + * @moduleid fapi::MOD_THREAD_ACTIVATE + * @reasoncode fapi::RC_NO_MASTER_CORE_TARGET + * @userdata1 Master cpu id (NNNCCCPPPPTTT) + * @userdata2 Master processor chip huid + * @devdesc activate_threads> Could not find a target + * for the master core + */ + l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi::MOD_THREAD_ACTIVATE, + fapi::RC_NO_MASTER_CORE_TARGET, + cpuid, + TARGETING::get_huid(l_masterProc)); + l_errl->collectTrace("TARG",256); + l_errl->collectTrace(FAPI_TRACE_NAME,256); + l_errl->collectTrace(FAPI_IMP_TRACE_NAME,256); + + break; } - // Skip threads that we shouldn't be starting - if( !(en_threads & (0x8000000000000000>>thread)) ) - { - continue; - } - - // send a magic instruction for PHYP Simics to work... - MAGIC_INSTRUCTION(MAGIC_SIMICS_CORESTATESAVE); - - // parameters: i_target => core target - // i_thread => thread (0..7) - // i_command => - // PTC_CMD_SRESET => initiate sreset thread command - // PTC_CMD_START => initiate start thread command - // PTC_CMD_STOP => initiate stop thread command - // PTC_CMD_STEP => initiate step thread command - // PTC_CMD_QUERY => query and return thread state - // return data in o_ras_status - // i_warncheck => convert pre/post checks errors to warnings - // o_ras_status => output: complete RAS status register - // o_state => output: thread state info - // see proc_thread_control.H - // for bit enumerations: - // THREAD_STATE_* - ecmdDataBufferBase l_ras_status; - uint64_t l_thread_state; - FAPI_INVOKE_HWP( l_errl, proc_thread_control, - l_fapiCore, //i_target - thread, //i_thread - PTC_CMD_SRESET, //i_command - false, //i_warncheck - l_ras_status, //o_ras_status - l_thread_state); //o_state - - if ( l_errl != NULL ) + TRACFCOMP( g_fapiTd, + "Master CPU : c%d t%d (HUID=%.8X)", + l_masterCoreID, l_masterThreadID, + TARGETING::get_huid(l_masterCore) ); + + // cast OUR type of target to a FAPI type of target. + const fapi::Target l_fapiCore + ( fapi::TARGET_TYPE_EX_CHIPLET, + (const_cast<TARGETING::Target*>(l_masterCore))); + + // AVPs might enable a subset of the available threads + uint64_t max_threads = cpu_thread_count(); + TARGETING::Target* sys = NULL; + TARGETING::targetService().getTopLevelTarget(sys); + assert( sys != NULL ); + uint64_t en_threads = sys->getAttr<TARGETING::ATTR_ENABLED_THREADS>(); + + + // -------------------------------------------------------------------- + //Enbale the special wake-up on master core(EX) + FAPI_INF("\tEnable special wake-up on master core"); + + FAPI_INVOKE_HWP(l_errl, p8_cpu_special_wakeup, + l_fapiCore, + SPCWKUP_ENABLE, + HOST); + + if(l_errl) { TRACFCOMP( g_fapiImpTd, - "ERROR: 0x%.8X : proc_thread_control HWP( cpu %d, thread %d, " - "ras status 0x%.16X, thread state 0x%.16X )", + "ERROR: 0x%.8X : p8_cpu_special_wakeup set HWP(cpu %d)", l_errl->reasonCode(), - l_masterCoreID, - thread, - l_ras_status.getDoubleWord(0), - l_thread_state ); + l_masterCoreID); + l_errl->collectTrace(FAPI_TRACE_NAME,256); l_errl->collectTrace(FAPI_IMP_TRACE_NAME,256); - - // if 1 thread fails it is unlikely that other threads will work - // so we'll just jump out now break; } - else + + for( uint64_t thread = 0; thread < max_threads; thread++ ) { + // Skip the thread that we're running on + if( thread == l_masterThreadID ) + { + continue; + } + + // Skip threads that we shouldn't be starting + if( !(en_threads & (0x8000000000000000>>thread)) ) + { + continue; + } + + // send a magic instruction for PHYP Simics to work... + MAGIC_INSTRUCTION(MAGIC_SIMICS_CORESTATESAVE); + + // parameters: i_target => core target + // i_thread => thread (0..7) + // i_command => + // PTC_CMD_SRESET => initiate sreset thread command + // PTC_CMD_START => initiate start thread command + // PTC_CMD_STOP => initiate stop thread command + // PTC_CMD_STEP => initiate step thread command + // PTC_CMD_QUERY => query and return thread state + // return data in o_ras_status + // i_warncheck => convert pre/post checks errors to + // warnings + // o_ras_status => output: complete RAS status + // register + // o_state => output: thread state info + // see proc_thread_control.H + // for bit enumerations: + // THREAD_STATE_* + ecmdDataBufferBase l_ras_status; + uint64_t l_thread_state; + FAPI_INVOKE_HWP( l_errl, proc_thread_control, + l_fapiCore, //i_target + thread, //i_thread + PTC_CMD_SRESET, //i_command + false, //i_warncheck + l_ras_status, //o_ras_status + l_thread_state); //o_state + + if ( l_errl != NULL ) + { + TRACFCOMP( g_fapiImpTd, + "ERROR: 0x%.8X : proc_thread_control HWP" + "( cpu %d, thread %d, " + "ras status 0x%.16X, thread state 0x%.16X )", + l_errl->reasonCode(), + l_masterCoreID, + thread, + l_ras_status.getDoubleWord(0), + l_thread_state ); + + l_errl->collectTrace(FAPI_TRACE_NAME,256); + l_errl->collectTrace(FAPI_IMP_TRACE_NAME,256); + + // if 1 thread fails it is unlikely that other threads will work + // so we'll just jump out now + break; + } + else + { + TRACFCOMP + (g_fapiTd, + "SUCCESS: proc_thread_control HWP( cpu %d, thread %d, " + "ras status 0x%.16X,thread state 0x%.16X )", + l_masterCoreID, + thread, + l_ras_status.getDoubleWord(0), + l_thread_state ); + } + TRACFCOMP( g_fapiTd, - "SUCCESS: proc_thread_control HWP( cpu %d, thread %d, " - "ras status 0x%.16X,thread state 0x%.16X )", + "SUCCESS: Thread c%d t%d started", l_masterCoreID, - thread, - l_ras_status.getDoubleWord(0), - l_thread_state ); + thread ); + } + if(l_errl) + { + break; } - TRACFCOMP( g_fapiTd, - "SUCCESS: Thread c%d t%d started", - l_masterCoreID, - thread ); - - } - - // Reclaim remainder of L3 cache if available. - if ((!PNOR::usingL3Cache()) && - (!getCacheDeconfig(l_masterCoreID))) - { - TRACFCOMP( g_fapiTd, - "activate_threads: Extending cache to 8MB" ); - mm_extend(MM_EXTEND_FULL_CACHE); - } + // Reclaim remainder of L3 cache if available. + if ((!PNOR::usingL3Cache()) && + (!getCacheDeconfig(l_masterCoreID))) + { + TRACFCOMP( g_fapiTd, + "activate_threads: Extending cache to 8MB" ); + mm_extend(MM_EXTEND_FULL_CACHE); + } + } while(0); TRACFCOMP( g_fapiTd, "activate_threads exit" ); diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/p8_cpu_special_wakeup.C b/src/usr/hwpf/hwp/utility_procedures/p8_cpu_special_wakeup.C index 08e13fe3b..08e13fe3b 100644 --- a/src/usr/hwpf/hwp/occ/occ_procedures/p8_cpu_special_wakeup.C +++ b/src/usr/hwpf/hwp/utility_procedures/p8_cpu_special_wakeup.C diff --git a/src/usr/hwpf/hwp/occ/occ_procedures/proc_cpu_special_wakeup.C b/src/usr/hwpf/hwp/utility_procedures/proc_cpu_special_wakeup.C index 2c8bd6392..3e4371347 100644 --- a/src/usr/hwpf/hwp/occ/occ_procedures/proc_cpu_special_wakeup.C +++ b/src/usr/hwpf/hwp/utility_procedures/proc_cpu_special_wakeup.C @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/hwpf/hwp/occ/occ_procedures/proc_cpu_special_wakeup.C $ */ +/* $Source: src/usr/hwpf/hwp/utility_procedures/proc_cpu_special_wakeup.C $ */ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013 */ +/* COPYRIGHT International Business Machines Corp. 2013,2014 */ /* */ /* p1 */ /* */ diff --git a/src/usr/hwpf/hwp/utility_procedures/utils.mk b/src/usr/hwpf/hwp/utility_procedures/utils.mk index 3d74fbae1..6ac6c0d22 100644 --- a/src/usr/hwpf/hwp/utility_procedures/utils.mk +++ b/src/usr/hwpf/hwp/utility_procedures/utils.mk @@ -24,8 +24,10 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/utility_procedures EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp/utility_procedures EXTRAINCDIR += ${ROOTPATH}/usr/hwpf/hwp/include +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar VPATH += ${HWPPATH}/utility_procedures OBJS += mss_unmask_errors.o mss_maint_cmds.o +OBJS += p8_cpu_special_wakeup.o proc_cpu_special_wakeup.o diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C index 0df0ac825..c2afaf215 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.C +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C @@ -1460,6 +1460,15 @@ void IStepDispatcher::handleProcFabIovalidMsg(msg_t * & io_pMsg) "Returned from cpu_all_winkle." ); } + // Re-enable p8_cpu_special_wakeup + err = ESTABLISH_SYSTEM_SMP::enableSpecialWakeup(); + if (err) + { + TRACFCOMP( g_trac_initsvc, + "ERROR: ESTABLISH_SYSTEM_SMP::enableSpecialWakeup"); + errlCommit(err, INITSVC_COMP_ID); + } + err = MBOX::resume(); if (err) { |