diff options
author | Matt Derksen <v2cibmd@us.ibm.com> | 2016-03-04 10:45:33 -0600 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2016-04-04 09:09:35 -0400 |
commit | 287d15e08990eb8ad9892ca94ac38ebe35f9229e (patch) | |
tree | f2e0b3d9c559d3db9b156ff3f84a6783b1764d26 /src | |
parent | 4b4772ef8b18f2e9c80795c47b3a5f81b3521c1f (diff) | |
download | talos-hostboot-287d15e08990eb8ad9892ca94ac38ebe35f9229e.tar.gz talos-hostboot-287d15e08990eb8ad9892ca94ac38ebe35f9229e.zip |
ISTEP08 HWP enablement
Change-Id: Id999da8e97c0bcd5cefabdeb2fe7c80d1efbf5da
RTC: 146576
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21463
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src')
19 files changed, 886 insertions, 480 deletions
diff --git a/src/include/usr/isteps/istep_reasoncodes.H b/src/include/usr/isteps/istep_reasoncodes.H index 550068c3f..c92c5dff3 100644 --- a/src/include/usr/isteps/istep_reasoncodes.H +++ b/src/include/usr/isteps/istep_reasoncodes.H @@ -46,6 +46,7 @@ namespace ISTEP MOD_COMPUTE_PCIE_CONFIG_ATTRS = 0x0A, MOD_EXIT_CACHE_CONTAINED = 0x0B, MOD_HOST_GARD = 0x0C, + MOD_EDI_EI_IO_RUN_TRAINING = 0x0D, }; /** @@ -70,6 +71,9 @@ namespace ISTEP RC_INVALID_CONFIGURATION = ISTEP_COMP_ID | 0x0C, RC_INVALID_PCIE_IOP_LANE_CONFIG = ISTEP_COMP_ID | 0x0D, RC_MASTER_CORE_NULL = ISTEP_COMP_ID | 0x0E, + RC_MIXED_PBUS_CONNECTION = ISTEP_COMP_ID | 0x0F, + RC_SAME_CHIP_PBUS_CONNECTION = ISTEP_COMP_ID | 0x10, + RC_CONFLICT_PBUS_CONNECTION = ISTEP_COMP_ID | 0x11, }; }; diff --git a/src/usr/isteps/istep08/call_host_cbs_start.C b/src/usr/isteps/istep08/call_host_cbs_start.C index 89912d0de..12678e75f 100644 --- a/src/usr/isteps/istep08/call_host_cbs_start.C +++ b/src/usr/isteps/istep08/call_host_cbs_start.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -55,6 +55,11 @@ #include <errl/errludtarget.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> +#include <errl/errlmanager.H> + +#include <p9_start_cbs.H> using namespace ISTEP; using namespace ISTEP_ERROR; @@ -71,19 +76,47 @@ void* call_host_cbs_start(void *io_pArgs) { errlHndl_t l_errl = NULL; IStepError l_stepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_host_cbs_start entry" ); - //@TODO RTC:134078 - //call host_cbs_start - //FAPI_INVOKE_HWP(l_errl,p9_start_cbs); - if(l_errl) + // + // get a list of all the procs in the system + // + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); + + // + // Identify the master processor + // + TARGETING::Target* l_pMasterProcTarget = NULL; + TARGETING::targetService().masterProcChipTargetHandle(l_pMasterProcTarget); + + // loop thru all processors, only call procedure on non-master processors + for (const auto & l_cpu_target: l_cpuTargetList) { - l_stepError.addErrorDetails(l_errl); - errlCommit(l_errl, HWPF_COMP_ID); + if (l_cpu_target != l_pMasterProcTarget) + { + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> + l_fapi2_proc_target (l_cpu_target); + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_start_cbs HWP on processor target %.8X", + TARGETING::get_huid(l_cpu_target) ); + + FAPI_INVOKE_HWP(l_errl, p9_start_cbs, l_fapi2_proc_target); + if(l_errl) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR : call p9_start_cbs, " + "PLID=0x%x", l_errl->plid() ); + l_stepError.addErrorDetails(l_errl); + errlCommit(l_errl, HWPF_COMP_ID); + } + } } - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_host_cbs_start exit" ); + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_host_cbs_start exit" ); return l_stepError.getErrorHandle(); } }; diff --git a/src/usr/isteps/istep08/call_host_setup_sbe.C b/src/usr/isteps/istep08/call_host_setup_sbe.C index 0b8991d45..6f1c1e233 100644 --- a/src/usr/isteps/istep08/call_host_setup_sbe.C +++ b/src/usr/isteps/istep08/call_host_setup_sbe.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -51,10 +51,17 @@ #include <targeting/namedtarget.H> #include <targeting/attrsync.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + +#include <errl/errlmanager.H> + #include <isteps/hwpisteperror.H> #include <errl/errludtarget.H> +#include <p9_set_fsi_gp_shadow.H> + using namespace ISTEP; using namespace ISTEP_ERROR; using namespace ERRORLOG; @@ -70,19 +77,49 @@ void* call_host_setup_sbe(void *io_pArgs) { errlHndl_t l_errl = NULL; IStepError l_stepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_host_setup_sbe entry" ); - //@TODO RTC:134078 - //call host_setup_sbe - //FAPI_INVOKE_HWP(l_errl,p9_set_fsi_gp_shadow); - if(l_errl) + // + // get a list of all the procs in the system + // + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); + + // + // identify master processor target + // + TARGETING::Target* l_pMasterProcTarget = NULL; + TARGETING::targetService().masterProcChipTargetHandle(l_pMasterProcTarget); + + for (const auto & l_procChip: l_cpuTargetList) { - l_stepError.addErrorDetails(l_errl); - errlCommit(l_errl, HWPF_COMP_ID); - } - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_host_setup_sbe exit" ); + // call only on non-master processor chips + if (l_procChip != l_pMasterProcTarget) + { + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> + l_fapi2_proc_target (l_procChip); + + //call p9_set_fsi_gp_shadow on non-master processors + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_set_fsi_gp_shadow HWP on processor target %.8X", + TARGETING::get_huid(l_procChip) ); + + FAPI_INVOKE_HWP(l_errl,p9_set_fsi_gp_shadow, l_fapi2_proc_target); + if(l_errl) + { + l_stepError.addErrorDetails(l_errl); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR : call p9_set_fsi_gp_shadow, PLID=0x%x", + l_errl->plid() ); + errlCommit(l_errl, HWPF_COMP_ID); + } + } + + } // end of cycling through all processor chips + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_host_setup_sbe exit" ); return l_stepError.getErrorHandle(); } }; diff --git a/src/usr/isteps/istep08/call_host_slave_sbe_config.C b/src/usr/isteps/istep08/call_host_slave_sbe_config.C index 322038448..e77133eb6 100644 --- a/src/usr/isteps/istep08/call_host_slave_sbe_config.C +++ b/src/usr/isteps/istep08/call_host_slave_sbe_config.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -51,11 +51,17 @@ #include <targeting/namedtarget.H> #include <targeting/attrsync.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + +#include <errl/errlmanager.H> + #include <isteps/hwpisteperror.H> #include <errl/errludtarget.H> -using namespace ISTEP; +#include <p9_setup_sbe_config.H> + using namespace ISTEP_ERROR; using namespace ERRORLOG; using namespace TARGETING; @@ -69,8 +75,8 @@ errlHndl_t set_proc_boot_voltage_vid() { errlHndl_t l_errl = NULL; IStepError l_stepError; - TRACDCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ENTER set_proc_boot_voltage_vid()"); + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ENTER set_proc_boot_voltage_vid()"); do { // Get the top level target/system target @@ -79,7 +85,7 @@ errlHndl_t set_proc_boot_voltage_vid() // If there is no top level target, terminate assert(l_pTopLevelTarget, "ERROR: Top level " - "target not found - slave_sbe.C::set_proc_boot_voltage_vid"); + "target not found - slave_sbe.C::set_proc_boot_voltage_vid"); // Get all Procs PredicateCTM l_proc(CLASS_CHIP, TYPE_PROC); @@ -90,7 +96,7 @@ errlHndl_t set_proc_boot_voltage_vid() TargetRangeFilter l_filter( targetService().begin(), targetService().end(), - &l_procs); + &l_procs ); //@TODO: RTC:133836 add this get ATTR /* @@ -122,7 +128,10 @@ errlHndl_t set_proc_boot_voltage_vid() } */ - }while( 0 ); + } while( 0 ); + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "EXIT set_proc_boot_voltage_vid()"); return l_errl; } @@ -133,18 +142,49 @@ void* call_host_slave_sbe_config(void *io_pArgs) { errlHndl_t l_errl = NULL; IStepError l_stepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_host_slave_sbe_config entry" ); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_host_slave_sbe_config entry" ); //@TODO RTC:134078 - // execute proc_read_nest_freq.C - // execute p9_setup_sbe_config.C - // FAPI_INVOKE_HWP(l_errl,p9_setup_sbe_config); - //if(l_errl) - //{ - // l_stepError.addErrorDetails(l_errl); - // errlCommit(l_errl, HWPF_COMP_ID); - //} + // execute proc_read_nest_freq.C //NOTE: Is this needed? Not documented + + // execute p9_setup_sbe_config.C for non-primary processor targets + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); + + TARGETING::Target* l_pMasterProcTarget = NULL; + TARGETING::targetService().masterProcChipTargetHandle(l_pMasterProcTarget); + + for (const auto & l_cpu_target: l_cpuTargetList) + { + // do not call HWP on master processor + if (l_cpu_target != l_pMasterProcTarget) + { + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> + l_fapi2_proc_target (l_cpu_target); + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_setup_sbe_config HWP on processor target %.8X", + TARGETING::get_huid(l_cpu_target) ); + + FAPI_INVOKE_HWP(l_errl, p9_setup_sbe_config, l_fapi2_proc_target); + + if( l_errl ) + { + ErrlUserDetailsTarget(l_cpu_target).addToLog( l_errl ); + + // Create IStep error log and cross ref error that occurred + l_stepError.addErrorDetails( l_errl ); + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR : call p9_setup_sbe_config, " + "PLID=0x%x", l_errl->plid() ); + + // Commit Error + errlCommit( l_errl, HWPF_COMP_ID ); + } + } + } // end of cycling through all processor chips #ifdef CONFIG_HTMGT // Set system frequency attributes @@ -165,15 +205,14 @@ void* call_host_slave_sbe_config(void *io_pArgs) l_errl = set_proc_boot_voltage_vid(); if( l_errl ) { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "Error setting PROC_BOOT_VOLTAGE_VID: " - "slave_sbe.C::call_host_slave_sbe_config()"); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Error setting PROC_BOOT_VOLTAGE_VID: " + "slave_sbe.C::call_host_slave_sbe_config()" ); // Create IStep error log l_stepError.addErrorDetails( l_errl ); // Commit Error errlCommit( l_errl, HWPF_COMP_ID ); - } // Enable SBE interrupt for OP systems @@ -188,7 +227,7 @@ void* call_host_slave_sbe_config(void *io_pArgs) // Resolve the side characteristics of the Processor SBE Seeproms #if 0 - //@TODO RTC:142091 + //@TODO-RTC:142091 errlHndl_t err = SBE::resolveProcessorSbeSeeproms(); if ( err ) { @@ -199,13 +238,12 @@ void* call_host_slave_sbe_config(void *io_pArgs) errlCommit( err, HWPF_COMP_ID ); } #endif - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_host_slave_sbe_config exit" ); - - + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_host_slave_sbe_config exit" ); // end task, returning any errorlogs to IStepDisp return l_stepError.getErrorHandle(); } + }; diff --git a/src/usr/isteps/istep08/call_proc_abus_scominit.C b/src/usr/isteps/istep08/call_proc_abus_scominit.C index aa4b912ea..aa789e016 100644 --- a/src/usr/isteps/istep08/call_proc_abus_scominit.C +++ b/src/usr/isteps/istep08/call_proc_abus_scominit.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,17 +50,17 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <pbusLinkSvc.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + // MVPD #include <devicefw/userif.H> #include <vpd/mvpdenums.H> #include <config.h> -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" + namespace ISTEP_08 { @@ -74,22 +74,16 @@ using namespace TARGETING; //****************************************************************************** void* call_proc_abus_scominit( void *io_pArgs ) { - -// errlHndl_t l_err = NULL; + errlHndl_t l_err = NULL; IStepError l_StepError; TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_proc_abus_scominit entry" ); - TARGETING::TargetHandleList l_cpuTargetList; - getAllChips(l_cpuTargetList, TYPE_PROC); - do { - - // @TODO RTC:134078 /* TargetPairs_t is defined in pbusLinkSvc, which is used by - * other isteps too + * other isteps too */ EDI_EI_INITIALIZATION::TargetPairs_t l_AbusConnections; // Note: // i_noDuplicate parameter must be set to false because @@ -118,26 +112,22 @@ void* call_proc_abus_scominit( void *io_pArgs ) } // For each ABUS pair - for (EDI_EI_INITIALIZATION::TargetPairs_t::iterator - l_abusPairIter = l_AbusConnections.begin(); - l_abusPairIter != l_AbusConnections.end(); - ++l_abusPairIter) + for (const auto & l_AbusConnection: l_AbusConnections) { // Make local copies of ABUS targets for ease of use TARGETING::Target* l_thisAbusTarget = - const_cast<TARGETING::Target*>(l_abusPairIter->first); + const_cast<TARGETING::Target*>(l_AbusConnection.first); TARGETING::Target* l_connectedAbusTarget = - const_cast<TARGETING::Target*>(l_abusPairIter->second); + const_cast<TARGETING::Target*>(l_AbusConnection.second); - // Get this abus fapi taget - const fapi::Target l_fapi_this_abus_target( - TARGET_TYPE_ABUS_ENDPOINT, - const_cast<TARGETING::Target*>(l_thisAbusTarget)); + // Get this abus fapi2 target + const fapi2::Target<fapi2::TARGET_TYPE_ABUS> l_thisAbusFapi2Target( + (const_cast<TARGETING::Target*>(l_thisAbusTarget))); - // Get connected abus fapi taget - const fapi::Target l_fapi_connected_abus_target( - TARGET_TYPE_ABUS_ENDPOINT, - const_cast<TARGETING::Target*>(l_connectedAbusTarget)); + // Get connected abus fapi2 target + const fapi2::Target<fapi2::TARGET_TYPE_ABUS> + l_connectedAbusFapi2Target( + (const_cast<TARGETING::Target*>(l_connectedAbusTarget))); // Call HW procedure TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, @@ -145,10 +135,11 @@ void* call_proc_abus_scominit( void *io_pArgs ) "Abus target HUID %.8X Connected Abus target HUID %.8X", TARGETING::get_huid(l_thisAbusTarget), TARGETING::get_huid(l_connectedAbusTarget)); + //@TODO RTC:134078 - //FAPI_INVOKE_HWP(l_err, p9_abus_scominit, - // l_fapi_this_abus_target, - // l_fapi_connected_abus_target); + //FAPI_INVOKE_HWP(l_err, p9_io_abus_scominit, + // l_thisAbusFapi2Target, + // l_connectedAbusFapi2Target); if (l_err) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, @@ -170,8 +161,7 @@ void* call_proc_abus_scominit( void *io_pArgs ) // after committing errlCommit(l_err, HWPF_COMP_ID); } - } // End abus list loop - */ + } // End abus pair list loop } while (0); return l_StepError.getErrorHandle(); diff --git a/src/usr/isteps/istep08/call_proc_attr_update.C b/src/usr/isteps/istep08/call_proc_attr_update.C index a95c45c9f..0b73652b5 100644 --- a/src/usr/isteps/istep08/call_proc_attr_update.C +++ b/src/usr/isteps/istep08/call_proc_attr_update.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,6 +50,8 @@ // targeting support #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> // MVPD #include <devicefw/userif.H> @@ -57,11 +59,8 @@ #include <config.h> -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" +#include <p9_attr_update.H> + namespace ISTEP_08 { @@ -78,21 +77,42 @@ void * call_proc_attr_update( void * io_pArgs ) IStepError l_StepError; errlHndl_t l_err = NULL; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_attr_update entry" ); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_attr_update entry" ); + + // + // get a list of all the procs in the system + // + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); - //@TODO: RTC:134078 Add HWP back in - //FAPI_INVOKE_HWP(l_err,p9_attr_update); - if(l_err) + // Loop through all processors including master + for (const auto & l_cpu_target: l_cpuTargetList) { - l_StepError.addErrorDetails(l_err); - errlCommit(l_err, HWPF_COMP_ID); - } + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>l_fapi2_proc_target( + l_cpu_target); - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_attr_update exit" ); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_attr_update HWP on processor target %.8X", + TARGETING::get_huid(l_cpu_target) ); - return l_StepError.getErrorHandle(); + FAPI_INVOKE_HWP(l_err, p9_attr_update, l_fapi2_proc_target); + if(l_err) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : p9_attr_update " + "HWP returns error for HUID %.8X", + l_err->reasonCode(), + TARGETING::get_huid(l_cpu_target) ); + l_StepError.addErrorDetails(l_err); + errlCommit(l_err, HWPF_COMP_ID); + } + } // end of going through all processors + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_attr_update exit" ); + + return l_StepError.getErrorHandle(); } + }; diff --git a/src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C b/src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C index 0ff4d4b58..2ed51063e 100644 --- a/src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C +++ b/src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -44,6 +44,7 @@ #include <sys/time.h> #include <devicefw/userif.H> #include <i2c/i2cif.H> +#include <sbe/sbeif.H> // targeting support #include <targeting/common/commontargeting.H> @@ -54,12 +55,20 @@ #include <isteps/hwpisteperror.H> #include <errl/errludtarget.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + +#include <p9_check_slave_sbe_seeprom_complete.H> +#include <p9_extract_sbe_rc.H> using namespace ISTEP; using namespace ISTEP_ERROR; using namespace ERRORLOG; using namespace TARGETING; +using namespace fapi2; +const uint64_t MS_TO_WAIT_FIRST = 2500; //(2.5 s) +const uint64_t MS_TO_WAIT_OTHERS= 100; //(100 ms) namespace ISTEP_08 { @@ -69,23 +78,11 @@ namespace ISTEP_08 void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) { errlHndl_t l_errl = NULL; - //@TODO RTC:134078 -/* IStepError l_stepError; - void* sbeImgPtr = NULL; - size_t sbeImgSize = 0; - //size_t l_wait_time = MS_TO_WAIT_OTHERS; - + IStepError l_stepError; TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_proc_check_slave_sbe_seeprom_complete entry" ); - //If in FSPless environment -- give time for SBE to complete on first chip -*/ - /*if (!INITSERVICE::spBaseServicesEnabled()) - { - l_wait_time = MS_TO_WAIT_FIRST; - }*/ -/* // // get the master Proc target, we want to IGNORE this one. // @@ -95,60 +92,57 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) // // get a list of all the procs in the system // - TARGETING::TargetHandleList l_procTargetList; - getAllChips(l_procTargetList, TYPE_PROC); + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "proc_check_slave_sbe_seeprom_complete: %d procs in the system.", - l_procTargetList.size() ); + l_cpuTargetList.size() ); // loop thru all the cpu's - for (TargetHandleList::const_iterator - l_proc_iter = l_procTargetList.begin(); - l_proc_iter != l_procTargetList.end(); - ++l_proc_iter) + for (const auto & l_cpu_target: l_cpuTargetList) { - // make a local copy of the Processor target - TARGETING::Target* l_pProcTarget = *l_proc_iter; - - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "target HUID %.8X", - TARGETING::get_huid(l_pProcTarget)); - - if ( l_pProcTarget == l_pMasterProcTarget ) + if ( l_cpu_target == l_pMasterProcTarget ) { // we are just checking the Slave SBE's, skip the master continue; } - l_errl = SBE::findSBEInPnor(l_pProcTarget,sbeImgPtr,sbeImgSize); + // TODO-RTC:138226 + /* + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Processor target HUID %.8X", + TARGETING::get_huid(l_cpu_target)); + l_errl = SBE::findSBEInPnor(l_cpu_target,sbeImgPtr,sbeImgSize); if (l_errl) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "ERROR : proc_check_slave_sbe_seeprom_complete " "Can't find SBE image in pnor"); - } + } */ - fapi::Target l_fapiProcTarget( fapi::TARGET_TYPE_PROC_CHIP, - l_pProcTarget ); - //@TODO RTC:134078 - // Invoke the HWP - fapi::ReturnCode rc_fapi = fapi::FAPI_RC_SUCCESS; - */ /*FAPI_EXEC_HWP(rc_fapi, - p9_check_slave_sbe_seeprom_complete, - l_fapiProcTarget, - sbeImgPtr, - l_wait_time);*/ + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2ProcTarget( + const_cast<TARGETING::Target*> (l_cpu_target)); + + // Invoke the HWP + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_check_slave_sbe_seeprom_complete HWP" + " on processor target %.8X", + TARGETING::get_huid(l_cpu_target) ); + + FAPI_INVOKE_HWP(l_errl, p9_check_slave_sbe_seeprom_complete, + l_fapi2ProcTarget); +/* TODO-RTC:138226 // check for re ipl request - /* if(static_cast<uint32_t>(rc_fapi) == + if(static_cast<uint32_t>(rc_fapi) == fapi::RC_PROC_EXTRACT_SBE_RC_ENGINE_RETRY) { l_errl = fapi::fapiRcToErrl(rc_fapi); // capture the target data in the elog - ErrlUserDetailsTarget(l_pProcTarget).addToLog( l_errl ); + ErrlUserDetailsTarget(l_cpu_target).addToLog( l_errl ); l_errl->setSev(ERRL_SEV_INFORMATIONAL); @@ -168,15 +162,15 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) { l_errl = fapi::fapiRcToErrl(rc_fapi); } - +*/ if (l_errl) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR : proc_check_slave_sbe_seeprom_complete", - "failed, returning errorlog" ); + "ERROR : call p9_check_slave_sbe_seeprom_complete, " + "PLID=0x%x", l_errl->plid() ); // capture the target data in the elog - ErrlUserDetailsTarget(l_pProcTarget).addToLog( l_errl ); + ErrlUserDetailsTarget(l_cpu_target).addToLog( l_errl ); // Create IStep error log and cross reference to error that occurred l_stepError.addErrorDetails( l_errl ); @@ -189,80 +183,94 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "SUCCESS : proc_check_slave_sbe_seeprom_complete", "completed ok"); - } - //after first one default to quick check time - //l_wait_time = MS_TO_WAIT_OTHERS; - } // endfor + + // Not a way to pass in -soft_err, assuming that is default behavior + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_extract_sbe_rc HWP" + " on processor target %.8X", + TARGETING::get_huid(l_cpu_target) ); + + FAPI_INVOKE_HWP(l_errl, p9_extract_sbe_rc, + l_fapi2ProcTarget); + if (l_errl) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR : proc_check_slave_sbe_seeprom_complete", + "failed, p9_extract_sbe_rc HWP returning errorlog PLID=0x%x", + l_errl->plid()); + + // capture the target data in the elog + ErrlUserDetailsTarget(l_cpu_target).addToLog( l_errl ); + + // Create IStep error log and cross reference to error that occurred + l_stepError.addErrorDetails( l_errl ); + + // Commit error log + errlCommit( l_errl, HWPF_COMP_ID ); + } + } // end of going through all processors // Once the sbe's are up correctly, fetch all the proc ECIDs and // store them in an attribute. - for (TargetHandleList::const_iterator - l_proc_iter = l_procTargetList.begin(); - l_proc_iter != l_procTargetList.end(); - ++l_proc_iter) + for (const auto & l_cpu_target: l_cpuTargetList) { - // make a local copy of the Processor target - TARGETING::Target* l_pProcTarget = *l_proc_iter; + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2ProcTarget( + const_cast<TARGETING::Target*> (l_cpu_target)); - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "target HUID %.8X --> calling proc_getecid", - TARGETING::get_huid(l_pProcTarget)); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running proc_getecid HWP" + " on processor target %.8X", + TARGETING::get_huid(l_cpu_target) ); - fapi::Target l_fapiProcTarget( fapi::TARGET_TYPE_PROC_CHIP, - l_pProcTarget ); +// TODO-RTC:149518 +/* + // proc_getecid should set the fuse string to 112 bits long. + ecmdDataBufferBase l_fuseString; + + // Invoke the HWP + FAPI_INVOKE_HWP(l_errl, + proc_getecid, + l_fapi2ProcTarget, + l_fuseString ); +*/ + if (l_errl) + { + if (l_cpu_target->getAttr<ATTR_HWAS_STATE>().functional) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR : proc_getecid", + " failed, returning errorlog" ); - // proc_getecid should set the fuse string to 112 bits long. - ecmdDataBufferBase l_fuseString; - //@TODO RTC:134078 - // Invoke the HWP - FAPI_INVOKE_HWP(l_errl, - proc_getecid, - l_fapiProcTarget, - l_fuseString ); + // capture the target data in the elog + ErrlUserDetailsTarget(l_cpu_target).addToLog( l_errl ); - if (l_errl) - { - if (l_procTargetList->getAttr<ATTR_HWAS_STATE>().functional) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR : proc_getecid", - " failed, returning errorlog" ); - - // capture the target data in the elog - ErrlUserDetailsTarget(l_pProcTarget).addToLog( l_errl ); - - // Create IStep error log and cross reference error that - // occurred - l_stepError.addErrorDetails( l_errl ); - - // Commit error log - errlCommit( l_errl, HWPF_COMP_ID ); - } - else // Not functional, proc deconfigured, don't report error - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR : proc_getecid", - " failed, proc target deconfigured" ); - - delete l_errl; - l_errl = NULL; - } + // Create IStep error log and cross reference error that + // occurred + l_stepError.addErrorDetails( l_errl ); + + // Commit error log + errlCommit( l_errl, HWPF_COMP_ID ); } - else + else // Not functional, proc deconfigured, don't report error { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : proc_getecid", - " completed ok"); - + "ERROR : proc_getecid", + " failed, proc target deconfigured" ); + delete l_errl; + l_errl = NULL; } - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "target HUID %.8X --> after proc_getecid", - TARGETING::get_huid(l_pProcTarget)); + } + else + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : proc_getecid", + " completed ok"); - } // endfor + } + } // end of going through all processors TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, @@ -270,7 +278,6 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs ) // end task, returning any errorlogs to IStepDisp return l_stepError.getErrorHandle(); - */ - return l_errl; } + }; diff --git a/src/usr/isteps/istep08/call_proc_chiplet_enable_ridi.C b/src/usr/isteps/istep08/call_proc_chiplet_enable_ridi.C index 84f2e1c55..2b8510a70 100644 --- a/src/usr/isteps/istep08/call_proc_chiplet_enable_ridi.C +++ b/src/usr/isteps/istep08/call_proc_chiplet_enable_ridi.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,6 +50,8 @@ // targeting support #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> // MVPD #include <devicefw/userif.H> @@ -57,11 +59,8 @@ #include <config.h> -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" + + namespace ISTEP_08 { @@ -75,22 +74,42 @@ using namespace TARGETING; //****************************************************************************** void* call_proc_chiplet_enable_ridi( void *io_pArgs ) { - errlHndl_t l_err = NULL; IStepError l_StepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_proc_chiplet_enable_ridi entry" ); - // @TODO RTC:134078 Call HWP - //FAPI_INVOKE_HWP(l_err,p9_chiplet_enable_ridi); - if(l_err) + // + // get a list of all the procs in the system + // + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); + + // Loop through all processors including master + for (const auto & l_cpu_target: l_cpuTargetList) { - l_StepError.addErrorDetails(l_err); - errlCommit(l_err, HWPF_COMP_ID); - } + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>l_fapi2_proc_target( + l_cpu_target); + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_chiplet_enable_ridi HWP on processor target %.8X", + TARGETING::get_huid(l_cpu_target) ); + + // @TODO RTC:149115 + //FAPI_INVOKE_HWP(l_err, p9_chiplet_enable_ridi, l_fapi2_proc_target); + if(l_err) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR: call p9_chiplet_enable_ridi, PLID=0x%x", + l_err->plid()); + l_StepError.addErrorDetails(l_err); + errlCommit(l_err, HWPF_COMP_ID); + } + + } // end of going through all processors - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_chiplet_enable_ridi"); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_chiplet_enable_ridi exit"); return l_StepError.getErrorHandle(); } diff --git a/src/usr/isteps/istep08/call_proc_chiplet_scominit.C b/src/usr/isteps/istep08/call_proc_chiplet_scominit.C index 880f85e08..b678d9c1d 100644 --- a/src/usr/isteps/istep08/call_proc_chiplet_scominit.C +++ b/src/usr/isteps/istep08/call_proc_chiplet_scominit.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,17 +50,18 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + // MVPD #include <devicefw/userif.H> #include <vpd/mvpdenums.H> #include <config.h> -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" +//#include <p9_chiplet_scominit.H> //TODO-RTC:149687 +#include <p9_psi_scominit.H> + namespace ISTEP_08 { @@ -74,70 +75,73 @@ using namespace TARGETING; //****************************************************************************** void* call_proc_chiplet_scominit( void *io_pArgs ) { - //errlHndl_t l_err = NULL; + errlHndl_t l_err = NULL; IStepError l_StepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_proc_chiplet_scominit entry" ); + // + // get a list of all the procs in the system + // TARGETING::TargetHandleList l_cpuTargetList; getAllChips(l_cpuTargetList, TYPE_PROC); - do + // Loop through all processors including master + for (const auto & l_cpu_target: l_cpuTargetList) { - // If running Sapphire, set sleep enable attribute here so - // initfile can be run correctly - if(is_sapphire_load()) + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>l_fapi2_proc_target( + l_cpu_target); + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_chiplet_scominit HWP on " + "target HUID %.8X", TARGETING::get_huid(l_cpu_target)); + + //TODO-RTC:149687 + //FAPI_INVOKE_HWP(l_err, p9_chiplet_scominit, l_fapi2_proc_target); + if (l_err) { - TARGETING::Target* l_sys = NULL; - TARGETING::targetService().getTopLevelTarget(l_sys); - assert( l_sys != NULL ); - uint8_t l_sleepEnable = 1; - l_sys->setAttr<TARGETING::ATTR_PM_SLEEP_ENABLE>(l_sleepEnable); + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "ERROR 0x%.8X : " + "p9_chiplet_scominit HWP returns error. target HUID %.8X", + l_err->reasonCode(), TARGETING::get_huid(l_cpu_target)); + + ErrlUserDetailsTarget(l_cpu_target).addToLog( l_err ); + + // Create IStep error log and cross ref to error that occurred + l_StepError.addErrorDetails( l_err ); + // We want to continue to the next target instead of exiting, + // Commit the error log and move on + // Note: Error log should already be deleted and set to NULL + // after committing + errlCommit(l_err, HWPF_COMP_ID); } - // ---------------------------------------------- - // Execute PROC_CHIPLET_SCOMINIT_FBC_IF initfile - // ---------------------------------------------- - - for (TARGETING::TargetHandleList::const_iterator - l_cpuIter = l_cpuTargetList.begin(); - l_cpuIter != l_cpuTargetList.end(); - ++l_cpuIter) + //call p9_psi_scominit + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_psi_scominit HWP on " + "target HUID %.8X", TARGETING::get_huid(l_cpu_target)); + FAPI_INVOKE_HWP(l_err,p9_psi_scominit, l_fapi2_proc_target); + if (l_err) { - /* @TODO: RTC:134078 Use fapi2 targets - const TARGETING::Target* l_cpu_target = *l_cpuIter; - const fapi::Target l_fapi_proc_target( TARGET_TYPE_PROC_CHIP, - ( const_cast<TARGETING::Target*>(l_cpu_target) ) ); - - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "Running proc_chiplet_scominit HWP on " - "target HUID %.8X", TARGETING::get_huid(l_cpu_target)); - - // @TODO RTC:134078 call the HWP with each fapi::Target - //FAPI_INVOKE_HWP(l_err, p9_chiplet_scominit, l_fapi_proc_target); - if (l_err) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "ERROR 0x%.8X : " - "proc_chiplet_scominit HWP returns error. target HUID %.8X", - l_err->reasonCode(), TARGETING::get_huid(l_cpu_target)); - - ErrlUserDetailsTarget(l_cpu_target).addToLog( l_err ); - - // Create IStep error log and cross ref to error that occurred - l_StepError.addErrorDetails( l_err ); - // We want to continue to the next target instead of exiting, - // Commit the error log and move on - // Note: Error log should already be deleted and set to NULL - // after committing - errlCommit(l_err, HWPF_COMP_ID); - } - //call p9_psi_scominit - //FAPI_INVOKE_HWP(l_err,p9_psi_scominit); - */ + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "ERROR 0x%.8X : " + "proc_psi_scominit HWP returns error. target HUID %.8X", + l_err->reasonCode(), TARGETING::get_huid(l_cpu_target)); + + ErrlUserDetailsTarget(l_cpu_target).addToLog( l_err ); + + // Create IStep error log and cross ref to error that occurred + l_StepError.addErrorDetails( l_err ); + + // We want to continue to the next target instead of exiting, + // Commit the error log and move on + // Note: Error log should already be deleted and set to NULL + // after committing + errlCommit(l_err, HWPF_COMP_ID); } + } // end of going through all processors - } while (0); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_chiplet_scominit exit" ); return l_StepError.getErrorHandle(); } diff --git a/src/usr/isteps/istep08/call_proc_npu_scominit.C b/src/usr/isteps/istep08/call_proc_npu_scominit.C index 6104793f6..e62821ba7 100644 --- a/src/usr/isteps/istep08/call_proc_npu_scominit.C +++ b/src/usr/isteps/istep08/call_proc_npu_scominit.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -51,17 +51,17 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + // MVPD #include <devicefw/userif.H> #include <vpd/mvpdenums.H> #include <config.h> -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" +#include <p9_npu_scominit.H> + namespace ISTEP_08 { @@ -79,18 +79,38 @@ void* call_proc_npu_scominit( void *io_pArgs ) errlHndl_t l_err = NULL; IStepError l_StepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_npu_scominit entry" ); - //@TODO RTC:134078 Call HWP - //FAPI_INVOKE_HWP(l_err,p9_npu_scominit); - if(l_err) + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_npu_scominit entry" ); + + // + // get a list of all the procs in the system + // + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); + + // Loop through all processors, including master + for (const auto & l_cpu_target: l_cpuTargetList) { - l_StepError.addErrorDetails(l_err); - errlCommit(l_err, HWPF_COMP_ID); - } + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>l_fapi2_proc_target( + l_cpu_target); - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_npu_scominit exit"); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_npu_scominit HWP on " + "target HUID %.8X", TARGETING::get_huid(l_cpu_target) ); + FAPI_INVOKE_HWP(l_err, p9_npu_scominit, l_fapi2_proc_target); + if(l_err) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : p9_npu_scominit " + "HWP returns error for HUID %.8X", + l_err->reasonCode(), + TARGETING::get_huid(l_cpu_target) ); + l_StepError.addErrorDetails(l_err); + errlCommit(l_err, HWPF_COMP_ID); + } + } + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_npu_scominit exit" ); return l_StepError.getErrorHandle(); } diff --git a/src/usr/isteps/istep08/call_proc_obus_scominit.C b/src/usr/isteps/istep08/call_proc_obus_scominit.C index f94ebc16d..61d9127b6 100644 --- a/src/usr/isteps/istep08/call_proc_obus_scominit.C +++ b/src/usr/isteps/istep08/call_proc_obus_scominit.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -51,17 +51,17 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <pbusLinkSvc.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + // MVPD #include <devicefw/userif.H> #include <vpd/mvpdenums.H> #include <config.h> +//#include <p9_io_obus_scominit.H> // TODO-RTC:149687 -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" namespace ISTEP_08 { @@ -75,22 +75,79 @@ using namespace TARGETING; //****************************************************************************** void* call_proc_obus_scominit( void *io_pArgs ) { - errlHndl_t l_err = NULL; IStepError l_StepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_obus_scominit entry" ); - //@TODO RTC:134078 Call HWP - //FAPI_INVOKE_HWP(l_err,p9_obus_scominit); - if(l_err) - { - l_StepError.addErrorDetails(l_err); - errlCommit(l_err, HWPF_COMP_ID); - } - - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_obus_scominit exit"); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_obus_scominit entry" ); + + do { + EDI_EI_INITIALIZATION::TargetPairs_t l_ObusConnections; + // Note: + // i_noDuplicate parameter must be set to false because + // two separate calls would be needed: + // O0 <--> O1 + // O1 <--> O0 + // only the first target is used to issue SCOMs + l_err = + EDI_EI_INITIALIZATION::PbusLinkSvc::getTheInstance().getPbusConnections( + l_ObusConnections, TYPE_OBUS, false); + if (l_err) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : getPbusConnections TYPE_OBUS returns error", + l_err->reasonCode() ); + + // Create IStep error log and cross reference to error that occurred + l_StepError.addErrorDetails( l_err ); + // Commit the error log + // Log should be deleted and set to NULL in errlCommit. + errlCommit(l_err, HWPF_COMP_ID); + + // Shouldn't continue on this fatal error (no OBUS), break out + break; + } + + for (const auto & l_ObusConnection: l_ObusConnections) + { + const TARGETING::Target* l_thisObusTarget = l_ObusConnection.first; + const TARGETING::Target* l_connectedObusTarget = + l_ObusConnection.second; + + const fapi2::Target<fapi2::TARGET_TYPE_OBUS> + l_thisObusFapi2Target( + (const_cast<TARGETING::Target*>(l_thisObusTarget))); + + const fapi2::Target<fapi2::TARGET_TYPE_OBUS> + l_connectedObusFapi2Target( + (const_cast<TARGETING::Target*>(l_connectedObusTarget))); + + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_io_obus_scominit HWP on " + "This OBUS target %.8X - Connected OBUS target %.8X", + TARGETING::get_huid(l_thisObusTarget), + TARGETING::get_huid(l_connectedObusTarget) ); + + //TODO-RTC:149687 + //FAPI_INVOKE_HWP(l_err, p9_io_obus_scominit, + // l_thisObusFapi2Target, l_connectedObusFapi2Target); + + if(l_err) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%x: returned from p9_io_obus_scominit on " + "OBUS target %.8X - connected target %.8X, PLID=0x%x", + l_err->plid(), + TARGETING::get_huid(l_thisObusTarget), + TARGETING::get_huid(l_connectedObusTarget) ); + l_StepError.addErrorDetails(l_err); + errlCommit(l_err, HWPF_COMP_ID); + } + } // end of looping through Obus pairs + } while (0); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_obus_scominit exit" ); return l_StepError.getErrorHandle(); } diff --git a/src/usr/isteps/istep08/call_proc_pcie_scominit.C b/src/usr/isteps/istep08/call_proc_pcie_scominit.C index ebf26d82e..92a4c1432 100644 --- a/src/usr/isteps/istep08/call_proc_pcie_scominit.C +++ b/src/usr/isteps/istep08/call_proc_pcie_scominit.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -51,17 +51,17 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + // MVPD #include <devicefw/userif.H> #include <vpd/mvpdenums.H> #include <config.h> -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" +#include <p9_pcie_scominit.H> + namespace ISTEP_08 { @@ -76,20 +76,29 @@ using namespace TARGETING; void* call_proc_pcie_scominit( void *io_pArgs ) { errlHndl_t l_errl = NULL; - //@TODO RTC:134078 -/* IStepError l_StepError; + IStepError l_StepError; bool spBaseServicesEnabled = INITSERVICE::spBaseServicesEnabled(); - TARGETING::TargetHandleList l_procTargetList; - getAllChips(l_procTargetList, TYPE_PROC); + // + // get the master Proc target, we want to IGNORE this one. + // + TARGETING::Target* l_pMasterProcTarget = NULL; + TARGETING::targetService().masterProcChipTargetHandle(l_pMasterProcTarget); + + // + // get a list of all the procs in the system + // + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); - for ( TargetHandleList::const_iterator - l_iter = l_procTargetList.begin(); - l_iter != l_procTargetList.end(); - ++l_iter ) + for (const auto & l_cpu_target: l_cpuTargetList) { - TARGETING::Target* const l_proc_target = *l_iter; + if ( l_cpu_target == l_pMasterProcTarget ) + { + // we are just checking the Slave PCI's, skip the master + continue; + } // Compute the PCIE attribute config on all non-SP systems, since SP // won't be there to do it. @@ -97,41 +106,41 @@ void* call_proc_pcie_scominit( void *io_pArgs ) { // Unlike SP which operates on all present procs, the SP-less // algorithm only needs to operate on functional ones - l_errl = computeProcPcieConfigAttrs(l_proc_target); + // TODO-RTC:149525 + //l_errl = computeProcPcieConfigAttrs(l_cpu_target); if(l_errl != NULL) { // Any failure to configure PCIE that makes it to this handler // implies a firmware bug that should be fixed, everything else // is tolerated internally (usually as disabled PHBs) - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - ERR_MRK "call_proc_pcie_scominit> Failed in call to " - "computeProcPcieConfigAttrs for target with HUID = " - "0x%08X", - l_proc_target->getAttr<TARGETING::ATTR_HUID>()); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + ERR_MRK "call_proc_pcie_scominit> Failed in call to " + "computeProcPcieConfigAttrs for target with HUID = " + "0x%08X", + l_cpu_target->getAttr<TARGETING::ATTR_HUID>() ); l_StepError.addErrorDetails(l_errl); errlCommit( l_errl, ISTEP_COMP_ID ); } } - const fapi::Target l_fapi_proc_target( TARGET_TYPE_PROC_CHIP, - ( const_cast<TARGETING::Target*>(l_proc_target) )); + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2_proc_target( + l_cpu_target); TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "Running proc_pcie_scominit HWP on " - "target HUID %.8X", TARGETING::get_huid(l_proc_target)); + "Running p9_pcie_scominit HWP on " + "target HUID %.8X", TARGETING::get_huid(l_cpu_target) ); - // call the HWP with each fapi::Target - // @TODO RTC: 134078 - //FAPI_INVOKE_HWP(l_errl, p9_pcie_scominit, l_fapi_proc_target); + // call the HWP with each fapi2::Target + FAPI_INVOKE_HWP(l_errl, p9_pcie_scominit, l_fapi2_proc_target); if (l_errl) { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X : proc_pcie_scominit HWP returns error", - l_errl->reasonCode()); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : p9_pcie_scominit HWP returned error", + l_errl->reasonCode() ); // capture the target data in the elog - ErrlUserDetailsTarget(l_proc_target).addToLog( l_errl ); + ErrlUserDetailsTarget(l_cpu_target).addToLog( l_errl ); // Create IStep error log and cross reference to error that occurred l_StepError.addErrorDetails( l_errl ); @@ -143,16 +152,14 @@ void* call_proc_pcie_scominit( void *io_pArgs ) else { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : proc_pcie_scominit HWP" ); + "SUCCESS : proc_pcie_scominit HWP" ); } - } + } // end of looping through all processors TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_pcie_scominit exit" ); + "call_proc_pcie_scominit exit" ); // end task, returning any errorlogs to IStepDisp return l_StepError.getErrorHandle(); - */ - return l_errl; } }; diff --git a/src/usr/isteps/istep08/call_proc_scomoverride_chiplets.C b/src/usr/isteps/istep08/call_proc_scomoverride_chiplets.C index eb5cf07cd..8409efd2f 100644 --- a/src/usr/isteps/istep08/call_proc_scomoverride_chiplets.C +++ b/src/usr/isteps/istep08/call_proc_scomoverride_chiplets.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -50,16 +50,18 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> +#include <errl/errlmanager.H> + // MVPD #include <devicefw/userif.H> #include <vpd/mvpdenums.H> #include <config.h> -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" + +#include <p9_scomoverride_chiplets.H> + namespace ISTEP_08 { @@ -72,39 +74,54 @@ using namespace TARGETING; //***************************************************************************** // wrapper function to call proc_scomoverride_chiplets //***************************************************************************** -void* call_proc_scomoverride_chiplets( void *io_pArgs ) +void* call_proc_scomoverride_chiplets( void *io_pArgs ) { - errlHndl_t l_errl = NULL; + errlHndl_t l_errl = NULL; + IStepError l_StepError; - IStepError l_StepError; + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_scomoverride_chiplets entry" ); - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_scomoverride_chiplets entry" ); + // + // get a list of all the procs in the system + // + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); - //@TODO RTC:134078 - //FAPI_INVOKE_HWP(l_errl, p9_scomoverride_chiplets); - - if (l_errl) + // Loop through all processors, including master + for (const auto & l_cpu_target: l_cpuTargetList) { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X : proc_scomoverride_chiplets " - "HWP returns error", - l_errl->reasonCode()); + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> + l_fapi2_proc_target (l_cpu_target); + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_scomoverride_chiplets HWP on processor target %.8X", + TARGETING::get_huid(l_cpu_target) ); + + FAPI_INVOKE_HWP(l_errl, p9_scomoverride_chiplets, l_fapi2_proc_target); + + if (l_errl) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : proc_scomoverride_chiplets " + "HWP returns error", + l_errl->reasonCode() ); // Create IStep error log and cross reference to error that occurred l_StepError.addErrorDetails( l_errl ); // Commit Error errlCommit( l_errl, HWPF_COMP_ID ); - } - else - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : proc_scomoverride_chiplets HWP"); - } - - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_scomoverride_chiplets exit" ); + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : proc_scomoverride_chiplets HWP" ); + } + } // end of going through all processors + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_scomoverride_chiplets exit" ); // end task, returning any errorlogs to IStepDisp return l_StepError.getErrorHandle(); diff --git a/src/usr/isteps/istep08/call_proc_xbus_scominit.C b/src/usr/isteps/istep08/call_proc_xbus_scominit.C index cf99232d0..efc9f05c2 100644 --- a/src/usr/isteps/istep08/call_proc_xbus_scominit.C +++ b/src/usr/isteps/istep08/call_proc_xbus_scominit.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -51,17 +51,17 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +#include <pbusLinkSvc.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> + // MVPD #include <devicefw/userif.H> #include <vpd/mvpdenums.H> #include <config.h> +//#include <p9_io_xbus_scominit.H> // TODO-RTC:149687 - enable when ready -// -- prototype includes -- -// Add any customized routines that you don't want overwritten into -// "start_clocks_on_nest_chiplets_custom.C" and include -// the prototypes here. -// #include "nest_chiplets_custom.H" namespace ISTEP_08 { @@ -70,22 +70,18 @@ using namespace ISTEP_ERROR; using namespace ERRORLOG; using namespace TARGETING; -//***************************************************************************** +//****************************************************************************** // wrapper function to call proc_xbus_scominit //****************************************************************************** -void* call_proc_xbus_scominit( void *io_pArgs ) +void* call_proc_xbus_scominit( void *io_pArgs ) { -// errlHndl_t l_err = NULL; + errlHndl_t l_err = NULL; IStepError l_StepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "call_proc_xbus_scominit entry" ); - + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_xbus_scominit entry" ); do { - - /* @TODO RTC:134078 - EDI_EI_INITIALIZATION::TargetPairs_t l_XbusConnections; // Note: // i_noDuplicate parameter must be set to false because @@ -98,9 +94,9 @@ void* call_proc_xbus_scominit( void *io_pArgs ) l_XbusConnections, TYPE_XBUS, false); if (l_err) { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X : getPbusConnections XBUS returns error", - l_err->reasonCode()); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : getPbusConnections XBUS returns error", + l_err->reasonCode() ); // Create IStep error log and cross reference to error that occurred l_StepError.addErrorDetails( l_err ); @@ -112,38 +108,37 @@ void* call_proc_xbus_scominit( void *io_pArgs ) break; } - for (EDI_EI_INITIALIZATION::TargetPairs_t::const_iterator - l_itr = l_XbusConnections.begin(); - l_itr != l_XbusConnections.end(); ++l_itr) + for (const auto & l_XbusConnection: l_XbusConnections) { - const TARGETING::Target* l_thisXbusTarget = l_itr->first; - const TARGETING::Target* l_connectedXbusTarget = l_itr->second; + const TARGETING::Target* l_thisXbusTarget = l_XbusConnection.first; + const TARGETING::Target* l_connectedXbusTarget = + l_XbusConnection.second; + + const fapi2::Target<fapi2::TARGET_TYPE_XBUS> + l_thisXbusFapi2Target( + (const_cast<TARGETING::Target*>(l_thisXbusTarget))); + + const fapi2::Target<fapi2::TARGET_TYPE_XBUS> + l_connectedXbusFapi2Target( + (const_cast<TARGETING::Target*>(l_connectedXbusTarget))); - // Call HW procedure TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "Running proc_xbus_scominit HWP on " - "This XBUS target %.8X - Connected XBUS target %.8X", - TARGETING::get_huid(l_thisXbusTarget), - TARGETING::get_huid(l_connectedXbusTarget)); - - const fapi::Target l_thisXbusFapiTarget( - TARGET_TYPE_XBUS_ENDPOINT, - (const_cast<TARGETING::Target*>(l_thisXbusTarget))); - - const fapi::Target l_connectedXbusFapiTarget( - TARGET_TYPE_XBUS_ENDPOINT, - (const_cast<TARGETING::Target*>(l_connectedXbusTarget))); - //@TODO RTC:134078 - //FAPI_INVOKE_HWP(l_err, p9_xbus_scominit, - // l_thisXbusFapiTarget, l_connectedXbusFapiTarget); + "Running p9_io_xbus_scominit HWP on " + "This XBUS target %.8X - Connected XBUS target %.8X", + TARGETING::get_huid(l_thisXbusTarget), + TARGETING::get_huid(l_connectedXbusTarget) ); + + // TODO-RTC:149687 + //FAPI_INVOKE_HWP(l_err, p9_io_xbus_scominit, + // l_thisXbusFapi2Target, l_connectedXbusFapi2Target); if (l_err) { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X : proc_xbus_scominit HWP returns error. " - "This XBUS target %.8X - Connected XBUS target %.8X", - l_err->reasonCode(), - TARGETING::get_huid(l_thisXbusTarget), - TARGETING::get_huid(l_connectedXbusTarget)); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : proc_xbus_scominit HWP returned error. " + "This XBUS target %.8X - Connected XBUS target %.8X", + l_err->reasonCode(), + TARGETING::get_huid(l_thisXbusTarget), + TARGETING::get_huid(l_connectedXbusTarget) ); // capture the target data in the elog ErrlUserDetailsTarget(l_thisXbusTarget).addToLog( l_err ); @@ -157,11 +152,14 @@ void* call_proc_xbus_scominit( void *io_pArgs ) // after committing errlCommit(l_err, HWPF_COMP_ID); } + } // end of going through pairs - } -*/ } while (0); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_proc_xbus_scominit exit" ); + return l_StepError.getErrorHandle(); } + }; diff --git a/src/usr/isteps/istep08/makefile b/src/usr/isteps/istep08/makefile index 065b4b4ac..f5a4e9185 100644 --- a/src/usr/isteps/istep08/makefile +++ b/src/usr/isteps/istep08/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2015 +# Contributors Listed Below - COPYRIGHT 2015,2016 # [+] International Business Machines Corp. # # @@ -23,8 +23,20 @@ # # IBM_PROLOG_END_TAG ROOTPATH = ../../../.. +PROCEDURES_PATH = ${ROOTPATH}/src/import/chips/p9/procedures MODULE = istep08 +EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/pm/ +EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/perv/ +EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/nest/ +EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/io/ +EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/initfiles/ +EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/ +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/ +EXTRAINCDIR += ${ROOTPATH}/src/usr/isteps/ + OBJS += call_host_slave_sbe_config.o OBJS += call_host_setup_sbe.o OBJS += call_host_cbs_start.o @@ -42,6 +54,66 @@ OBJS += call_proc_scomoverride_chiplets.o OBJS += call_proc_chiplet_enable_ridi.o OBJS += call_host_rng_bist.o -EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer/ +VPATH += ${PROCEDURES_PATH}/hwp/perv/ ${PROCEDURES_PATH}/hwp/nest/ +VPATH += ${PROCEDURES_PATH}/hwp/io/ ${PROCEDURES_PATH}/hwp/initfiles/ + + +include ${ROOTPATH}/procedure.rules.mk +# 8.1 host_slave_sbe_config +include ${PROCEDURES_PATH}/hwp/perv/p9_setup_sbe_config.mk + +# 8.2 host_setup_sbe +include ${PROCEDURES_PATH}/hwp/perv/p9_set_fsi_gp_shadow.mk + +# 8.3 host_cbs_start +include ${PROCEDURES_PATH}/hwp/perv/p9_start_cbs.mk + +# 8.4 proc_check_slave_sbe_seeprom_complete : Check Slave SBE Complete +include ${PROCEDURES_PATH}/hwp/perv/p9_check_slave_sbe_seeprom_complete.mk +include ${PROCEDURES_PATH}/hwp/perv/p9_extract_sbe_rc.mk + +# 8.5 proc_cen_ref_clk_enable +# Cummulus only -- p9_cen_ref_clk_enable.mk not defined yet + +# 8.6 proc_attr_update: Proc ATTR Update +include ${PROCEDURES_PATH}/hwp/nest/p9_attr_update.mk + +# 8.7 proc_enable_osclite +# Cummulus only -- p9_enable_osclite.mk not defined yet + +# 8.8 proc_chiplet_scominit : Scom inits to all chiplets (sans Quad) +#TODO-RTC:149687 - HWP requires p9_fbc_scom.H +#include ${PROCEDURES_PATH}/hwp/nest/p9_chiplet_scominit.mk +include ${PROCEDURES_PATH}/hwp/nest/p9_psi_scominit.mk +#include ${PROCEDURES_PATH}/hwp/initfiles/p9_fbc_scom.mk +include ${PROCEDURES_PATH}/hwp/initfiles/p9_psi_scom.mk + +# 8.9 proc_xbus_scominit : Apply scom inits to Xbus +# TODO-RTC:149687 +# Now missing p9_io_regs.H, p9_xbus_g0_scom.H and p9_xbus_g1_scom.H +#include ${PROCEDURES_PATH}/hwp/io/p9_io_xbus_scominit.mk + +# 8.10 proc_abus_scominit : Apply scom inits to Abus +# HWP not found - p9_abus_scominit.mk not defined + +# 8.11 proc_obus_scominit : Apply scom inits to Obus +# TODO-RTC:149687 - Missing p9_io_regs.H +#include ${PROCEDURES_PATH}/hwp/io/p9_io_obus_scominit.mk + +# 8.12 proc_npu_scominit : Apply scom inits to NPU bus +include ${PROCEDURES_PATH}/hwp/nest/p9_npu_scominit.mk + +# 8.13 proc_pcie_scominit : Apply scom inits to PCIe chiplets +include ${PROCEDURES_PATH}/hwp/nest/p9_pcie_scominit.mk + +# 8.14 proc_scomoverride_chiplets : Apply sequenced scom inits +include ${PROCEDURES_PATH}/hwp/nest/p9_scomoverride_chiplets.mk + +# 8.15 proc_chiplet_enable_ridi : Apply RI/DI chip wide +# TODO-RTC:149115 - missing parameter in fapi2::getChildren() +#include ${PROCEDURES_PATH}/hwp/perv/p9_chiplet_enable_ridi.mk + +# 8.16 host_rng_bist : Trigger Built In Self Test +# HWP not ready - p9_trigger_rng_bist.mk include ${ROOTPATH}/config.mk diff --git a/src/usr/isteps/makefile b/src/usr/isteps/makefile index 5263dadf0..ea4c29168 100644 --- a/src/usr/isteps/makefile +++ b/src/usr/isteps/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2011,2015 +# Contributors Listed Below - COPYRIGHT 2011,2016 # [+] International Business Machines Corp. # # @@ -41,6 +41,7 @@ SUBDIRS+=istep21.d OBJS += hwpisteperror.o OBJS += hwpistepud.o OBJS += istepHelperFuncs.o +OBJS += pbusLinkSvc.o EXTRAINCDIR += ${ROOTPATH}/src/usr/initservice/istepdispatcher diff --git a/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.C b/src/usr/isteps/pbusLinkSvc.C index 5c40c091a..7fd75dfc0 100644 --- a/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.C +++ b/src/usr/isteps/pbusLinkSvc.C @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/hwpf/hwp/bus_training/pbusLinkSvc.C $ */ +/* $Source: src/usr/isteps/pbusLinkSvc.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -23,13 +23,13 @@ /* */ /* IBM_PROLOG_END_TAG */ #include "pbusLinkSvc.H" -#include <isteps/hwpf_reasoncodes.H> +#include <isteps/istep_reasoncodes.H> namespace EDI_EI_INITIALIZATION { using namespace TARGETING; -using namespace fapi; +using namespace ISTEP; PbusLinkSvc & PbusLinkSvc::getTheInstance() { @@ -55,11 +55,13 @@ errlHndl_t PbusLinkSvc::getPbusConnections( TargetPairs_t & o_PbusConnections, mutex_lock(&iv_mutex); - if (i_busType == TYPE_ABUS) + switch (i_busType) + { + case TYPE_ABUS: { if (iv_abusConnections.size() == 0) { - l_errl = collectPbusConections( TYPE_ABUS ); + l_errl = collectPbusConnections( TYPE_ABUS ); } if (l_errl == NULL) { @@ -67,11 +69,25 @@ errlHndl_t PbusLinkSvc::getPbusConnections( TargetPairs_t & o_PbusConnections, &iv_abusConnections; } } - else + break; + case TYPE_OBUS: + { + if (iv_obusConnections.size() == 0) + { + l_errl = collectPbusConnections( TYPE_OBUS ); + } + if (l_errl == NULL) + { + l_PbusConnections = i_noDuplicate ? &iv_obusUniqueConnections : + &iv_obusConnections; + } + } + break; + case TYPE_XBUS: { if (iv_xbusConnections.size() == 0) { - l_errl = collectPbusConections( TYPE_XBUS ); + l_errl = collectPbusConnections( TYPE_XBUS ); } if (l_errl == NULL) { @@ -79,6 +95,25 @@ errlHndl_t PbusLinkSvc::getPbusConnections( TargetPairs_t & o_PbusConnections, &iv_xbusConnections; } } + break; + default: + { + /*@ + * @errortype ERRL_SEV_UNRECOVERABLE + * @moduleid MOD_EDI_EI_IO_RUN_TRAINING + * @reasoncode RC_INVALID_TARGET_TYPE + * @userdata1 bus type + * @custdesc Platform generated error. See User Data. + * @devdesc Unexpected bus target type + */ + l_errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + MOD_EDI_EI_IO_RUN_TRAINING, + RC_INVALID_TARGET_TYPE, + i_busType ); + } + break; + } if (l_errl == NULL) { @@ -92,30 +127,64 @@ errlHndl_t PbusLinkSvc::getPbusConnections( TargetPairs_t & o_PbusConnections, } -errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType ) +errlHndl_t PbusLinkSvc::collectPbusConnections( TYPE i_busType ) { errlHndl_t l_errl = NULL; // Get all functional i_busType chiplets TARGETING::TargetHandleList l_busTargetList; getAllChiplets(l_busTargetList, i_busType); + TRACFCOMP( TARGETING::g_trac_targeting, + "PbusLinkSvc::collectPbusConnections - getAllChiplets(%d type) " + "returned %d entries", i_busType, l_busTargetList.size()); // select the appropriate maps to work with - TargetPairs_t & l_PbusConnections = (i_busType == TYPE_ABUS) ? - iv_abusConnections : iv_xbusConnections; - TargetPairs_t & l_PbusUniqueConnections = (i_busType == TYPE_ABUS) ? - iv_abusUniqueConnections : iv_xbusUniqueConnections; + TargetPairs_t * l_pPbusConnections; + TargetPairs_t * l_pPbusUniqueConnections; + switch (i_busType) + { + case TYPE_ABUS: + { + l_pPbusConnections = &iv_abusConnections; + l_pPbusUniqueConnections = &iv_abusUniqueConnections; + break; + } + case TYPE_OBUS: + { + l_pPbusConnections = &iv_obusConnections; + l_pPbusUniqueConnections = &iv_obusUniqueConnections; + break; + } + case TYPE_XBUS: + default: + { + l_pPbusConnections = &iv_xbusConnections; + l_pPbusUniqueConnections = &iv_xbusUniqueConnections; + break; + } + } // Collect all functional i_busType pbus connections - for (TargetHandleList::iterator l_bus_iter = l_busTargetList.begin(); - (l_errl == NULL) && (l_bus_iter != l_busTargetList.end()); - ++l_bus_iter) + for (const auto & l_pTarget: l_busTargetList) { - // get two endpoint targets - const TARGETING::Target * l_pTarget = *l_bus_iter; - const TARGETING::Target * l_dstTgt = + // exit for loop if error already encountered + if (NULL != l_errl) + { + break; + } + + // get other endpoint target + TRACFCOMP( TARGETING::g_trac_targeting, + "Get other endpoint target for target HUID %.8X", + TARGETING::get_huid(l_pTarget) ); + + const TARGETING::Target * l_dstTgt = l_pTarget->getAttr<ATTR_PEER_TARGET>(); + TRACFCOMP( TARGETING::g_trac_targeting, + "Other endpoint target HUID %.8X", + TARGETING::get_huid(l_dstTgt) ); + // connection is existing, not to itself and is a real target if ((l_dstTgt != NULL) && (l_dstTgt != l_pTarget)) { @@ -124,7 +193,7 @@ errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType ) { TRACFCOMP(TARGETING::g_trac_targeting, "Both endpoints' bus type mismatch; " - "target HUID %.8X dest HUID", + "target HUID %.8X: dest HUID %.8X", TARGETING::get_huid(l_pTarget), TARGETING::get_huid(l_dstTgt)); @@ -135,7 +204,8 @@ errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType ) * @reasoncode RC_MIXED_PBUS_CONNECTION * @userdata1 Endpoint1 bus type * @userdata2 Endpoint2 bus type - * @devdesc Platform generated error. See User Data. + * @custdesc Platform generated error. See User Data. + * @devdesc Mixed bus connection of two types */ l_errl = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, @@ -143,7 +213,7 @@ errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType ) RC_MIXED_PBUS_CONNECTION, i_busType, l_dstType ); - continue; + break; } // Get the chip parents of endpoints @@ -163,25 +233,25 @@ errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType ) * @errortype ERRL_SEV_UNRECOVERABLE * @moduleid MOD_EDI_EI_IO_RUN_TRAINING * @reasoncode RC_SAME_CHIP_PBUS_CONNECTION - * @devdesc Platform generated error. + * @custdesc Platform generated error. + * @devdesc Both endpoint connections of same chip */ l_errl = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, MOD_EDI_EI_IO_RUN_TRAINING, RC_SAME_CHIP_PBUS_CONNECTION ); - continue; + break; } - for (TargetHandleList::iterator l_dst_iter = l_busTargetList.begin(); - l_dst_iter != l_busTargetList.end(); - ++l_dst_iter) + + for (const auto l_dstTarget: l_busTargetList) { // l_dstTgt is functional - if (l_dstTgt == *l_dst_iter) + if (l_dstTgt == l_dstTarget) { // save the pair if not yet done so - l_PbusConnections[l_pTarget] = l_dstTgt; - l_PbusUniqueConnections[l_pTarget] = l_dstTgt; + (*l_pPbusConnections)[l_pTarget] = l_dstTgt; + (*l_pPbusUniqueConnections)[l_pTarget] = l_dstTgt; break; } } @@ -190,26 +260,31 @@ errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType ) // Validate pbus connections are valid and strike out // duplicates for the Unique connection map - TargetPairs_t::iterator l_itr, l_jtr; - for (l_itr = l_PbusUniqueConnections.begin(); - (l_errl == NULL) && (l_itr != l_PbusUniqueConnections.end()); - ++l_itr) + TargetPairs_t::iterator l_jtr; + + for (const auto l_PbusConnection : (*l_pPbusUniqueConnections)) { - const TARGETING::Target *l_ptr1 = l_itr->first; - const TARGETING::Target *l_ptr2 = l_itr->second; - l_jtr = l_PbusUniqueConnections.find(l_ptr2); - if ((l_jtr == l_PbusUniqueConnections.end()) - || (l_jtr->second != l_ptr1)) + // exit for loop if error already encountered + if (NULL != l_errl) + { + break; + } + + const TARGETING::Target *l_ptr1 = l_PbusConnection.first; + const TARGETING::Target *l_ptr2 = l_PbusConnection.second; + l_jtr = l_pPbusUniqueConnections->find(l_ptr2); + if ( (l_jtr == l_pPbusUniqueConnections->end()) || + (l_jtr->second != l_ptr1) ) { // Connection is conflicting, e.g. // endp1 -> endp2 but endp2 -> endp3. // endp1 -> endp2 but endp2 -> endp2 (itself) or not existing EntityPath l_path; - l_path = l_itr->second->getAttr<ATTR_PHYS_PATH>(); + l_path = l_ptr2->getAttr<ATTR_PHYS_PATH>(); char *l_pathString = l_path.toString(); TARG_ERR( "First endpoint's PEER_TARGET is %s", l_pathString ); free (l_pathString); - if (l_jtr != l_PbusUniqueConnections.end()) + if (l_jtr != l_pPbusUniqueConnections->end()) { l_path = l_jtr->second->getAttr<ATTR_PHYS_PATH>(); l_pathString = l_path.toString(); @@ -238,7 +313,11 @@ errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType ) * @reasoncode RC_CONFLICT_PBUS_CONNECTION * @userdata1 Bus endpoint target pointer1 * @userdata2 Bus endpoint target pointer2 - * @devdesc Platform generated error. See User Data. + * @custdesc Platform generated error. See User Data. + * @devdesc Connection is conflicting. + * endp1 -> endp2 but endp2 -> endp3. + * endp1 -> endp2 but + * endp2 -> endp2 (itself) or not existing */ l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE, MOD_EDI_EI_IO_RUN_TRAINING, @@ -249,7 +328,7 @@ errlHndl_t PbusLinkSvc::collectPbusConections( TYPE i_busType ) } else { - l_PbusUniqueConnections.erase(l_jtr); + l_pPbusUniqueConnections->erase(l_jtr); } } diff --git a/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.H b/src/usr/isteps/pbusLinkSvc.H index 141c1007f..ede8e0488 100644 --- a/src/usr/hwpf/hwp/bus_training/pbusLinkSvc.H +++ b/src/usr/isteps/pbusLinkSvc.H @@ -1,11 +1,13 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/hwpf/hwp/bus_training/pbusLinkSvc.H $ */ +/* $Source: src/usr/isteps/pbusLinkSvc.H $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -42,14 +44,11 @@ #include <targeting/common/utilFilter.H> #include <targeting/common/trace.H> -// fapi support -#include <fapi.H> namespace EDI_EI_INITIALIZATION { using namespace TARGETING; -using namespace fapi; typedef std::map<const TARGETING::Target*, const TARGETING::Target*> TargetPairs_t; @@ -72,7 +71,7 @@ public: * it will perform the collection and save them into the vectors * within the singleton. Then, it will make a copy into the * caller's map whose reference is passed to this function. - * + * * @parm[out] o_PbusConnections, reference of a map for getting a copy * of the map of specified bus connections * @parm[in] i_busType, type of bus connection, TYPE_XBUS or TYPE_ABUS @@ -80,7 +79,7 @@ public: * only (endpoint1,endpoint2) or (endpoint2,endpoint1) will * be in the present in the map * @return errlHndl_t if encountering an error, or NULL (no error) - * + * */ errlHndl_t getPbusConnections( TargetPairs_t & o_PbusConnections, @@ -108,21 +107,24 @@ private: TargetPairs_t iv_abusConnections; TargetPairs_t iv_xbusUniqueConnections; TargetPairs_t iv_xbusConnections; + TargetPairs_t iv_obusUniqueConnections; + TargetPairs_t iv_obusConnections; // Mutex serializing changes to the above four maps mutex_t iv_mutex; /** - * @brief collectPbusConections() will collect all pbus connections of + * @brief collectPbusConnections() will collect all pbus connections of * the specified bus type. It checks for mixed-type connection, * conflicting connection, and invalid-same-chip connection. * The connections are saved within the singleton. - * - * @parm[in] i_busType, type of bus connection, TYPE_XBUS or TYPE_ABUS + * + * @parm[in] i_busType, type of bus connection, + * TYPE_XBUS, TYPE_OBUS or TYPE_ABUS * @return errlHndl_t if encountering an error, or NULL (no error) * */ - errlHndl_t collectPbusConections( TYPE i_busType ); + errlHndl_t collectPbusConnections( TYPE i_busType ); }; diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml index 572348d44..cd99be0e7 100755 --- a/src/usr/targeting/common/xmltohb/target_types.xml +++ b/src/usr/targeting/common/xmltohb/target_types.xml @@ -2509,6 +2509,7 @@ <attribute><id>SCRATCH_UINT8_1</id><default>5</default></attribute> <attribute><id>PARENT_PERVASIVE</id></attribute> <attribute><id>OPTICS_CONFIG_MODE</id></attribute> + <attribute><id>PEER_TARGET</id></attribute> </targetType> <targetType> |