diff options
author | crgeddes <crgeddes@us.ibm.com> | 2016-06-02 09:29:48 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-06-17 15:23:20 -0400 |
commit | 56a12883c428ecdd0aa3cdbd7507774127793395 (patch) | |
tree | 85f96c67b72479f682206f263750cb34c1e7a8f8 /src/usr/isteps/istep07 | |
parent | dfd4647908cb9e19015a3ae31c8742dbbfad5de6 (diff) | |
download | talos-hostboot-56a12883c428ecdd0aa3cdbd7507774127793395.tar.gz talos-hostboot-56a12883c428ecdd0aa3cdbd7507774127793395.zip |
step 7 HWP Enablement
Enable attr_update, eff_config, mss_freq, and mss_volt.
Also updated attribute xml
RTC:155024
Change-Id: I1a0f480bc34a038f6f13c135e6c2116c3f488861
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25302
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/isteps/istep07')
-rw-r--r-- | src/usr/isteps/istep07/call_mss_attr_update.C | 43 | ||||
-rw-r--r-- | src/usr/isteps/istep07/call_mss_eff_config.C | 264 | ||||
-rw-r--r-- | src/usr/isteps/istep07/call_mss_freq.C | 100 | ||||
-rw-r--r-- | src/usr/isteps/istep07/call_mss_volt.C | 204 | ||||
-rw-r--r-- | src/usr/isteps/istep07/makefile | 58 |
5 files changed, 340 insertions, 329 deletions
diff --git a/src/usr/isteps/istep07/call_mss_attr_update.C b/src/usr/isteps/istep07/call_mss_attr_update.C index 501e1a633..43b2cb64d 100644 --- a/src/usr/isteps/istep07/call_mss_attr_update.C +++ b/src/usr/isteps/istep07/call_mss_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. */ /* */ /* */ @@ -35,6 +35,7 @@ #include <trace/interface.H> #include <initservice/taskargs.H> #include <errl/errlentry.H> +#include <errl/errlmanager.H> #include <isteps/hwpisteperror.H> @@ -45,8 +46,15 @@ #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> +// fapi2 support +#include <fapi2.H> +#include <fapi2/target.H> +#include <fapi2/plat_hwp_invoker.H> -#include <config.h> +#include <config.h> + +// HWP +#include <p9_mss_attr_update.H> namespace ISTEP_07 { @@ -61,21 +69,36 @@ using namespace TARGETING; // void* call_mss_attr_update( void *io_pArgs ) { - IStepError l_StepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_attr_update entry"); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_attr_update entry"); errlHndl_t l_err = NULL; - //@TODO RTC:133830 add the procedure back in when ready - //FAPI_INVOKE_HWP(l_err, p9_mss_attr_update); - if(l_err) + // Get all functional MCS chiplets + TARGETING::TargetHandleList l_mcsTargetList; + getAllChiplets(l_mcsTargetList, TYPE_MCS); + + for (const auto & l_mcsTarget: l_mcsTargetList) { - l_StepError.addErrorDetails(l_err); - errlCommit( l_err, HWPF_COMP_ID ); + const fapi2::Target<fapi2::TARGET_TYPE_MCS> + l_fapi2_mcs_target(l_mcsTarget); + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "Running p9_mss_attr_update HWP on " + "MCS target HUID %.8X", TARGETING::get_huid(l_mcsTarget)); + FAPI_INVOKE_HWP(l_err, p9_mss_attr_update, l_fapi2_mcs_target); + if(l_err) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : p9_mss_attr_update HWP returned " + "error for HUID %.8x", + l_err->reasonCode(), TARGETING::get_huid(l_mcsTarget)); + l_StepError.addErrorDetails(l_err); + errlCommit( l_err, HWPF_COMP_ID ); + } } - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_attr_update exit" ); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_attr_update exit" ); return l_StepError.getErrorHandle(); } diff --git a/src/usr/isteps/istep07/call_mss_eff_config.C b/src/usr/isteps/istep07/call_mss_eff_config.C index 60a666f2e..56c3a896f 100644 --- a/src/usr/isteps/istep07/call_mss_eff_config.C +++ b/src/usr/isteps/istep07/call_mss_eff_config.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015 */ +/* Contributors Listed Below - COPYRIGHT 2015,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -24,7 +24,7 @@ /* IBM_PROLOG_END_TAG */ /** * @file call_mss_eff_config.C - * Contains all the wrappers for istep07 + * Contains the wrapper for mss_eff_config istep */ /******************************************************************************/ @@ -46,8 +46,15 @@ #include <targeting/common/utilFilter.H> #include <config.h> +#include <fapi2.H> +#include <fapi2/plat_hwp_invoker.H> #include <targeting/attrsync.H> +// HWP +#include <p9_mss_eff_config.H> +#include <p9_mss_eff_config_thermal.H> +#include <p9_mss_eff_grouping.H> + namespace ISTEP_07 { @@ -56,136 +63,59 @@ using namespace ISTEP_ERROR; using namespace ERRORLOG; using namespace TARGETING; -errlHndl_t call_mss_eff_grouping() +errlHndl_t call_mss_eff_grouping(IStepError & io_istepErr) { errlHndl_t l_err = NULL; -/* @TODO RTC:133830 Add the wrapper when ready + TARGETING::TargetHandleList l_procsList; getAllChips(l_procsList, TYPE_PROC); - for (TargetHandleList::const_iterator - l_proc_iter = l_procsList.begin(); - l_proc_iter != l_procsList.end(); - ++l_proc_iter) + for (const auto & l_cpu_target : l_procsList) { - // make a local copy of the target for ease of use - const TARGETING::Target* l_cpu_target = *l_proc_iter; - // print call to hwp and write HUID of the target(s) TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "===== mss_eff_grouping HWP cpu " - "target HUID %.8X", - TARGETING::get_huid(l_cpu_target)); + "p9_mss_eff_grouping HWP cpu target HUID %.8X", + TARGETING::get_huid(l_cpu_target)); // cast OUR type of target to a FAPI type of target. - const fapi::Target l_fapi_cpu_target(fapi::TARGET_TYPE_PROC_CHIP, - (const_cast<TARGETING::Target*>(l_cpu_target)) ); - - TARGETING::TargetHandleList l_membufsList; - getChildAffinityTargets(l_membufsList, l_cpu_target, - CLASS_CHIP, TYPE_MEMBUF); - std::vector<fapi::Target> l_associated_centaurs; - - for (TargetHandleList::const_iterator - l_membuf_iter = l_membufsList.begin(); - l_membuf_iter != l_membufsList.end(); - ++l_membuf_iter) - { - // make a local copy of the target for ease of use - const TARGETING::Target* l_pTarget = *l_membuf_iter; + const fapi2::Target <fapi2::TARGET_TYPE_PROC_CHIP> l_fapi_cpu_target + (l_cpu_target); - // cast OUR type of target to a FAPI type of target. - const fapi::Target l_fapi_centaur_target(fapi::TARGET_TYPE_MEMBUF_CHIP, - (const_cast<TARGETING::Target*>(l_pTarget)) ); - - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "target HUID %.8X", TARGETING::get_huid(l_pTarget)); - - l_associated_centaurs.push_back(l_fapi_centaur_target); - } - - //FAPI_INVOKE_HWP(l_err, p9_mss_eff_grouping, - //l_fapi_cpu_target, l_associated_centaurs); - //Remove when above HWP is working - FAPI_INVOKE_HWP(l_err,mss_eff_grouping, - l_fapi_cpu_target, l_associated_centaurs); + FAPI_INVOKE_HWP(l_err, p9_mss_eff_grouping, l_fapi_cpu_target); // process return code. if ( l_err ) { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X: mss_eff_grouping HWP", - l_err->reasonCode()); + "ERROR 0x%.8X: p9_mss_eff_grouping HWP on target %.8x", + l_err->reasonCode(), TARGETING::get_huid(l_cpu_target)); // capture the target data in the elog ErrlUserDetailsTarget(l_cpu_target).addToLog(l_err); - - break; // break out mba loop + io_istepErr.addErrorDetails(l_err); + errlCommit(l_err, HWPF_COMP_ID); } else { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : mss_eff_grouping HWP"); + "SUCCESS : p9_mss_eff_grouping HWP on target %.8x", + TARGETING::get_huid(l_cpu_target)); } - } // endfor -*/ - return l_err; -} + } // end processor list processing -errlHndl_t call_opt_memmap( bool i_initBase ) -{ - errlHndl_t l_err = NULL; -/* @TODO RTC:133830 Add the wrapper when ready - TARGETING::TargetHandleList l_procs; - getAllChips(l_procs, TYPE_PROC); - - std::vector<fapi::Target> l_fapi_procs; - - for ( TARGETING::TargetHandleList::const_iterator - l_iter = l_procs.begin(); - l_iter != l_procs.end(); - ++l_iter ) - { - // make a local copy of the target for ease of use - const TARGETING::Target* l_target = *l_iter; - - // cast OUR type of target to a FAPI type of target. - const fapi::Target l_fapi_target(fapi::TARGET_TYPE_PROC_CHIP, - (const_cast<TARGETING::Target*>(l_target)) ); - - l_fapi_procs.push_back(l_fapi_target); - } - - //FAPI_INVOKE_HWP(l_err, p9_opt_memmap, l_fapi_procs, i_initBase); - //Remove when above HWP is working - FAPI_INVOKE_HWP(l_err,opt_memmap, l_fapi_procs,i_initBase); - - if ( l_err ) - { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X: opt_memmap HWP", l_err->reasonCode()); - } - else - { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : opt_memmap HWP"); - } -*/ return l_err; } + errlHndl_t call_mss_eff_mb_interleave() { errlHndl_t l_err = NULL; -/* @TODO RTC:133830 Add the wrapper when ready +/* TOOD RTC: 144076 --- cumulus only --- TARGETING::TargetHandleList l_membufTargetList; getAllChips(l_membufTargetList, TYPE_MEMBUF); - for (TargetHandleList::const_iterator - l_membuf_iter = l_membufTargetList.begin(); - l_membuf_iter != l_membufTargetList.end(); - ++l_membuf_iter) + + for (const auto & l_membuf_target : l_membufTargetList) { - const TARGETING::Target* l_membuf_target = *l_membuf_iter; TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "===== Running mss_eff_mb_interleave HWP on HUID %.8X", TARGETING::get_huid(l_membuf_target)); @@ -197,6 +127,7 @@ errlHndl_t call_mss_eff_mb_interleave() TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "ERROR 0x%.8X: mss_eff_mb_interleave HWP returns error", l_err->reasonCode()); + ErrlUserDetailsTarget(l_membuf_target).addToLog(l_err); } else { @@ -216,13 +147,12 @@ errlHndl_t call_mss_eff_mb_interleave() void* call_mss_eff_config( void *io_pArgs ) { IStepError l_StepError; + errlHndl_t l_err = NULL; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_eff_config entry" ); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_eff_config entry" ); TARGETING::hdatAttrHack(); - //@TODO RTC:133830 Add the wrapper back in when ready -/* - errlHndl_t l_err = NULL; + TARGETING::Target* l_sys = NULL; targetService().getTopLevelTarget(l_sys); assert( l_sys != NULL ); @@ -244,100 +174,76 @@ void* call_mss_eff_config( void *io_pArgs ) // setAttr<TARGETING::ATTR_MEM_MIRROR_PLACEMENT_POLICY>(l_mmPolicy); //} - // Get all functional MBA chiplets - TARGETING::TargetHandleList l_mbaTargetList; - getAllChiplets(l_mbaTargetList, TYPE_MBA); + // Get all functional MCS chiplets + TARGETING::TargetHandleList l_mcsTargetList; + getAllChiplets(l_mcsTargetList, TYPE_MCS); - // Iterate over all MBAs, calling mss_eff_config and mss_eff_config_thermal - for (TargetHandleList::const_iterator l_mba_iter = l_mbaTargetList.begin(); - l_mba_iter != l_mbaTargetList.end(); ++l_mba_iter) + // Iterate over all MCS, calling mss_eff_config and mss_eff_config_thermal + for (const auto & l_mcs_target : l_mcsTargetList) { // Get the TARGETING::Target pointer and its HUID - const TARGETING::Target* l_mba_target = *l_mba_iter; - uint32_t l_huid = TARGETING::get_huid(l_mba_target); - - // Create a FAPI target representing the MBA - const fapi::Target l_fapi_mba_target(fapi::TARGET_TYPE_MBA_CHIPLET, - (const_cast<TARGETING::Target*>(l_mba_target))); + uint32_t l_huid = TARGETING::get_huid(l_mcs_target); - // Call the mss_eff_config_vpd_decode HWP - //FAPI_INVOKE_HWP(l_err,p9_mss_eff_config_vpd_decode, - //l_fapi_mba_target); + // Create a FAPI target representing the MCS + const fapi2::Target <fapi2::TARGET_TYPE_MCS> l_fapi_mcs_target + (l_mcs_target); // Call the mss_eff_config HWP TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "===== mss_eff_config HWP. MBA HUID %.8X", l_huid); - //FAPI_INVOKE_HWP(l_err, p9_mss_eff_config, l_fapi_mba_target); - //Remove when above HWP is working: - FAPI_INVOKE_HWP(l_err, mss_eff_config, l_fapi_mba_target); + "p9_mss_eff_config HWP. MCS HUID %.8X", l_huid); + FAPI_INVOKE_HWP(l_err, p9_mss_eff_config, l_fapi_mcs_target); if (l_err) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X: mss_eff_config HWP ", l_err->reasonCode()); + "ERROR 0x%.8X: p9_mss_eff_config HWP ", l_err->reasonCode()); // Ensure istep error created and has same plid as this error - ErrlUserDetailsTarget(l_mba_target).addToLog(l_err); + ErrlUserDetailsTarget(l_mcs_target).addToLog(l_err); l_StepError.addErrorDetails(l_err); errlCommit(l_err, HWPF_COMP_ID); + continue; } - else + + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : p9_mss_eff_config HWP"); + + // Call the mss_eff_config_thermal HWP + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "p9_mss_eff_config_thermal HWP. MCS HUID %.8X", l_huid); + FAPI_INVOKE_HWP(l_err, p9_mss_eff_config_thermal,l_fapi_mcs_target); + + if (l_err) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : mss_eff_config HWP"); + "ERROR 0x%.8X: p9_mss_eff_config_thermal HWP " + "ran on MCS target HUID %.8X", + l_err->reasonCode()); - // Call the mss_eff_config_thermal HWP - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "===== mss_eff_config_thermal HWP. MBA HUID %.8X", l_huid); - //FAPI_INVOKE_HWP(l_err, p9_mss_eff_config_thermal, - //l_fapi_mba_target); - - if (l_err) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X: mss_eff_config_thermal HWP ", l_err->reasonCode()); - - // Ensure istep error created and has same plid as this error - ErrlUserDetailsTarget(l_mba_target).addToLog(l_err); - l_StepError.addErrorDetails(l_err); - errlCommit(l_err, HWPF_COMP_ID); - } - else - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : mss_eff_config_thermal HWP"); - } + // Ensure istep error created and has same plid as this error + ErrlUserDetailsTarget(l_mcs_target).addToLog(l_err); + l_StepError.addErrorDetails(l_err); + errlCommit(l_err, HWPF_COMP_ID); } - } + else + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : p9_mss_eff_config_thermal HWP " + "ran on MCS target HUID %.8X", + l_huid); + } + } // end membuf loop if (l_StepError.isNull()) { - // Flush out BASE attributes to starting values - l_err = call_opt_memmap(true); + // Stack the memory on each chip + l_err = call_mss_eff_grouping(l_StepError); - if (!l_err) - { - // Stack the memory on each chip - l_err = call_mss_eff_grouping(); - - if (!l_err) - { - // Move the BASES around to the real final values - l_err = call_opt_memmap(false); - - if (!l_err) - { - // Stack the memory again based on system-wide positions - l_err = call_mss_eff_grouping(); - - //if(!l_err) //Cumulus only - //{ - // l_err = call_mss_eff_mb_interleave(); - //} - - } - } - } + // TODO RTC: 144076 + //if(!l_err) //Cumulus only + //{ + // l_err = call_mss_eff_mb_interleave(); + //} if (l_err) { @@ -347,19 +253,7 @@ void* call_mss_eff_config( void *io_pArgs ) } } - // Calling mss_eff_mb_interleave - if (l_StepError.isNull()) - { - l_err = call_mss_eff_mb_interleave(); - if(l_err) - { - l_StepError.addErrorDetails(l_err); - errlCommit( l_err, HWPF_COMP_ID ); - } - } - - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_eff_config exit" ); -*/ + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_eff_config exit" ); return l_StepError.getErrorHandle(); } }; // end namespace diff --git a/src/usr/isteps/istep07/call_mss_freq.C b/src/usr/isteps/istep07/call_mss_freq.C index 20df3f06b..365938535 100644 --- a/src/usr/isteps/istep07/call_mss_freq.C +++ b/src/usr/isteps/istep07/call_mss_freq.C @@ -24,7 +24,7 @@ /* IBM_PROLOG_END_TAG */ /** * @file call_mss_freq.C - * Contain the wrapper for istep 7.3 + * Contains the wrapper for istep 7.3 */ /******************************************************************************/ @@ -46,7 +46,13 @@ #include <targeting/common/utilFilter.H> #include <config.h> +#include <fapi2.H> +#include <fapi2/plat_hwp_invoker.H> +// HWP +#include <p9_mss_freq.H> +#include <p9_mss_freq_system.H> +// #include <p9_xip_customize.H> // RTC:138226 namespace ISTEP_07 { @@ -60,44 +66,32 @@ using namespace TARGETING; // void* call_mss_freq( void *io_pArgs ) { - IStepError l_StepError; + errlHndl_t l_err = NULL; TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_freq entry" ); -/* - //@TODO RTC: 133830 Add the wrapper back in when ready - errlHndl_t l_err = NULL; + TARGETING::TargetHandleList l_membufTargetList; - getAllChips(l_membufTargetList, TYPE_MEMBUF); + getAllChiplets(l_membufTargetList, TYPE_MCS); - for (TargetHandleList::const_iterator - l_membuf_iter = l_membufTargetList.begin(); - l_membuf_iter != l_membufTargetList.end(); - ++l_membuf_iter) + for (const auto & l_membuf_target : l_membufTargetList) { - // make a local copy of the target for ease of use - const TARGETING::Target* l_membuf_target = *l_membuf_iter; - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "===== mss_freq HWP " - "target HUID %.8X", + "p9_mss_freq HWP target HUID %.8x", TARGETING::get_huid(l_membuf_target)); // call the HWP with each target ( if parallel, spin off a task ) - // $$const fapi::Target l_fapi_membuf_target( - fapi::Target l_fapi_membuf_target(fapi::TARGET_TYPE_MEMBUF_CHIP, - (const_cast<TARGETING::Target*>(l_membuf_target)) ); + fapi2::Target <fapi2::TARGET_TYPE_MCS> l_fapi_membuf_target + (l_membuf_target); - //@TODO RTC:133830 FAPI_INVOKE_HWP(l_err, p9_mss_freq, l_fapi_membuf_target); - //Remove when above HWP is working: - FAPI_INVOKE_HWP(l_err, mss_freq, l_fapi_membuf_target); + FAPI_INVOKE_HWP(l_err, p9_mss_freq, l_fapi_membuf_target); // process return code. if ( l_err ) { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X: mss_freq HWP ", - l_err->reasonCode()); + "ERROR 0x%.8X: p9_mss_freq HWP on target HUID %.8x", + l_err->reasonCode(), TARGETING::get_huid(l_membuf_target) ); // capture the target data in the elog ErrlUserDetailsTarget(l_membuf_target).addToLog( l_err ); @@ -108,15 +102,69 @@ void* call_mss_freq( void *io_pArgs ) // Commit Error errlCommit( l_err, HWPF_COMP_ID ); - } + } else { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "SUCCESS : mss_freq HWP"); } } // End memBuf loop -*/ - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_freq exit" ); + + if(l_StepError.getErrorHandle() == NULL) + { + TARGETING::TargetHandleList l_mcbistTargetList; + getAllChiplets(l_mcbistTargetList, TYPE_MCBIST); + std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCBIST> > l_fapi2_mcbistTargetList; + + + for (const auto & l_mcbist_target : l_mcbistTargetList) + { + // call the HWP with each target ( if parallel, spin off a task ) + fapi2::Target <fapi2::TARGET_TYPE_MCBIST> l_fapi_mcbist_target(l_mcbist_target); + l_fapi2_mcbistTargetList.push_back(l_fapi_mcbist_target); + } + + + FAPI_INVOKE_HWP(l_err, p9_mss_freq_system, l_fapi2_mcbistTargetList); + + // process return code. + if ( l_err ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X: p9_mss_freq_system HWP while running on mcbist targets"); + + // Create IStep error log and cross reference to error that occurred + l_StepError.addErrorDetails( l_err ); + + // Commit Error + errlCommit( l_err, HWPF_COMP_ID ); + + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : mss_freq_system HWP"); + } + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "WARNING skipping p9_mss_freq_system HWP due to error detected in p9_mss_freq HWP. An error should have been committed."); + } + + + // TODO RTC:138226 + // 3c) FW examines current synchronous mode nest freq and will customize the + // SBE and reboot if necessary on the master only + // (slaves get data via mbox scratch registers) + /* FAPI_INVOKE_HWP(l_err, p9_xip_customize, + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_proc_target, + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM>& i_system_target, + void* io_image); + */ + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_freq exit" ); + return l_StepError.getErrorHandle(); } diff --git a/src/usr/isteps/istep07/call_mss_volt.C b/src/usr/isteps/istep07/call_mss_volt.C index 33671fec5..750be93e8 100644 --- a/src/usr/isteps/istep07/call_mss_volt.C +++ b/src/usr/isteps/istep07/call_mss_volt.C @@ -41,7 +41,7 @@ #include <errl/errludtarget.H> #include <initservice/isteps_trace.H> -#include <sbe/sbeif.H> + // targeting support #include <targeting/common/commontargeting.H> #include <targeting/common/utilFilter.H> @@ -51,85 +51,94 @@ #include <util/align.H> #include <util/algorithm.H> +//Fapi Support +#include <fapi2.H> +#include <target_types.H> +#include <plat_hwp_invoker.H> +#include <attributeenums.H> +#include <istepHelperFuncs.H> + +// HWP +#include <p9_mss_volt.H> + namespace ISTEP_07 { - using namespace ISTEP; using namespace ISTEP_ERROR; using namespace ERRORLOG; using namespace TARGETING; -// // helper function to call multiple mss_volt_hwps -// void call_mss_volt_hwp ( -// std::vector<TARGETING::ATTR_VMEM_ID_type>& i_VmemList, -// TARGETING::TargetHandleList& i_membufTargetList, -// IStepError& io_StepError, -// fapi2::ReturnCode(*mss_volt_hwp)( -// std::vector<fapi::Target>&)) -// { -// /* @TODO: RTC:133830 Add wrapper back when ready -// errlHndl_t l_err; -// //for each unique VmemId filter it out of the list of membuf targets -// //to create a subsetlist of membufs with just that vmemid -// std::vector<TARGETING::ATTR_VMEM_ID_type>::iterator l_vmem_iter; -// for (l_vmem_iter = i_VmemList.begin(); -// l_vmem_iter != i_VmemList.end(); -// ++l_vmem_iter) -// { -// // declare a vector of fapi targets to pass to mss_volt procedures -// std::vector<fapi::Target> l_membufFapiTargets; -// -// for (TargetHandleList::const_iterator -// l_membuf_iter = i_membufTargetList.begin(); -// l_membuf_iter != i_membufTargetList.end(); -// ++l_membuf_iter) -// { -// // make a local copy of the target for ease of use -// const TARGETING::Target* l_membuf_target = *l_membuf_iter; -// if (l_membuf_target->getAttr<ATTR_VMEM_ID>()==*l_vmem_iter) -// { -// TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, -// "===== add to fapi::Target vector vmem_id=0x%08X " -// "target HUID %.8X", -// l_membuf_target->getAttr<ATTR_VMEM_ID>(), -// TARGETING::get_huid(l_membuf_target)); -// -// fapi::Target l_membuf_fapi_target(fapi::TARGET_TYPE_MEMBUF_CHIP, -// (const_cast<TARGETING::Target*>(l_membuf_target)) ); -// -// l_membufFapiTargets.push_back( l_membuf_fapi_target ); -// } -// } -// -// //now have the a list of fapi membufs with just the one VmemId -// //call the HWP on the list of fapi targets -// TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, -// "===== mss_volt HWP( vector )" ); -// -// FAPI_INVOKE_HWP(l_err, mss_volt_hwp, l_membufFapiTargets); -// -// // process return code. -// if ( l_err ) -// { -// TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, -// "ERROR 0x%.8X: mss_volt HWP( ) ", -// l_err->reasonCode()); -// -// // Create IStep error log and cross reference to error that occurred -// io_StepError.addErrorDetails( l_err ); -// -// // Commit Error -// errlCommit( l_err, HWPF_COMP_ID ); -// -// } -// else -// { -// TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, -// "SUCCESS : mss_volt_dimm_count HWP( )" ); -// } -// } -// */ -// } + +// helper function to call mss_volt_hwp +void call_mss_volt_hwp (std::vector<TARGETING::ATTR_VMEM_ID_type>& i_VmemList, + TARGETING::TargetHandleList& i_mcsTargetList, + IStepError& io_StepError) +{ + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_mss_volt_hwp function entry" ); + errlHndl_t l_err; + + //for each unique VmemId filter it out of the list of mcs targets + //to create a subsetlist of MCSs with just that vmemid + for (auto & l_vmem : i_VmemList) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Create list of MCS targets for vmem:0x%08X",l_vmem ); + + // declare a vector of fapi targets to pass to mss_volt procedures + std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> > + l_mcsFapiTargets; + + for(auto & l_mcs_target : i_mcsTargetList) + { + // make a local copy of the target for ease of use + if (l_mcs_target->getAttr<ATTR_VMEM_ID>() == l_vmem) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "add to fapi2::Target vector vmem_id=0x%08X " + "target HUID %.8X", + l_mcs_target->getAttr<ATTR_VMEM_ID>(), + TARGETING::get_huid(l_mcs_target)); + + fapi2::Target <fapi2::TARGET_TYPE_MCS> + l_mcs_fapi_target (l_mcs_target); + + l_mcsFapiTargets.push_back( l_mcs_fapi_target ); + } + } + + //now have the a list of fapi MCSs with just the one VmemId + //call the HWP on the list of fapi targets + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Calling p9_mss_volt on list of mcs targets"); + + FAPI_INVOKE_HWP(l_err, p9_mss_volt, l_mcsFapiTargets); + + // process return code. + if ( l_err ) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X: p9_mss_volt HWP() failed", + l_err->reasonCode()); + + // Create IStep error log and cross reference + // to error that occurred + io_StepError.addErrorDetails( l_err ); + + // Commit Error + errlCommit( l_err, HWPF_COMP_ID ); + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : mss_volt HWP( )" ); + } + } + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_mss_volt_hwp function exit" ); +} + // // Wrapper function to call mss_volt @@ -139,60 +148,38 @@ void* call_mss_volt( void *io_pArgs ) IStepError l_StepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_volt entry" ); + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_volt entry" ); - //@TODO RTC:133830 Add the wrapper back in when ready -/* // Check that VPP, DDR3 VDDR, and DDR4 VDDR _EFF_CONFIG attributes are set - errlHndl_t l_err = NULL; + // Check that VPP, DDR3 VDDR, and DDR4 VDDR _EFF_CONFIG attributes are set bool unused = false; set_eff_config_attrs_helper(DEFAULT, unused); - TARGETING::TargetHandleList l_membufTargetList; - getAllChips(l_membufTargetList, TYPE_MEMBUF); + TARGETING::TargetHandleList l_mcsTargetList; + getAllChiplets(l_mcsTargetList, TYPE_MCS); //get a list of unique VmemIds std::vector<TARGETING::ATTR_VMEM_ID_type> l_VmemList; //fapi Return Code - fapi::ReturnCode l_fapirc; + fapi2::ReturnCode l_fapirc; - for (TargetHandleList::const_iterator - l_membuf_iter = l_membufTargetList.begin(); - l_membuf_iter != l_membufTargetList.end(); - ++l_membuf_iter) + for (auto & l_mcs : l_mcsTargetList) { TARGETING::ATTR_VMEM_ID_type l_VmemID = - (*l_membuf_iter)->getAttr<ATTR_VMEM_ID>(); + l_mcs->getAttr<ATTR_VMEM_ID>(); l_VmemList.push_back(l_VmemID); } -#ifdef CONFIG_ALLOW_NON_COMPLIANT_DIMM - // Set ATTR_MSS_VOLT_COMPLIANT_DIMMS to ALL - // Value of ALL value in attribute enum - uint8_t l_allowNonCompliantDimms = - ENUM_ATTR_MSS_VOLT_COMPLIANT_DIMMS_ALL_VOLTAGES; - - TARGETING::Target* l_sys = NULL; - targetService().getTopLevelTarget(l_sys); - l_sys->setAttr<TARGETING::ATTR_MSS_VOLT_COMPLIANT_DIMMS> - (l_allowNonCompliantDimms); - -#endif - - - std::sort(l_VmemList.begin(), l_VmemList.end()); - - std::vector<TARGETING::ATTR_VMEM_ID_type>::iterator objItr; - objItr=std::unique(l_VmemList.begin(), l_VmemList.end()); + auto objItr = std::unique(l_VmemList.begin(), l_VmemList.end()); l_VmemList.erase(objItr,l_VmemList.end()); //call mss_volt hwps - call_mss_volt_hwp (l_VmemList, l_membufTargetList,l_StepError, mss_volt); - call_mss_volt_hwp (l_VmemList, l_membufTargetList,l_StepError, - mss_volt_dimm_count); + call_mss_volt_hwp (l_VmemList, l_mcsTargetList, l_StepError); +/* TODO RTC: 152294 Enable VDDR Functions + errlHndl_t l_err = NULL; l_err = setMemoryVoltageDomainOffsetVoltage< TARGETING::ATTR_MSS_CENT_VDD_OFFSET_DISABLE, TARGETING::ATTR_MEM_VDD_OFFSET_MILLIVOLTS, @@ -257,8 +244,9 @@ void* call_mss_volt( void *io_pArgs ) l_StepError.addErrorDetails(l_err); errlCommit(l_err,HWPF_COMP_ID); } -*/ - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_volt exit" ); + */ + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_volt exit" ); return l_StepError.getErrorHandle(); } diff --git a/src/usr/isteps/istep07/makefile b/src/usr/isteps/istep07/makefile index 6ee76e3b0..228deb718 100644 --- a/src/usr/isteps/istep07/makefile +++ b/src/usr/isteps/istep07/makefile @@ -24,10 +24,68 @@ # IBM_PROLOG_END_TAG ROOTPATH = ../../../.. MODULE = istep07 +PROCEDURES_PATH = ${ROOTPATH}/src/import/chips/p9/procedures +HWP_PATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/memory +#Add all the object files required for istep07 module OBJS += call_mss_volt.o OBJS += call_mss_freq.o OBJS += call_mss_eff_config.o OBJS += call_mss_attr_update.o +# library objects needed +OBJS += spd_decoder.o +OBJS += fake_spd.o +OBJS += c_str.o +OBJS += memory_size.o +OBJS += attr_setters.o +OBJS += cas_latency.o +OBJS += eff_config.o +OBJS += timing.o +OBJS += rank.o +OBJS += sync.o + + +#Add all the extra include paths +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/ +EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/ +EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ +EXTRAINCDIR += ${ROOTPATH}/obj/genfiles/ +EXTRAINCDIR += ${ROOTPATH}/src/usr/isteps/ +EXTRAINCDIR += ${HWP_PATH} +EXTRAINCDIR += ${HWP_PATH}/lib/ +EXTRAINCDIR += ${HWP_PATH}/lib/dimm/ +EXTRAINCDIR += ${HWP_PATH}/lib/freq/ +EXTRAINCDIR += ${HWP_PATH}/lib/utils/ +EXTRAINCDIR += ${HWP_PATH}/lib/eff_config/ +EXTRAINCDIR += $(PROCEDURES_PATH)/hwp/nest + +VPATH += ${HWP_PATH} ${HWP_PATH}/lib/spd +VPATH += $(PROCEDURES_PATH)/hwp/nest ${ROOTPATH}/src/usr/fapi2 +VPATH += ${HWP_PATH}/lib ${HWP_PATH}/lib/utils ${HWP_PATH}/lib/eff_config +VPATH += ${HWP_PATH}/lib/freq ${HWP_PATH}/lib/dimm + +#Required include before all the procedure.mk are included +include ${ROOTPATH}/procedure.rules.mk + +#Include all the procedure makefiles + +#mss_volt : Calc dimm voltage +include $(HWP_PATH)/p9_mss_volt.mk + +#mss_freq : Calc dimm frequency +include $(HWP_PATH)/p9_mss_freq.mk +include $(HWP_PATH)/p9_mss_freq_system.mk + +#mss_eff_config : Determine effective config +include $(PROCEDURES_PATH)/hwp/nest/p9_mss_eff_grouping.mk +include $(HWP_PATH)/p9_mss_eff_config.mk +include $(HWP_PATH)/p9_mss_eff_config_thermal.mk + +#mss_attr_update : MSS ATTR Overrides +include $(HWP_PATH)/p9_mss_attr_update.mk + + include ${ROOTPATH}/config.mk |