summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Veloz <rveloz@us.ibm.com>2018-04-06 13:36:07 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-05-07 11:51:01 -0400
commit1af47d2a9aef6d4cb5144cc4c219e58f15eedce3 (patch)
tree64342ba481878d14cfb4513b16d7ee7b274cef40
parent79c2cf9d40f13300cf39bfa3f661d7472bb29bbc (diff)
downloadtalos-hostboot-1af47d2a9aef6d4cb5144cc4c219e58f15eedce3.tar.gz
talos-hostboot-1af47d2a9aef6d4cb5144cc4c219e58f15eedce3.zip
Continuing support, in IStep 09, to facilitate the testing of SMP wrap
Continuing the support, in IStep 09 to make the call to p9_io_obus_linktrain and p9_io_obus_post_trainadv. Change-Id: I3d070bfc6c55224b77b6342362d5d008d0f0a61b RTC:190096 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56886 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Disable-CI: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/include/usr/isteps/istep12list.H29
-rw-r--r--src/makefile1
-rw-r--r--src/usr/isteps/io/makefile50
-rw-r--r--src/usr/isteps/istep09/call_fabric_io_run_training.C253
-rw-r--r--src/usr/isteps/istep09/call_fabric_post_trainadv.C189
-rw-r--r--src/usr/isteps/istep09/call_proc_fab_iovalid.C4
-rw-r--r--src/usr/isteps/makefile1
7 files changed, 258 insertions, 269 deletions
diff --git a/src/include/usr/isteps/istep12list.H b/src/include/usr/isteps/istep12list.H
index 5dffa7a56..6fa13acee 100644
--- a/src/include/usr/isteps/istep12list.H
+++ b/src/include/usr/isteps/istep12list.H
@@ -55,7 +55,7 @@
* 12.11 host_startprd_dmi
* : Load prd for DMI domain
* 12.12 host_attnlisten_memb
- * : Start attention poll for membuf
+ * : Start attention poll for membuf
* 12.13 cen_set_inband_addr
* : Set the Inband base addresses
*
@@ -79,7 +79,7 @@ namespace ISTEP_12
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_mss_getecid( void *io_pArgs );
@@ -89,7 +89,7 @@ void* call_mss_getecid( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_dmi_attr_update( void *io_pArgs );
@@ -99,7 +99,7 @@ void* call_dmi_attr_update( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_proc_dmi_scominit( void *io_pArgs );
@@ -109,7 +109,7 @@ void* call_proc_dmi_scominit( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_cen_dmi_scominit( void *io_pArgs );
@@ -119,7 +119,7 @@ void* call_cen_dmi_scominit( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_dmi_erepair( void *io_pArgs );
@@ -129,7 +129,7 @@ void* call_dmi_erepair( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_dmi_io_dccal( void *io_pArgs );
@@ -139,7 +139,7 @@ void* call_dmi_io_dccal( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_dmi_pre_trainadv( void *io_pArgs );
@@ -149,7 +149,7 @@ void* call_dmi_pre_trainadv( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_dmi_io_run_training( void *io_pArgs );
@@ -159,7 +159,7 @@ void* call_dmi_io_run_training( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_dmi_post_trainadv( void *io_pArgs );
@@ -169,7 +169,7 @@ void* call_dmi_post_trainadv( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_proc_cen_framelock( void *io_pArgs );
@@ -179,7 +179,7 @@ void* call_proc_cen_framelock( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_host_startprd_dmi( void *io_pArgs );
@@ -189,7 +189,7 @@ void* call_host_startprd_dmi( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_host_attnlisten_memb( void *io_pArgs );
@@ -199,7 +199,7 @@ void* call_host_attnlisten_memb( void *io_pArgs );
*
* param[in,out] - pointer to any arguments, usually NULL
*
- * return any errlogs to istep
+ * return any errlogs to istep
*
*/
void* call_cen_set_inband_addr( void *io_pArgs );
@@ -288,6 +288,7 @@ const DepModInfo g_istep12Dependancies = {
{
DEP_LIB(libistep12.so),
DEP_LIB(libnestmemutils.so),
+ DEP_LIB(libisteps_io.so),
NULL
}
};
diff --git a/src/makefile b/src/makefile
index 5d5936625..e25729575 100644
--- a/src/makefile
+++ b/src/makefile
@@ -207,6 +207,7 @@ EXTENDED_MODULES += tod
EXTENDED_MODULES += nestmemutils
EXTENDED_MODULES += fab_iovalid
EXTENDED_MODULES += isteps_nest
+EXTENDED_MODULES += isteps_io
#***************************************
# Working test modules
diff --git a/src/usr/isteps/io/makefile b/src/usr/isteps/io/makefile
new file mode 100644
index 000000000..6a8ea56a5
--- /dev/null
+++ b/src/usr/isteps/io/makefile
@@ -0,0 +1,50 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/isteps/io/makefile $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2016,2018
+# [+] 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 = ../../../..
+
+## ./import/chips/p9/procedures/hwp/io/p9_io_common.H
+
+PROCEDURES_PATH = ${ROOTPATH}/src/import/chips/p9/procedures
+
+#Add all the extra include paths
+EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/
+
+COMMON_LIB += ${PROCEDURES_PATH}/hwp/io
+
+EXTRAINCDIR += ${COMMON_LIB}
+
+# Add common and generated parts to object list.
+MODULE = isteps_io
+OBJS += p9_io_common.o
+$(call BUILD_MODULE)
+
+#HWP build tool
+include ${ROOTPATH}/procedure.rules.mk
+include ${ROOTPATH}/config.mk
+
+## Needed?
+VPATH += ${COMMON_LIB}
diff --git a/src/usr/isteps/istep09/call_fabric_io_run_training.C b/src/usr/isteps/istep09/call_fabric_io_run_training.C
index 4746a63ff..f234ec488 100644
--- a/src/usr/isteps/istep09/call_fabric_io_run_training.C
+++ b/src/usr/isteps/istep09/call_fabric_io_run_training.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -22,6 +22,7 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
/**
* @file call_fabric_io_run_training.C
*
@@ -35,161 +36,154 @@
/******************************************************************************/
// Includes
/******************************************************************************/
-#include <stdint.h>
-#include <map>
-
-#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>
-#include <hwas/common/deconfigGard.H>
-#include <hwas/common/hwasCommon.H>
+// Integral and component ID support
+#include <stdint.h> // uint32_t
+#include <hbotcompid.H> // HWPF_COMP_ID
-#include <sbe/sbeif.H>
+// Tracing support
+#include <trace/interface.H> // TRACFCOMP
+#include <initservice/isteps_trace.H> // g_trac_isteps_trace
-// targeting support
-#include <targeting/common/attributes.H>
-#include <targeting/common/targetservice.H>
+// Targeting support
+#include <fapi2_target.H> // fapi2::Target
+#include <target.H> // TARGETING::Target
-#include <targeting/common/commontargeting.H>
-#include <targeting/common/utilFilter.H>
-#include <targeting/common/trace.H>
+// Error handling support
+#include <errl/errlentry.H> // errlHndl_t
+#include <isteps/hwpisteperror.H> // IStepError
-#include <pbusLinkSvc.H>
-#include <fapi2/target.H>
-#include <fapi2/plat_hwp_invoker.H>
+// Pbus link service support
+#include <pbusLinkSvc.H> // TargetPairs_t, PbusLinkSvc
-// HWP
-#include <p9_io_xbus_linktrain.H>
+// HWP call support
+#include <istepHelperFuncs.H> // captureError
+#include <istep09/istep09HelperFuncs.H> // trainBusHandler
+#include <p9_io_xbus_linktrain.H> // p9_io_xbus_linktrain
namespace ISTEP_09
{
-
-using namespace ISTEP;
using namespace ISTEP_ERROR;
-using namespace ERRORLOG;
+using namespace ISTEPS_TRACE;
using namespace TARGETING;
-using namespace HWAS;
// helper function prototypes
uint8_t run_linktraining(
const fapi2::Target<fapi2::TARGET_TYPE_XBUS> &i_master_target,
const fapi2::Target<fapi2::TARGET_TYPE_XBUS> &i_slave_target,
ISTEP_ERROR::IStepError & o_step_error );
-//
-// Wrapper function to call fabric_io_run_training
-//
-void* call_fabric_io_run_training( void *io_pArgs )
-{
- IStepError l_StepError;
- errlHndl_t l_errl = NULL;
+//******************************************************************************
+// Wrapper function to call fabric_io_run_training
+//******************************************************************************
+void* call_fabric_io_run_training( void *io_pArgs )
+{
+ errlHndl_t l_err(nullptr);
+ IStepError l_stepError;
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "call_fabric_io_run_training entry" );
+ TRACFCOMP(g_trac_isteps_trace,ENTER_MRK"call_fabric_io_run_training entry");
- uint8_t l_linktrain_failures = 0;
- EDI_EI_INITIALIZATION::TargetPairs_t l_PbusConnections;
- const uint32_t MaxBusSet = 1;
- TYPE busSet[MaxBusSet] = { TYPE_XBUS }; // TODO RTC:152304 - add TYPE_OBUS
+ uint32_t l_numberOfTrainFailures(0);
+ EDI_EI_INITIALIZATION::TargetPairs_t l_pbusConnections;
+ TYPE l_busSet[] = { TYPE_XBUS, TYPE_OBUS };
+ constexpr uint32_t l_maxBusSet(sizeof(l_busSet)/sizeof(TYPE));
- for (uint32_t ii = 0; (!l_errl) && (ii < MaxBusSet); ii++)
+ for (uint32_t ii = 0; ii < l_maxBusSet; ++ii)
{
- l_errl = EDI_EI_INITIALIZATION::PbusLinkSvc::getTheInstance().
- getPbusConnections(l_PbusConnections, busSet[ii]);
- if (l_errl)
+ l_err = EDI_EI_INITIALIZATION::PbusLinkSvc::getTheInstance().
+ getPbusConnections(l_pbusConnections, l_busSet[ii]);
+ if (l_err)
{
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ TRACFCOMP(g_trac_isteps_trace,
"ERROR 0x%.8X : getPbusConnections TYPE_%cBUS returns error",
- l_errl->reasonCode(), (ii ? 'X':'O') );
-
- // Create IStep error log and cross reference to error that occurred
- l_StepError.addErrorDetails( l_errl );
+ l_err->reasonCode(), (ii ? 'O':'X') );
- // Commit the error log
- // Log should be deleted and set to NULL in errlCommit.
- errlCommit(l_errl, HWPF_COMP_ID);
+ // Capture error and then
+ captureError(l_err,
+ l_stepError,
+ HWPF_COMP_ID);
// Don't continue with a potential bad connection set
break;
}
- for (const auto & l_PbusConnection: l_PbusConnections)
+ if (TYPE_XBUS == l_busSet[ii])
{
- const fapi2::Target <fapi2::TARGET_TYPE_XBUS>
- l_thisPbusFapi2Target(
- (const_cast<TARGETING::Target*>(l_PbusConnection.first)));
-
- const fapi2::Target <fapi2::TARGET_TYPE_XBUS>
- l_connectedPbusFapi2Target(
- (const_cast<TARGETING::Target*>(l_PbusConnection.second)));
-
-
- const TARGETING::ATTR_IO_XBUS_MASTER_MODE_type l_master_mode =
- l_PbusConnection.first->getAttr
- <TARGETING::ATTR_IO_XBUS_MASTER_MODE>();
-
- TARGETING::ATTR_FAPI_NAME_type l_master_target_name = {0};
- TARGETING::ATTR_FAPI_NAME_type l_slave_target_name = {0};
- if (l_master_mode == fapi2::ENUM_ATTR_IO_XBUS_MASTER_MODE_TRUE)
+ for (const auto & l_pbusConnection: l_pbusConnections)
{
- l_linktrain_failures = run_linktraining(
- l_thisPbusFapi2Target,
- l_connectedPbusFapi2Target,
- l_StepError);
- fapi2::toString(l_thisPbusFapi2Target,
+ // Default the master and slave fapi2 targets
+ fapi2::Target <fapi2::TARGET_TYPE_XBUS>
+ l_masterFapi2Target(
+ (const_cast<TARGETING::Target*>(l_pbusConnection.first)));
+
+ fapi2::Target <fapi2::TARGET_TYPE_XBUS>
+ l_slaveFapi2Target(
+ (const_cast<TARGETING::Target*>(l_pbusConnection.second)));
+
+ //Swap master and slave fapi2 targets if master mode is NOT true
+ if (l_pbusConnection.first->getAttr
+ <TARGETING::ATTR_IO_XBUS_MASTER_MODE>() !=
+ fapi2::ENUM_ATTR_IO_XBUS_MASTER_MODE_TRUE)
+ {
+ l_masterFapi2Target =
+ (const_cast<TARGETING::Target*>(l_pbusConnection.second));
+
+ l_slaveFapi2Target =
+ (const_cast<TARGETING::Target*>(l_pbusConnection.first));
+ }
+
+ TARGETING::ATTR_FAPI_NAME_type l_master_target_name = {0};
+ TARGETING::ATTR_FAPI_NAME_type l_slave_target_name = {0};
+
+ l_numberOfTrainFailures = run_linktraining(l_masterFapi2Target,
+ l_slaveFapi2Target,
+ l_stepError);
+ fapi2::toString(l_masterFapi2Target,
l_master_target_name,
sizeof(l_master_target_name));
- fapi2::toString(l_connectedPbusFapi2Target,
- l_slave_target_name,
- sizeof(l_slave_target_name));
- }
- else
- {
- l_linktrain_failures = run_linktraining(
- l_connectedPbusFapi2Target,
- l_thisPbusFapi2Target,
- l_StepError);
- fapi2::toString(l_connectedPbusFapi2Target,
- l_master_target_name,
- sizeof(l_master_target_name));
- fapi2::toString(l_thisPbusFapi2Target,
+
+ fapi2::toString(l_slaveFapi2Target,
l_slave_target_name,
sizeof(l_slave_target_name));
- }
- if (l_linktrain_failures)
- {
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "%d attempts to linktrain XBUS targets failed. "
- "Master: %s, Slave: %s", l_linktrain_failures,
- l_master_target_name, l_slave_target_name);
- }
- else
+ if (l_numberOfTrainFailures)
+ {
+ TRACFCOMP(g_trac_isteps_trace,
+ "%d attempts to linktrain XBUS targets failed. "
+ "Master: %s, Slave: %s", l_numberOfTrainFailures,
+ l_master_target_name, l_slave_target_name);
+ }
+ else
+ {
+ TRACFCOMP(g_trac_isteps_trace,
+ "Successfully linktrained XBUS targets. "
+ "Master: %s, Slave: %s",
+ l_master_target_name, l_slave_target_name);
+ }
+ } // end for (const auto & l_pbusConnection: l_pbusConnections)
+ } // end if (TYPE_XBUS == l_busSet[ii])
+#ifdef CONFIG_SMP_WRAP_TEST
+ else if (TYPE_OBUS == l_busSet[ii])
+ {
+ // Make the FAPI call to p9_io_obus_linktrain
+ if (!trainBusHandler(l_busSet[ii],
+ P9_IO_OBUS_LINKTRAIN,
+ l_stepError,
+ HWPF_COMP_ID,
+ l_pbusConnections))
{
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "Successfully linktrained XBUS targets. "
- "Master: %s, Slave: %s",
- l_master_target_name, l_slave_target_name);
+ break;
}
- }
- } // end for MaxBusSet
+ } // end else if (TYPE_OBUS == l_busSet[ii])
+#endif
+ } // end for (uint32_t ii = 0; ii < l_maxBusSet; ++ii)
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "call_fabric_io_run_training exit" );
+ TRACFCOMP(g_trac_isteps_trace, EXIT_MRK"call_fabric_io_run_training exit" );
// end task, returning any errorlogs to IStepDisp
- return l_StepError.getErrorHandle();
+ return l_stepError.getErrorHandle();
}
-
-
-
/**
* @brief Try to train link between target's endpoints
*
@@ -208,7 +202,7 @@ uint8_t run_linktraining(
ISTEP_ERROR::IStepError & o_step_error)
{
uint8_t o_failures = 0;
- errlHndl_t l_errl = NULL;
+ errlHndl_t l_err(nullptr);
// group is either 0 or 1
std::vector<uint8_t> l_groups = {0,1};
@@ -216,7 +210,7 @@ uint8_t run_linktraining(
for (auto l_group : l_groups)
{
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ TRACFCOMP(g_trac_isteps_trace,
"Running p9_io_xbus_linktrain HWP on "
"master target %.8X and "
"slave target %.8X on group %d.",
@@ -224,39 +218,36 @@ uint8_t run_linktraining(
TARGETING::get_huid(i_slave_target),
l_group );
- FAPI_INVOKE_HWP(l_errl,
+ FAPI_INVOKE_HWP(l_err,
p9_io_xbus_linktrain,
i_master_target,
i_slave_target,
l_group);
- if (l_errl)
+ if (l_err)
{
o_failures++;
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ TRACFCOMP(g_trac_isteps_trace,
"Failure #%d) ERROR 0x%.8X : p9_io_xbus_linktrain "
"HWP on master target %.8X and "
"slave target %.8X on group %d.",
- o_failures, l_errl->reasonCode(),
+ o_failures, l_err->reasonCode(),
TARGETING::get_huid(i_master_target),
TARGETING::get_huid(i_slave_target),
l_group );
- // capture the target data in the elog
- ErrlUserDetailsTarget(i_master_target).addToLog( l_errl );
- ErrlUserDetailsTarget(i_slave_target).addToLog( l_errl );
-
- // Create IStep error log and cross ref error that occurred
- o_step_error.addErrorDetails( l_errl);
+ // Create a target list out of the master and slave target
+ TargetHandleList l_targetList =
+ { i_master_target.get(),
+ i_slave_target.get() };
- // Commit Error
- errlCommit(l_errl, HWPF_COMP_ID);
- l_errl = NULL;
+ // Capture error and continue
+ captureError(l_err,
+ o_step_error,
+ HWPF_COMP_ID,
+ l_targetList);
}
}
return o_failures;
}
-
-
-
-};
+}; // end namespace ISTEP_09
diff --git a/src/usr/isteps/istep09/call_fabric_post_trainadv.C b/src/usr/isteps/istep09/call_fabric_post_trainadv.C
index 210427508..4f36e8526 100644
--- a/src/usr/isteps/istep09/call_fabric_post_trainadv.C
+++ b/src/usr/isteps/istep09/call_fabric_post_trainadv.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -22,6 +22,7 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
+
/**
* @file call_fabric_post_trainadv.C
*
@@ -35,152 +36,96 @@
/******************************************************************************/
// Includes
/******************************************************************************/
-#include <stdint.h>
-#include <map>
-
-#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>
+// Integral and component ID support
+#include <stdint.h> // uint32_t
+#include <hbotcompid.H> // HWPF_COMP_ID
-#include <hwas/common/deconfigGard.H>
-#include <hwas/common/hwasCommon.H>
+// Tracing support
+#include <trace/interface.H> // TRACFCOMP
+#include <initservice/isteps_trace.H> // g_trac_isteps_trace
-#include <sbe/sbeif.H>
+// Error handling support
+#include <errl/errlentry.H> // errlHndl_t
+#include <isteps/hwpisteperror.H> // IStepError
-// targeting support
-#include <targeting/common/commontargeting.H>
-#include <targeting/common/utilFilter.H>
-#include <targeting/common/trace.H>
+// Pbus link service support
+#include <pbusLinkSvc.H> // TargetPairs_t, PbusLinkSvc
-#include <pbusLinkSvc.H>
-#include <fapi2/target.H>
-#include <fapi2/plat_hwp_invoker.H>
-
-// HWP
-#include <p9_io_xbus_post_trainadv.H>
+// HWP call support
+#include <istepHelperFuncs.H> // captureError
+#include <istep09/istep09HelperFuncs.H> // trainBusHandler
namespace ISTEP_09
{
-
-
-using namespace ISTEP;
using namespace ISTEP_ERROR;
-using namespace ERRORLOG;
+using namespace ISTEPS_TRACE;
using namespace TARGETING;
-using namespace HWAS;
-//
-// Wrapper function to call fabric_post_trainadv
-//
-void* call_fabric_post_trainadv( void *io_pArgs )
+
+//******************************************************************************
+// Wrapper function to call fabric_post_trainadv
+//******************************************************************************
+void* call_fabric_post_trainadv( void *io_pArgs )
{
- IStepError l_StepError;
- errlHndl_t l_errl = NULL;
+ errlHndl_t l_err(nullptr);
+ IStepError l_stepError;
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "call_fabric_post_trainadv entry" );
+ TRACFCOMP(g_trac_isteps_trace, ENTER_MRK"call_fabric_post_trainadv entry");
- EDI_EI_INITIALIZATION::TargetPairs_t l_PbusConnections;
- const uint32_t MaxBusSet = 1;
- TYPE busSet[MaxBusSet] = { TYPE_XBUS }; // TODO RTC:152304 - add TYPE_OBUS
+ EDI_EI_INITIALIZATION::TargetPairs_t l_pbusConnections;
+ TYPE l_busSet[] = { TYPE_XBUS, TYPE_OBUS };
+ constexpr uint32_t l_maxBusSet(sizeof(l_busSet)/sizeof(TYPE));
- for (uint32_t ii = 0; (!l_errl) && (ii < MaxBusSet); ii++)
+ for (uint32_t ii = 0; ii < l_maxBusSet; ii++)
{
- l_errl = EDI_EI_INITIALIZATION::PbusLinkSvc::getTheInstance().
- getPbusConnections(l_PbusConnections, busSet[ii]);
- if (l_errl)
+ l_err = EDI_EI_INITIALIZATION::PbusLinkSvc::getTheInstance().
+ getPbusConnections(l_pbusConnections, l_busSet[ii]);
+ if (l_err)
{
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ TRACFCOMP(g_trac_isteps_trace,
"ERROR 0x%.8X : getPbusConnections TYPE_%cBUS returns error",
- l_errl->reasonCode(), (ii ? 'X':'O') );
-
- // Create IStep error log and cross reference to error that occurred
- l_StepError.addErrorDetails( l_errl );
+ l_err->reasonCode(), (ii ? 'O':'X') );
- // Commit the error log
- // Log should be deleted and set to NULL in errlCommit.
- errlCommit(l_errl, HWPF_COMP_ID);
+ // Capture error and then exit
+ captureError(l_err,
+ l_stepError,
+ HWPF_COMP_ID);
// Don't continue with a potential bad connection set
break;
}
- for (const auto & l_PbusConnection: l_PbusConnections)
+ if (TYPE_XBUS == l_busSet[ii])
{
- const TARGETING::Target* l_thisPbusTarget = l_PbusConnection.first;
- const TARGETING::Target* l_connectedPbusTarget =
- l_PbusConnection.second;
-
- const fapi2::Target <fapi2::TARGET_TYPE_XBUS>
- l_thisPbusFapi2Target(
- (const_cast<TARGETING::Target*>(l_thisPbusTarget)));
-
- const fapi2::Target <fapi2::TARGET_TYPE_XBUS>
- l_connectedPbusFapi2Target(
- (const_cast<TARGETING::Target*>(l_connectedPbusTarget)));
-
- // group is either 0 or 1,
- // need to train both groups and allow for them to differ
- uint8_t l_this_group = 0;
- uint8_t l_connected_group = 0;
- uint8_t l_group_loop = 0;
- for (l_group_loop = 0; l_group_loop < 4; l_group_loop++)
+ // Make the FAPI call to p9_io_xbus_post_trainadv
+ if (!trainBusHandler(l_busSet[ii],
+ P9_IO_XBUS_POST_TRAINADV,
+ l_stepError,
+ HWPF_COMP_ID,
+ l_pbusConnections))
{
- l_this_group = l_group_loop / 2; // 0, 0, 1, 1
- l_connected_group = l_group_loop % 2; // 0, 1, 1, 0
-
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "Running p9_io_xbus_post_trainadv HWP on "
- "this %cbus target %.8X (group %d) and connected "
- "target %.8X (group %d)",
- (ii ? 'X' : 'O'),
- TARGETING::get_huid(l_thisPbusTarget), l_this_group,
- TARGETING::get_huid(l_connectedPbusTarget),
- l_connected_group );
-
- FAPI_INVOKE_HWP( l_errl, p9_io_xbus_post_trainadv,
- l_thisPbusFapi2Target, l_this_group,
- l_connectedPbusFapi2Target,
- l_connected_group );
-
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "%s : %cbus connection p9_io_xbus_post_trainadv "
- "Target 0x%.8X using group %d, connected target 0x%.8X "
- "using group %d",
- (l_errl ? "ERROR" : "SUCCESS"), (ii ? 'X' : 'O'),
- TARGETING::get_huid(l_thisPbusTarget), l_this_group,
- TARGETING::get_huid(l_connectedPbusTarget),
- l_connected_group );
-
- if ( l_errl )
- {
- // capture the target data in the elog
- ErrlUserDetailsTarget(l_thisPbusTarget).addToLog(l_errl);
- ErrlUserDetailsTarget(l_connectedPbusFapi2Target).addToLog
- (l_errl);
-
- // Create IStep error log and cross ref error that occurred
- l_StepError.addErrorDetails( l_errl );
-
- // Commit Error
- errlCommit( l_errl, HWPF_COMP_ID );
- // We want to continue the training despite the error, so
- // no break
- l_errl = NULL;
- }
-
- } // end of groups
- } // end of connection TYPE combinations
- } // end of connection set loop
-
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "call_fabric_post_trainadv exit" );
+ break;
+ }
+ } // end if (TYPE_XBUS == l_busSet[ii])
+#ifdef CONFIG_SMP_WRAP_TEST
+ else if (TYPE_OBUS == l_busSet[ii])
+ {
+ // Make the FAPI call to p9_io_obus_post_trainadv
+ if (!trainBusHandler(l_busSet[ii],
+ P9_IO_OBUS_POST_TRAINADV,
+ l_stepError,
+ HWPF_COMP_ID,
+ l_pbusConnections))
+ {
+ break;
+ }
+ } // end else if (TYPE_OBUS == l_busSet[ii])
+#endif
+ } // end for (uint32_t ii = 0; ii < l_maxBusSet; ++ii)
+
+ TRACFCOMP(g_trac_isteps_trace, EXIT_MRK"call_fabric_post_trainadv exit");
// end task, returning any errorlogs to IStepDisp
- return l_StepError.getErrorHandle();
+ return l_stepError.getErrorHandle();
}
-};
+}; // end namespace ISTEP_09
diff --git a/src/usr/isteps/istep09/call_proc_fab_iovalid.C b/src/usr/isteps/istep09/call_proc_fab_iovalid.C
index dea7a2bbf..7f530d716 100644
--- a/src/usr/isteps/istep09/call_proc_fab_iovalid.C
+++ b/src/usr/isteps/istep09/call_proc_fab_iovalid.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -122,7 +122,7 @@ void* call_proc_fab_iovalid( void *io_pArgs )
"Running p9_fab_iovalid HWP on processor target %.8X",
TARGETING::get_huid(l_cpu_target) );
FAPI_INVOKE_HWP(l_errl, p9_fab_iovalid, l_fapi2_proc_target,
- true, true, false);
+ true, true, true);
if(l_errl)
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
diff --git a/src/usr/isteps/makefile b/src/usr/isteps/makefile
index c247775e6..b77651293 100644
--- a/src/usr/isteps/makefile
+++ b/src/usr/isteps/makefile
@@ -48,6 +48,7 @@ SUBDIRS+=p9_phbPerst.d
SUBDIRS+=tod.d
SUBDIRS+=fab_iovalid.d
SUBDIRS+=nest.d
+SUBDIRS+=io.d
OBJS += hwpisteperror.o
OBJS += hwpistepud.o
OpenPOWER on IntegriCloud