summaryrefslogtreecommitdiffstats
path: root/src/usr/isteps/istep07
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2015-10-14 13:23:26 -0500
committerPatrick Williams <iawillia@us.ibm.com>2015-12-11 15:30:26 -0600
commita4ccd3d722669446c136632b6b501c0748ca3be3 (patch)
tree8721885a550276781b44cf52f896d468995293bd /src/usr/isteps/istep07
parent3187da27c464de6422ecb1bc12a085fc5b31f610 (diff)
downloadtalos-hostboot-a4ccd3d722669446c136632b6b501c0748ca3be3.tar.gz
talos-hostboot-a4ccd3d722669446c136632b6b501c0748ca3be3.zip
P9 Isteps: Created directory structure for istep 6/7 wrappers
Change-Id: I8ac216444270b1ea5a2fd550f4e1ea8861de7c4d RTC:137652 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/21458 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/isteps/istep07')
-rw-r--r--src/usr/isteps/istep07/call_mss_attr_update.C83
-rw-r--r--src/usr/isteps/istep07/call_mss_eff_config.C363
-rw-r--r--src/usr/isteps/istep07/call_mss_freq.C125
-rw-r--r--src/usr/isteps/istep07/call_mss_volt.C265
-rw-r--r--src/usr/isteps/istep07/host_collect_dimm_spd.C155
-rw-r--r--src/usr/isteps/istep07/makefile34
6 files changed, 1025 insertions, 0 deletions
diff --git a/src/usr/isteps/istep07/call_mss_attr_update.C b/src/usr/isteps/istep07/call_mss_attr_update.C
new file mode 100644
index 000000000..501e1a633
--- /dev/null
+++ b/src/usr/isteps/istep07/call_mss_attr_update.C
@@ -0,0 +1,83 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/isteps/istep07/call_mss_attr_update.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file call_mss_attr_update.C
+ * Contains the wrapper for istep 7.5
+ */
+
+/******************************************************************************/
+// Includes
+/******************************************************************************/
+#include <stdint.h>
+
+#include <trace/interface.H>
+#include <initservice/taskargs.H>
+#include <errl/errlentry.H>
+
+#include <isteps/hwpisteperror.H>
+
+#include <errl/errludtarget.H>
+#include <initservice/isteps_trace.H>
+
+// targeting support
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/utilFilter.H>
+
+
+#include <config.h>
+
+namespace ISTEP_07
+{
+
+using namespace ISTEP;
+using namespace ISTEP_ERROR;
+using namespace ERRORLOG;
+using namespace TARGETING;
+
+//
+// Wrapper function to call mss_attr_update
+//
+void* call_mss_attr_update( void *io_pArgs )
+{
+
+ IStepError l_StepError;
+
+ TRACDCOMP( 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)
+ {
+ l_StepError.addErrorDetails(l_err);
+ errlCommit( l_err, HWPF_COMP_ID );
+ }
+
+ TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_attr_update exit" );
+
+ return l_StepError.getErrorHandle();
+}
+
+}; // end namespace
diff --git a/src/usr/isteps/istep07/call_mss_eff_config.C b/src/usr/isteps/istep07/call_mss_eff_config.C
new file mode 100644
index 000000000..07d49ad1f
--- /dev/null
+++ b/src/usr/isteps/istep07/call_mss_eff_config.C
@@ -0,0 +1,363 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/isteps/istep07/call_mss_eff_config.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file call_mss_eff_config.C
+ * Contains all the wrappers for istep07
+ */
+
+/******************************************************************************/
+// Includes
+/******************************************************************************/
+#include <stdint.h>
+
+#include <trace/interface.H>
+#include <initservice/taskargs.H>
+#include <errl/errlentry.H>
+
+#include <isteps/hwpisteperror.H>
+#include <errl/errludtarget.H>
+
+#include <initservice/isteps_trace.H>
+
+// targeting support
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/utilFilter.H>
+
+#include <config.h>
+
+namespace ISTEP_07
+{
+
+using namespace ISTEP;
+using namespace ISTEP_ERROR;
+using namespace ERRORLOG;
+using namespace TARGETING;
+
+errlHndl_t call_mss_eff_grouping()
+{
+ 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)
+ {
+ // 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));
+
+ // 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;
+
+ // 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);
+
+ // process return code.
+ if ( l_err )
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%.8X: mss_eff_grouping HWP",
+ l_err->reasonCode());
+
+ // capture the target data in the elog
+ ErrlUserDetailsTarget(l_cpu_target).addToLog(l_err);
+
+ break; // break out mba loop
+ }
+ else
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "SUCCESS : mss_eff_grouping HWP");
+ }
+ } // endfor
+*/
+ return l_err;
+}
+
+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
+ 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)
+ {
+ 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));
+ fapi::Target l_membuf_fapi_target(fapi::TARGET_TYPE_MEMBUF_CHIP,
+ (const_cast<TARGETING::Target*>(l_membuf_target)) );
+ FAPI_INVOKE_HWP(l_err, mss_eff_mb_interleave, l_membuf_fapi_target);
+ if (l_err)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%.8X: mss_eff_mb_interleave HWP returns error",
+ l_err->reasonCode());
+ }
+ else
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Successfully ran mss_eff_mb_interleave HWP on HUID %.8X",
+ TARGETING::get_huid(l_membuf_target));
+ }
+ }
+*/
+ return l_err;
+}
+
+
+//
+// Wrapper function to call mss_eff_config
+//
+void* call_mss_eff_config( void *io_pArgs )
+{
+ IStepError l_StepError;
+
+ TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_eff_config entry" );
+
+ //@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 );
+
+ // The attribute ATTR_MEM_MIRROR_PLACEMENT_POLICY should already be
+ // correctly set by default for all platforms except for sapphire.
+ // Don't allow mirroring on sapphire yet @todo-RTC:108314
+ //
+ //ATTR_PAYLOAD_IN_MIRROR_MEM_type l_mirrored =
+ // l_sys->getAttr<ATTR_PAYLOAD_IN_MIRROR_MEM>();
+ //
+ //if(l_mirrored && is_sapphire_load())
+ //{
+ // TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Mirroring is enabled");
+
+ // uint8_t l_mmPolicy =
+ // fapi::ENUM_ATTR_MEM_MIRROR_PLACEMENT_POLICY_FLIPPED;
+ // l_sys->
+ // setAttr<TARGETING::ATTR_MEM_MIRROR_PLACEMENT_POLICY>(l_mmPolicy);
+ //}
+
+ // Get all functional MBA chiplets
+ TARGETING::TargetHandleList l_mbaTargetList;
+ getAllChiplets(l_mbaTargetList, TYPE_MBA);
+
+ // 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)
+ {
+ // 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)));
+
+ // Call the mss_eff_config_vpd_decode HWP
+ //FAPI_INVOKE_HWP(l_err,p9_mss_eff_config_vpd_decode,
+ //l_fapi_mba_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);
+
+ if (l_err)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%.8X: 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);
+ l_StepError.addErrorDetails(l_err);
+ errlCommit(l_err, HWPF_COMP_ID);
+ }
+ else
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "SUCCESS : mss_eff_config HWP");
+
+ // 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");
+ }
+ }
+ }
+
+ if (l_StepError.isNull())
+ {
+ // Flush out BASE attributes to starting values
+ l_err = call_opt_memmap(true);
+
+ 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();
+ //}
+
+ }
+ }
+ }
+
+ if (l_err)
+ {
+ // Ensure istep error created and has same plid as this error
+ l_StepError.addErrorDetails( l_err );
+ errlCommit( l_err, HWPF_COMP_ID );
+ }
+ }
+
+ // 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" );
+*/
+ 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
new file mode 100644
index 000000000..2ba73a9f7
--- /dev/null
+++ b/src/usr/isteps/istep07/call_mss_freq.C
@@ -0,0 +1,125 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/isteps/istep07/call_mss_freq.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file call_mss_freq.C
+ * Contain the wrapper for istep 7.3
+ */
+
+/******************************************************************************/
+// Includes
+/******************************************************************************/
+#include <stdint.h>
+
+#include <trace/interface.H>
+#include <initservice/taskargs.H>
+#include <errl/errlentry.H>
+
+#include <isteps/hwpisteperror.H>
+#include <errl/errludtarget.H>
+
+#include <initservice/isteps_trace.H>
+
+// targeting support
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/utilFilter.H>
+
+#include <config.h>
+
+namespace ISTEP_07
+{
+
+using namespace ISTEP;
+using namespace ISTEP_ERROR;
+using namespace ERRORLOG;
+using namespace TARGETING;
+using namespace fapi;
+
+//
+// Wrapper function to call mss_freq
+//
+void* call_mss_freq( void *io_pArgs )
+{
+
+ IStepError l_StepError;
+
+ 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);
+
+ for (TargetHandleList::const_iterator
+ l_membuf_iter = l_membufTargetList.begin();
+ l_membuf_iter != l_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;
+
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "===== 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)) );
+
+ //@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);
+
+ // process return code.
+ if ( l_err )
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%.8X: mss_freq HWP ",
+ l_err->reasonCode());
+
+ // capture the target data in the elog
+ ErrlUserDetailsTarget(l_membuf_target).addToLog( l_err );
+
+ // 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 HWP");
+ }
+ } // End memBuf loop
+*/
+ TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_freq exit" );
+
+ return l_StepError.getErrorHandle();
+}
+
+}; // end namespace
diff --git a/src/usr/isteps/istep07/call_mss_volt.C b/src/usr/isteps/istep07/call_mss_volt.C
new file mode 100644
index 000000000..c6ef47aa8
--- /dev/null
+++ b/src/usr/isteps/istep07/call_mss_volt.C
@@ -0,0 +1,265 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/isteps/istep07/call_mss_volt.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file call_mss_volt.C
+ * Contains the wrapper for istep 7.2
+ */
+
+/******************************************************************************/
+// Includes
+/******************************************************************************/
+#include <stdint.h>
+
+#include <trace/interface.H>
+#include <initservice/taskargs.H>
+#include <initservice/initserviceif.H>
+#include <errl/errlentry.H>
+
+#include <isteps/hwpisteperror.H>
+#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>
+#include <attributetraits.H>
+
+#include <config.h>
+#include <util/align.H>
+#include <util/algorithm.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,
+ fapi::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( )" );
+ }
+ }
+ */
+}
+
+//
+// Wrapper function to call mss_volt
+//
+void* call_mss_volt( void *io_pArgs )
+{
+
+ IStepError l_StepError;
+
+ TRACDCOMP( 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;
+ bool unused = false;
+ set_eff_config_attrs_helper(DEFAULT, unused);
+
+ TARGETING::TargetHandleList l_membufTargetList;
+ getAllChips(l_membufTargetList, TYPE_MEMBUF);
+
+ //get a list of unique VmemIds
+ std::vector<TARGETING::ATTR_VMEM_ID_type> l_VmemList;
+
+ //fapi Return Code
+ fapi::ReturnCode l_fapirc;
+
+ for (TargetHandleList::const_iterator
+ l_membuf_iter = l_membufTargetList.begin();
+ l_membuf_iter != l_membufTargetList.end();
+ ++l_membuf_iter)
+ {
+ TARGETING::ATTR_VMEM_ID_type l_VmemID =
+ (*l_membuf_iter)->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());
+ 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);
+
+ l_err = setMemoryVoltageDomainOffsetVoltage<
+ TARGETING::ATTR_MSS_CENT_VDD_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_VDD_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_VDD_ID>();
+ if(l_err)
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%08X: setMemoryVoltageDomainOffsetVoltage for VDD domain",
+ l_err->reasonCode());
+ l_StepError.addErrorDetails(l_err);
+ errlCommit(l_err,HWPF_COMP_ID);
+ }
+
+ l_err = setMemoryVoltageDomainOffsetVoltage<
+ TARGETING::ATTR_MSS_CENT_AVDD_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_AVDD_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_AVDD_ID>();
+ if(l_err)
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%08X: setMemoryVoltageDomainOffsetVoltage for AVDD domain",
+ l_err->reasonCode());
+ l_StepError.addErrorDetails(l_err);
+ errlCommit(l_err,HWPF_COMP_ID);
+ }
+
+ l_err = setMemoryVoltageDomainOffsetVoltage<
+ TARGETING::ATTR_MSS_CENT_VCS_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_VCS_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_VCS_ID>();
+ if(l_err)
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%08X: setMemoryVoltageDomainOffsetVoltage for VCS domain",
+ l_err->reasonCode());
+ l_StepError.addErrorDetails(l_err);
+ errlCommit(l_err,HWPF_COMP_ID);
+ }
+
+ l_err = setMemoryVoltageDomainOffsetVoltage<
+ TARGETING::ATTR_MSS_VOLT_VPP_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_VPP_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_VPP_ID>();
+ if(l_err)
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%08X: setMemoryVoltageDomainOffsetVoltage for VPP domain",
+ l_err->reasonCode());
+ l_StepError.addErrorDetails(l_err);
+ errlCommit(l_err,HWPF_COMP_ID);
+ }
+
+ l_err = setMemoryVoltageDomainOffsetVoltage<
+ TARGETING::ATTR_MSS_VOLT_VDDR_OFFSET_DISABLE,
+ TARGETING::ATTR_MEM_VDDR_OFFSET_MILLIVOLTS,
+ TARGETING::ATTR_VMEM_ID>();
+ if(l_err)
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%08X: setMemoryVoltageDomainOffsetVoltage for VDDR domain",
+ l_err->reasonCode());
+ l_StepError.addErrorDetails(l_err);
+ errlCommit(l_err,HWPF_COMP_ID);
+ }
+*/
+ TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_volt exit" );
+
+ return l_StepError.getErrorHandle();
+}
+
+
+};
diff --git a/src/usr/isteps/istep07/host_collect_dimm_spd.C b/src/usr/isteps/istep07/host_collect_dimm_spd.C
new file mode 100644
index 000000000..ae15e8a54
--- /dev/null
+++ b/src/usr/isteps/istep07/host_collect_dimm_spd.C
@@ -0,0 +1,155 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/isteps/istep07/host_collect_dimm_spd.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2015 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file host_collect_dimm_spd.C
+ * Contains the wrapper for istep 7.1
+ */
+
+/******************************************************************************/
+// Includes
+/******************************************************************************/
+#include <stdint.h>
+
+#include <isteps/hwpisteperror.H>
+#include <trace/interface.H>
+#include <initservice/taskargs.H>
+#include <initservice/isteps_trace.H>
+
+#include <errl/errlentry.H>
+#include <errl/errludtarget.H>
+
+// targeting support
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/utilFilter.H>
+#include <config.h>
+
+namespace ISTEP_07
+{
+
+using namespace ISTEP;
+using namespace ISTEP_ERROR;
+using namespace ERRORLOG;
+using namespace TARGETING;
+
+//
+// Wrapper function to call host_collect_dimm_spd
+//
+void* call_host_collect_dimm_spd( void *io_pArgs )
+{
+ errlHndl_t l_err = NULL;
+ IStepError l_stepError;
+ TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "call_host_collect_dimm_spd entry" );
+
+ // Get a list of all present Centaurs
+ TargetHandleList l_presCentaurs;
+ getChipResources(l_presCentaurs, TYPE_MEMBUF, UTIL_FILTER_PRESENT);
+ // Associated MBA targets
+ TARGETING::TargetHandleList l_mbaList;
+
+ // Define predicate for associated MBAs
+ PredicateCTM predMba(CLASS_UNIT, TYPE_MBA);
+ PredicatePostfixExpr presMba;
+ PredicateHwas predPres;
+ predPres.present(true);
+ presMba.push(&predMba).push(&predPres).And();
+
+ for (TargetHandleList::const_iterator
+ l_cenIter = l_presCentaurs.begin();
+ l_cenIter != l_presCentaurs.end();
+ ++l_cenIter)
+ {
+ // make a local copy of the target for ease of use
+ TARGETING::Target * l_pCentaur = *l_cenIter;
+ // Retrieve HUID of current Centaur
+ TARGETING::ATTR_HUID_type l_currCentaurHuid =
+ TARGETING::get_huid(l_pCentaur);
+
+ // Dump current run on target
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Running mss_attr_cleanup HWP on "
+ "target HUID %.8X", l_currCentaurHuid);
+
+ // find all present MBAs associated with this Centaur
+ TARGETING::TargetHandleList l_presMbas;
+ targetService().getAssociated(l_presMbas,
+ l_pCentaur,
+ TargetService::CHILD,
+ TargetService::IMMEDIATE,
+ &presMba);
+
+ // If not at least two MBAs found
+ if (l_presMbas.size() < 2)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Not enough MBAs found for Centaur target HUID %.8X, "
+ "skipping this Centaur.",
+ l_currCentaurHuid);
+ continue;
+ }
+
+ // Create FAPI Targets.
+ /* @TODO: RTC:133830 use fapi2 targets
+ const fapi::Target l_fapiCentaurTarget(TARGET_TYPE_MEMBUF_CHIP,
+ (const_cast<TARGETING::Target*>(l_pCentaur)));
+ const fapi::Target l_fapiMba0Target(TARGET_TYPE_MBA_CHIPLET,
+ (const_cast<TARGETING::Target*>(l_presMbas[0])));
+ const fapi::Target l_fapiMba1Target(TARGET_TYPE_MBA_CHIPLET,
+ (const_cast<TARGETING::Target*>(l_presMbas[1])));
+ */
+ //@TODO RTC:133830 call the HWP with each fapi::Target
+ //FAPI_INVOKE_HWP(l_err, p9_mss_attr_cleanup, l_fapiCentaurTarget,
+ // l_fapiMba0Target, l_fapiMba1Target);
+ if (l_err)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR 0x%.8X: mss_attr_cleanup HWP returns error",
+ l_err->reasonCode());
+ // capture the target data in the elog
+ ErrlUserDetailsTarget(l_pCentaur).addToLog(l_err);
+ // Create IStep error log and cross reference error that occurred
+ l_stepError.addErrorDetails(l_err);
+ // Commit Error
+ errlCommit(l_err, HWPF_COMP_ID);
+ }
+ else
+ {
+ // Success
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Successfully ran mss_attr_cleanup HWP on "
+ "CENTAUR target HUID %.8X "
+ "and associated MBAs",
+ l_currCentaurHuid);
+ }
+ }
+
+
+ TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "call_host_collect_dimm_spd exit" );
+
+ // end task, returning any errorlogs to IStepDisp
+ return l_stepError.getErrorHandle();
+}
+};
diff --git a/src/usr/isteps/istep07/makefile b/src/usr/isteps/istep07/makefile
new file mode 100644
index 000000000..857381d3f
--- /dev/null
+++ b/src/usr/isteps/istep07/makefile
@@ -0,0 +1,34 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/isteps/istep07/makefile $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2015
+# [+] 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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# IBM_PROLOG_END_TAG
+ROOTPATH = ../../../..
+MODULE = istep07
+
+OBJS += host_collect_dimm_spd.o
+OBJS += call_mss_volt.o
+OBJS += call_mss_freq.o
+OBJS += call_mss_eff_config.o
+OBJS += call_mss_attr_update.o
+
+include ${ROOTPATH}/config.mk
OpenPOWER on IntegriCloud