Skip to content

Commit

Permalink
Added support, in Istep 08, to facilitate the testing of SMP wrap
Browse files Browse the repository at this point in the history
Adding support, in Istep 08 to make HWP calls for many various
components. In the various istep 8 call_proc_* and istep 10
call_proc*, I was able to consolidate the HWP call into a single
single function.  The consolidated code for these calls exists
in the file nest/nestHwpHelperFuncs.  Also added a function to
capture errors in file isteps/istepHelperFuncs.

Change-Id: I64f73d64950a52d2923f1c3fe280c55dffd1d742
RTC:190096
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56518
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
velozr authored and dcrowell77 committed May 7, 2018
1 parent 22b6130 commit c0217d0
Show file tree
Hide file tree
Showing 19 changed files with 956 additions and 543 deletions.
1 change: 1 addition & 0 deletions src/include/usr/isteps/istep08list.H
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ namespace INITSERVICE
const DepModInfo g_istep08Dependancies = {
{
DEP_LIB(libistep08.so),
DEP_LIB(libisteps_nest.so),
DEP_LIB(libsbe.so),
DEP_LIB(libimageprocs.so),
NULL
Expand Down
1 change: 1 addition & 0 deletions src/include/usr/isteps/istep10list.H
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ const TaskInfo g_istep10[] = {
const DepModInfo g_istep10Dependancies = {
{
DEP_LIB(libistep10.so),
DEP_LIB(libisteps_nest.so),
DEP_LIB(libsbe.so),
DEP_LIB(libnestmemutils.so),
DEP_LIB(libimageprocs.so),
Expand Down
1 change: 1 addition & 0 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ EXTENDED_MODULES += $(if $(CONFIG_SECUREBOOT),secureboot_ext)
EXTENDED_MODULES += tod
EXTENDED_MODULES += nestmemutils
EXTENDED_MODULES += fab_iovalid
EXTENDED_MODULES += isteps_nest

#***************************************
# Working test modules
Expand Down
74 changes: 37 additions & 37 deletions src/usr/isteps/istep08/call_host_p9_fbc_eff_config_links.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -22,53 +22,53 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
#include <stdint.h>
#include <trace/interface.H>
#include <errl/errlentry.H>
#include <errl/errlmanager.H>
#include <initservice/taskargs.H>
#include <initservice/isteps_trace.H>
#include <initservice/initserviceif.H>
#include <isteps/hwpisteperror.H>
#include <fapi2/plat_hwp_invoker.H>
#include <fapi2/target.H>
#include <p9_fbc_eff_config_links.H>

/******************************************************************************/
// Includes
/******************************************************************************/

// Component ID support
#include <hbotcompid.H> // HWPF_COMP_ID

// TARGETING support
#include <attributeenums.H> // TYPE_PROC

// Error handling support
#include <isteps/hwpisteperror.H> // ISTEP_ERROR::IStepError

// Tracing support
#include <trace/interface.H> // TRACFCOMP
#include <initservice/isteps_trace.H> // g_trac_isteps_trace

// HWP call support
#include <nest/nestHwpHelperFuncs.H> // fapiHWPCallWrapperForChip

namespace ISTEP_08
{
using namespace ISTEP;
using namespace ISTEP_ERROR;
using namespace ISTEPS_TRACE;
using namespace TARGETING;

//*****************************************************************************
// Wrapper function to call host_p9_fbc_eff_config_links
//*****************************************************************************
void* call_host_p9_fbc_eff_config_links( void *io_pArgs )
{
errlHndl_t l_errl = NULL;
ISTEP_ERROR::IStepError l_stepError;

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_p9_fbc_eff_config_links entry" );

TARGETING::TargetHandleList l_procChips;
getAllChips( l_procChips, TARGETING::TYPE_PROC);
for (const auto & l_procChip: l_procChips)
{
fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>l_fapi2CpuTarget(l_procChip);
FAPI_INVOKE_HWP(l_errl,p9_fbc_eff_config_links,l_fapi2CpuTarget,
SMP_ACTIVATE_PHASE1,
true,false);
if(l_errl)
{
l_stepError.addErrorDetails(l_errl);
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : call call_host_p9_fbc_eff_config_links, "
"PLID=0x%x",
l_errl->plid() );
errlCommit(l_errl, HWPF_COMP_ID);
}
}
TRACFCOMP(g_trac_isteps_trace,
ENTER_MRK"call_host_p9_fbc_eff_config_links entry" );

// Make the FAPI call to p9_fbc_eff_config_links
// process electrical = true and process optical = false
fapiHWPCallWrapperHandler(P9_FBC_EFF_CONFIG_LINKS_T_F, l_stepError,
HWPF_COMP_ID, TYPE_PROC);

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_p9_fbc_eff_config_links exit" );
TRACFCOMP(g_trac_isteps_trace,
EXIT_MRK"call_host_p9_fbc_eff_config_links exit" );

return l_stepError.getErrorHandle();
}

};
}; // end namespace ISTEP_08
129 changes: 76 additions & 53 deletions src/usr/isteps/istep08/call_host_set_voltages.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -26,45 +26,50 @@
/******************************************************************************/
// Includes
/******************************************************************************/
#include <stdint.h>
#include <trace/interface.H>
#include <errl/errlentry.H>
#include <initservice/isteps_trace.H>
#include <initservice/initserviceif.H>
#include <isteps/hwpisteperror.H>
// targeting support
#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
#include <errl/errlmanager.H>
#include <fapi2/target.H>
#include <fapi2/plat_hwp_invoker.H>

#include <p9_setup_evid.H>
// Component ID support
#include <hbotcompid.H> // HWPF_COMP_ID

// TARGETING support
#include <attributeenums.H> // TYPE_PROC

// Error handling support
#include <isteps/hwpisteperror.H> // ISTEP_ERROR::IStepError
#include <errl/errlentry.H> // errlHndl_t
#include <istepHelperFuncs.H> // captureError

#include <hbToHwsvVoltageMsg.H>
// Tracing support
#include <trace/interface.H> // TRACFCOMP
#include <initservice/isteps_trace.H> // g_trac_isteps_trace

// HWP call support
#include <p9_setup_evid.H>
#include <nest/nestHwpHelperFuncs.H> // fapiHWPCallWrapperForChip
#include <hbToHwsvVoltageMsg.H> // platform_set_nest_voltages

using namespace TARGETING;
using namespace ERRORLOG;
using namespace ISTEP_ERROR;
// Init Service support
#include <initservice/initserviceif.H> // INITSERVICE::spBaseServicesEnabled

namespace ISTEP_08
{
using namespace ISTEP;
using namespace ISTEP_ERROR;
using namespace ISTEPS_TRACE;
using namespace TARGETING;

//*****************************************************************************
// call_host_set_voltages()
// Wrapper function to call host_set_voltages
//*****************************************************************************
void* call_host_set_voltages(void *io_pArgs)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_set_voltages enter");
TRACFCOMP(g_trac_isteps_trace, ENTER_MRK"call_host_set_voltages enter");

errlHndl_t l_err = NULL;
TargetHandleList l_procList;
errlHndl_t l_err(nullptr);
IStepError l_stepError;
bool l_noError = true;

do
{
TargetHandleList l_procList;
// Get the system's procs
getAllChips( l_procList,
TYPE_PROC,
Expand All @@ -77,58 +82,76 @@ void* call_host_set_voltages(void *io_pArgs)
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>
l_fapiProcTarget( l_procTarget );

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Running p9_setup_evid HWP on processor target %.8X",
get_huid( l_procTarget ) );
TRACFCOMP(g_trac_isteps_trace,
"Running p9_setup_evid HWP on processor target %.8X",
get_huid( l_procTarget ) );

FAPI_INVOKE_HWP( l_err,
p9_setup_evid,
l_fapiProcTarget,
APPLY_VOLTAGE_SETTINGS);
FAPI_INVOKE_HWP(l_err,
p9_setup_evid,
l_fapiProcTarget,
APPLY_VOLTAGE_SETTINGS);

if( l_err )
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"Error running p9_setup_evid on processor target %.8X",
get_huid( l_procTarget ) );
l_stepError.addErrorDetails( l_err );

errlCommit( l_err, HWPF_COMP_ID );
l_noError = false;
// Capture error and continue
captureError(l_err,
l_stepError,
HWPF_COMP_ID,
l_procTarget);
}

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Done with p9_setup_evid" );
TRACFCOMP(g_trac_isteps_trace, "Done with p9_setup_evid" );
} // Processor Loop

if( l_noError )
// Exit if FAPI call failed or returned an error
if (!l_stepError.isNull())
{
//If FSP is present, send voltage information to HWSV
if( INITSERVICE::spBaseServicesEnabled() )
{
l_err = platform_set_nest_voltages();

if( l_err )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Error in call_host_set_voltages::platform_set_nest_voltages()")
break;
}

// Create IStep error log and cross reference occurred error
l_stepError.addErrorDetails( l_err );
// If no error occurred and FSP is present,
// send voltage information to HWSV
if (INITSERVICE::spBaseServicesEnabled())
{
l_err = platform_set_nest_voltages();

//Commit Error
errlCommit( l_err, ISTEP_COMP_ID );
if( l_err )
{
TRACFCOMP(g_trac_isteps_trace,
"Error in call_host_set_voltages::platform_set_nest_voltages()")

}
// Capture error and continue
captureError(l_err,
l_stepError,
ISTEP_COMP_ID);
}
}

// Exit if setting voltage failed or returned an error
if (!l_stepError.isNull())
{
break;
}

#ifdef CONFIG_SMP_WRAP_TEST
// Make the FAPI call to p9_fbc_eff_config_links
// Make the FAPI call to p9_sys_chiplet_scominit, if previous call succeeded
fapiHWPCallWrapperHandler(P9_FBC_EFF_CONFIG_LINKS_F_T, l_stepError,
HWPF_COMP_ID, TYPE_PROC) &&
fapiHWPCallWrapperHandler(P9_SYS_CHIPLET_SCOMINIT, l_stepError,
HWPF_COMP_ID, TYPE_PROC);
#endif
}while( 0 );


TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_set_voltages exit");
TRACFCOMP(g_trac_isteps_trace, EXIT_MRK"call_host_set_voltages exit");

// end task, returning any errorlogs to IStepDisp
return l_stepError.getErrorHandle();
}

}; // end namespace
}; // end namespace ISTEP_08

0 comments on commit c0217d0

Please sign in to comment.