summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-11-07 15:18:38 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-01-10 13:53:48 -0600
commit7617b1930b50fca7692d971addf0e55243afe833 (patch)
tree3829bca9b1f512661f78a1b176b824482d789b11
parent908baf329747b078d6604741cd4734300a70bacb (diff)
downloadblackbird-hostboot-7617b1930b50fca7692d971addf0e55243afe833.tar.gz
blackbird-hostboot-7617b1930b50fca7692d971addf0e55243afe833.zip
istep 18.9 - sys_proc_fab_iovalid
. istepdispatcher code will create separate thread to do the work, when the message is received from FSP . call p8_block_wakeup_intr(SET) on all EX chiplets . call cpu_all_winkle() when finished Change-Id: Id594bd9c48b490838e92c4d63ecc4bcd293f9f53 RTC: 72052 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7403 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rwxr-xr-xsrc/build/tools/listdeps.pl6
-rw-r--r--src/include/usr/isteps/istep18list.H5
-rw-r--r--src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C155
-rw-r--r--src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H12
-rw-r--r--src/usr/hwpf/hwp/establish_system_smp/makefile4
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C106
-rw-r--r--src/usr/initservice/istepdispatcher/sptask.C50
7 files changed, 223 insertions, 115 deletions
diff --git a/src/build/tools/listdeps.pl b/src/build/tools/listdeps.pl
index 5835d884f..124c9e2a4 100755
--- a/src/build/tools/listdeps.pl
+++ b/src/build/tools/listdeps.pl
@@ -6,7 +6,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2013
+# COPYRIGHT International Business Machines Corp. 2013,2014
#
# p1
#
@@ -171,7 +171,7 @@ else
"libdmi_training.so" ,
"libbuild_winkle_images.so" ,
"libcore_activate.so" ,
- "libestablish_system_smp.so" ,
+ "libtod_init.so" ,
"libstart_payload.so" ,
"libocc.so" ,
);
@@ -219,7 +219,7 @@ my %istepFiles = (
"libocc.so" => "istep15list.H" ,
"libbuild_winkle_images.so" => "istep15list.H" ,
"libcore_activate.so" => "istep16list.H" ,
- "libestablish_system_smp.so" => "istep18list.H" ,
+ "libtod_init.so" => "istep18list.H" ,
"libstart_payload.so" => "istep21list.H" ,
);
diff --git a/src/include/usr/isteps/istep18list.H b/src/include/usr/isteps/istep18list.H
index f1b70c57c..0d9720780 100644
--- a/src/include/usr/isteps/istep18list.H
+++ b/src/include/usr/isteps/istep18list.H
@@ -47,7 +47,6 @@
#include <initservice/initsvcreasoncodes.H>
// include prototypes file
-#include "../../../usr/hwpf/hwp/establish_system_smp/establish_system_smp.H"
#include "../../../usr/hwpf/hwp/tod_init/tod_init.H"
namespace INITSERVICE
@@ -154,7 +153,7 @@ namespace INITSERVICE
}
},
{
- ISTEPNAME(18,09,""),
+ ISTEPNAME(18,09,"sys_proc_fab_iovalid"),
NULL,
{
NONE,
@@ -220,9 +219,7 @@ namespace INITSERVICE
const DepModInfo g_istep18Dependancies = {
{
- DEP_LIB(libestablish_system_smp.so),
DEP_LIB(libtod_init.so),
- DEP_LIB(libedi_ei_initialization.so),
{ 0 },
}
};
diff --git a/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C b/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C
index bcc4e498c..f33475873 100644
--- a/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C
+++ b/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.C
@@ -47,6 +47,7 @@
#include <initservice/isteps_trace.H>
#include <hwpisteperror.H>
+#include <errl/errludtarget.H>
#include <istep_mbox_msgs.H>
#include <vfs/vfs.H>
@@ -54,6 +55,7 @@
// targeting support
#include <targeting/common/commontargeting.H>
#include <smp_unfencing_inter_enclosure_abus_links.H>
+#include <targeting/common/utilFilter.H>
#include <targeting/common/attributes.H>
// fapi support
@@ -65,11 +67,16 @@
#include <mbox/ipc_msg_types.H>
#include <intr/interrupt.H>
+// Uncomment these files as they become available:
+// #include "host_coalesce_host/host_coalesce_host.H"
+#include "p8_block_wakeup_intr/p8_block_wakeup_intr.H"
+
namespace ESTABLISH_SYSTEM_SMP
{
using namespace ISTEP;
using namespace ISTEP_ERROR;
+using namespace ERRORLOG;
using namespace TARGETING;
using namespace fapi;
using namespace EDI_EI_INITIALIZATION;
@@ -385,41 +392,36 @@ errlHndl_t call_host_coalesce_host( )
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"call_host_coalesce_host exit" );
+ // end task, returning any errorlogs to IStepDisp
return l_errl;
}
//******************************************************************************
// host_sys_fab_iovalid_processing function
//******************************************************************************
-void host_sys_fab_iovalid_processing( msg_t* io_pMsg )
+void *host_sys_fab_iovalid_processing(void* io_ptr )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"host_sys_fab_iovalid_processing entry" );
-
- iovalid_msg * drawerData = NULL;
-
- uint16_t count = 0;
-
- std::vector<TARGETING::EntityPath> present_drawers;
+ // input parameter is actually a msg_t pointer
+ msg_t* io_pMsg = static_cast<msg_t *>(io_ptr);
+ // assume success, unless we hit an error later.
+ io_pMsg->data[0] = INITSERVICE::HWSVR_MSG_SUCCESS;
errlHndl_t l_errl = NULL;
// if there is extra data, start processing it
- // else send back a msg to indicate invalid msg
if(io_pMsg->extra_data)
{
- drawerData = (iovalid_msg *)io_pMsg->extra_data;
+ iovalid_msg * drawerData = (iovalid_msg *)io_pMsg->extra_data;
// setup a pointer to the first drawer entry in our data
TARGETING::EntityPath * ptr = drawerData->drawers;
-
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,"Master node %s "
- "List size = %d bytes "
- "Drawer count = %d",
- ptr->toString(), drawerData->size, drawerData->count);
-
- count = drawerData->count;
+ const uint16_t count = drawerData->count;
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "Master node %s List size = %d bytes Drawer count = %d",
+ ptr->toString(), drawerData->size, count);
// get FABRIC_TO_PHYSICAL_NODE_MAP
TARGETING::Target * sys = NULL;
@@ -427,14 +429,15 @@ void host_sys_fab_iovalid_processing( msg_t* io_pMsg )
assert(sys != NULL);
uint8_t node_map[8];
-
- bool rc =
- sys->tryGetAttr<TARGETING::ATTR_FABRIC_TO_PHYSICAL_NODE_MAP>(node_map);
+ bool rc = sys->tryGetAttr<TARGETING::ATTR_FABRIC_TO_PHYSICAL_NODE_MAP>
+ (node_map);
assert(rc == true);
TARGETING::ATTR_HB_EXISTING_IMAGE_type hb_existing_image = 0;
// create a vector with the present drawers
+ std::vector<TARGETING::EntityPath> present_drawers;
+
for(uint8_t i = 0; i < count; i++)
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
@@ -442,7 +445,7 @@ void host_sys_fab_iovalid_processing( msg_t* io_pMsg )
present_drawers.push_back(*ptr);
- TARGETING::EntityPath::PathElement pe =
+ TARGETING::EntityPath::PathElement pe =
ptr->pathElementOfType(TARGETING::TYPE_NODE);
// pe.instance is the drawer number - convert to logical node
@@ -465,42 +468,13 @@ void host_sys_fab_iovalid_processing( msg_t* io_pMsg )
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"$TODO RTC:63128 - hb instances exchange and agree on cfg");
- bool l_libloaded = false;
- if ( !VFS::module_is_loaded( "libedi_ei_initialization.so" ) )
- {
- l_errl = VFS::module_load( "libedi_ei_initialization.so" );
- if ( l_errl )
- {
- TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ERR_MRK
- "Could not load libedi_ei_initialization.so");
- }
- else
- {
- l_libloaded = true;
- }
- }
-
- if(!l_errl)
+ // after agreement, open abuses as required
+ l_errl = smp_unfencing_inter_enclosure_abus_links();
+ if (l_errl)
{
- // after agreement, open abuses as required
- l_errl = smp_unfencing_inter_enclosure_abus_links();
+ io_pMsg->data[0] = l_errl->plid();
+ errlCommit(l_errl, HWPF_COMP_ID);
}
-
- if(l_libloaded) // loaded locally
- {
- l_errl = VFS::module_unload( "libedi_ei_initialization.so" );
- if(l_errl)
- {
- TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ERR_MRK
- "Could not un-load libedi_ei_initialization.so");
- }
- }
-
- // release the storage from the message
- free(io_pMsg->extra_data);
- io_pMsg->extra_data = NULL;
-
- io_pMsg->data[0] = INITSERVICE::HWSVR_MSG_SUCCESS;
}
else
{
@@ -511,20 +485,79 @@ void host_sys_fab_iovalid_processing( msg_t* io_pMsg )
io_pMsg->data[1] = 0;
- // if there is an error log add the ID to
- // data 0
- if(l_errl)
+ // if there wasn't an error
+ if (io_pMsg->data[0] == INITSERVICE::HWSVR_MSG_SUCCESS)
{
- io_pMsg->data[0] = l_errl->eid();
- errlCommit(l_errl, HWPF_COMP_ID);
+ uint32_t l_plid = 0;
+
+ // loop thru all proc and find all functional ex units
+ // Get all functional proc chip targets
+ TARGETING::TargetHandleList l_procTargetList;
+ getAllChips(l_procTargetList, TYPE_PROC);
+ for (TargetHandleList::const_iterator l_procIter =
+ l_procTargetList.begin();
+ l_procIter != l_procTargetList.end();
+ ++l_procIter)
+ {
+ const TARGETING::Target* l_pChipTarget = *l_procIter;
+
+ // Get EX list under this proc
+ TARGETING::TargetHandleList l_exList;
+ getChildChiplets( l_exList, l_pChipTarget, TYPE_EX );
+
+ for (TargetHandleList::const_iterator
+ l_exIter = l_exList.begin();
+ l_exIter != l_exList.end();
+ ++l_exIter)
+ {
+ const TARGETING::Target * l_exTarget = *l_exIter;
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Running p8_block_wakeup_intr(SET) on EX target HUID %.8X",
+ TARGETING::get_huid(l_exTarget));
+
+ fapi::Target l_fapi_ex_target( TARGET_TYPE_EX_CHIPLET,
+ (const_cast<TARGETING::Target*>(l_exTarget)) );
+
+ FAPI_INVOKE_HWP(l_errl,
+ p8_block_wakeup_intr,
+ l_fapi_ex_target,
+ BLKWKUP_SET);
+ if ( l_errl )
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR : p8_block_wakeup_intr(SET)" );
+ // capture the target data in the elog
+ ErrlUserDetailsTarget(l_exTarget).addToLog( l_errl );
+ if (l_plid != 0)
+ {
+ // use the same plid as the previous
+ l_errl->plid(l_plid);
+ }
+ else
+ {
+ // set this plid for the caller to see
+ l_plid = l_errl->plid();
+ io_pMsg->data[0] = l_errl->plid();
+ }
+ errlCommit( l_errl, HWPF_COMP_ID );
+ }
+ else
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "SUCCESS : p8_block_wakeup_intr(SET)" );
+ }
+ } // for ex
+ } // for proc
}
// response will be sent by calling routine
- // IStepDispatcher::handleMoreWorkNeededMsg()
+ // IStepDispatcher::handleProcFabIovalidMsg()
// which will also execute the procedure to winkle all cores
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "host_sys_fab_iovalid_processing exit" );
+ "host_sys_fab_iovalid_processing exit data[0]=0x%X",
+ io_pMsg->data[0]);
+ return NULL;
}
}; // end namespace
diff --git a/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H b/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H
index 51ff27cc5..35496d593 100644
--- a/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H
+++ b/src/usr/hwpf/hwp/establish_system_smp/establish_system_smp.H
@@ -46,6 +46,12 @@
* @istepdesc Establish System SMP
*
* @{
+ * @substepnum 9
+ * @substepname host_sys_fab_iovalid_processing
+ * @substepdesc : Lower functional fences on sys SMP
+ * @target_sched serial
+ * @}
+ * @{
* @substepnum 12
* @substepname host_coalesce_host
* @substepdesc : Create single host image
@@ -69,7 +75,7 @@ namespace ESTABLISH_SYSTEM_SMP
struct iovalid_msg {
uint32_t size; //!Data length in bytes
uint16_t type; //! IPL/CCM type message
- uint16_t count; //! Number of drawer HUIDs in data
+ uint16_t count; //! Number of drawers in data
TARGETING::EntityPath drawers[0]; //! Place holder for data
};
@@ -102,9 +108,9 @@ errlHndl_t call_host_coalesce_host( );
*
* param[in,out] io_pMsg - input message buffer with drawer info,
* also used for response message to FSP
- *
+ * return NULL
*/
-void host_sys_fab_iovalid_processing( msg_t* io_pMsg );
+void* host_sys_fab_iovalid_processing( void* io_pMsg );
}; // end namespace
diff --git a/src/usr/hwpf/hwp/establish_system_smp/makefile b/src/usr/hwpf/hwp/establish_system_smp/makefile
index 018c15f10..fb4b43df9 100644
--- a/src/usr/hwpf/hwp/establish_system_smp/makefile
+++ b/src/usr/hwpf/hwp/establish_system_smp/makefile
@@ -5,7 +5,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2012,2013
+# COPYRIGHT International Business Machines Corp. 2012,2014
#
# p1
#
@@ -44,6 +44,8 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/edi_ei_initialization
## NOTE: add a new EXTRAINCDIR when you add a new HWP
## EXAMPLE:
## EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/establish_system_smp/<HWP_dir>
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images
+EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar
## NOTE: add new object files when you add a new HWP
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index e76fdc331..cf0718126 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -38,6 +38,7 @@
#include <kernel/console.H> // printk status
#include <vfs/vfs.H> // for VFS::module_load
#include <sys/task.h> // tid_t, task_create, etc
+#include <sys/misc.h> // cpu_all_winkle
#include <errl/errlentry.H> // errlHndl_t
#include <initservice/isteps_trace.H> // ISTEPS_TRACE buffer
#include <initservice/initsvcudistep.H> // InitSvcUserDetailsIstep
@@ -1188,30 +1189,99 @@ void IStepDispatcher::handleProcFabIovalidMsg(msg_t * & io_pMsg)
{
TRACFCOMP(g_trac_initsvc, ENTER_MRK"IStepDispatcher::handleProcFabIovalidMsg");
- // Ensure the library is loaded
- errlHndl_t err = VFS::module_load("libestablish_system_smp.so");
-
- if (err)
- {
- TRACFCOMP(g_trac_initsvc, "handleProcFabIovalidMsg: Error loading module, PLID = 0x%x",
- err->plid());
- errlCommit(err, INITSVC_COMP_ID);
- msg_free(io_pMsg);
- io_pMsg = NULL;
- }
- else
+ errlHndl_t err = NULL;
+ do
{
- // $TODO RTC:88284 - Create Child Thread
- ESTABLISH_SYSTEM_SMP::host_sys_fab_iovalid_processing(io_pMsg);
+ // Ensure the libraries needed are loaded
+ err = VFS::module_load("libestablish_system_smp.so");
+ if (err)
+ {
+ TRACFCOMP(g_trac_initsvc, "handleProcFabIovalidMsg: Error loading libestablish_system_smp, PLID = 0x%x",
+ err->plid());
+
+ io_pMsg->data[0] = err->plid();
+ errlCommit(err, INITSVC_COMP_ID);
+ break;
+ }
+ err = VFS::module_load("libedi_ei_initialization.so");
+ if (err)
+ {
+ TRACFCOMP(g_trac_initsvc, "handleProcFabIovalidMsg: Error loading libedi_ei_initialization, PLID = 0x%x",
+ err->plid());
- // if there was an error don't winkle ?
+ io_pMsg->data[0] = err->plid();
+ errlCommit(err, INITSVC_COMP_ID);
+ break;
+ }
+
+ // Create child thread so that if there are problems, the istep
+ // dispatcher code continues
+ tid_t l_progTid = task_create(
+ ESTABLISH_SYSTEM_SMP::host_sys_fab_iovalid_processing,io_pMsg);
+ assert( l_progTid > 0 );
+ // wait here for the task to end.
+ // status of the task ( OK or Crashed ) is returned in l_childsts
+ int l_childsts = 0;
+ void *l_childrc = NULL;
+ tid_t l_tidretrc = task_wait_tid( l_progTid,
+ &l_childsts, &l_childrc );
+ if ((static_cast<int16_t>(l_tidretrc) < 0 ) ||
+ (l_childsts != TASK_STATUS_EXITED_CLEAN )
+ )
+ {
+ TRACFCOMP(g_trac_initsvc, "task_wait_tid failed; l_tidretrc=0x%x, l_childsts=0x%x",
+ l_tidretrc, l_childsts);
+ // the launched task failed or crashed,
+ } // endif tidretrc
+
+ // if there wasn't an error, winkle
if(io_pMsg->data[0] == HWSVR_MSG_SUCCESS)
{
- TRACFCOMP( g_trac_initsvc,
- "$TODO RTC:71447 - winkle all cores");
+ // Send the message back as a response
+ free(io_pMsg->extra_data);
+ io_pMsg->extra_data = NULL;
+ msg_respond(iv_msgQ, io_pMsg);
+ io_pMsg = NULL;
+
+ // call to suspend the MBOX so that all messages are flushed
+ err = MBOX::suspend();
+ if (err)
+ {
+ TRACFCOMP( g_trac_initsvc, "ERROR : MBOX::suspend");
+ errlCommit(err, INITSVC_COMP_ID);
+ // keep going, since we already responded back to the FSP
+ }
+
+ TRACFCOMP( g_trac_initsvc, "winkle all cores");
+ uint32_t l_rc = cpu_all_winkle();
+ if ( l_rc )
+ {
+ // failed to winkle
+ TRACFCOMP( g_trac_initsvc,
+ "ERROR : failed cpu_all_winkle, rc=0x%x", l_rc );
+ }
+ else
+ {
+ // something woke us up, we'll return and see what msg is there
+ TRACFCOMP( g_trac_initsvc,
+ "Returned from cpu_all_winkle." );
+ }
+
+ err = MBOX::resume();
+ if (err)
+ {
+ TRACFCOMP( g_trac_initsvc, "ERROR : MBOX::resume");
+ errlCommit(err, INITSVC_COMP_ID);
+ }
}
+ } while (0);
+ // if there was an error send back that msg
+ if(io_pMsg && (io_pMsg->data[0] != HWSVR_MSG_SUCCESS))
+ {
// Send the message back as a response
+ free(io_pMsg->extra_data);
+ io_pMsg->extra_data = NULL;
msg_respond(iv_msgQ, io_pMsg);
io_pMsg = NULL;
}
@@ -1220,7 +1290,7 @@ void IStepDispatcher::handleProcFabIovalidMsg(msg_t * & io_pMsg)
}
// ----------------------------------------------------------------------------
-// IStepDispatcher::handleProcFabIovalidMsg()
+// IStepDispatcher::sendProgressCode()
// This method has a default of true for i_needsLock
// ----------------------------------------------------------------------------
errlHndl_t IStepDispatcher::sendProgressCode(bool i_needsLock)
diff --git a/src/usr/initservice/istepdispatcher/sptask.C b/src/usr/initservice/istepdispatcher/sptask.C
index c07f0d87e..ccbf280e0 100644
--- a/src/usr/initservice/istepdispatcher/sptask.C
+++ b/src/usr/initservice/istepdispatcher/sptask.C
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/initservice/istepdispatcher/sptask.C $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2012
- *
- * p1
- *
- * Object Code Only (OCO) source materials
- * Licensed Internal Code Source Materials
- * IBM HostBoot Licensed Internal Code
- *
- * The source code for this program is not published or other-
- * wise divested of its trade secrets, irrespective of what has
- * been deposited with the U.S. Copyright Office.
- *
- * Origin: 30
- *
- * IBM_PROLOG_END_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/initservice/istepdispatcher/sptask.C $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
/**
* @file sptask.C
*
@@ -159,8 +158,9 @@ void userConsoleComm( void * io_msgQ )
writeSts( l_sts );
// pass the command on to IstepDisp, block until reply
- l_pCurrentMsg->type = 0x0;
- l_pCurrentMsg->data[0] =
+
+ l_pCurrentMsg->type = ISTEP_MSG_TYPE;
+ l_pCurrentMsg->data[0] =
( ( static_cast<uint64_t>(l_cmd.istep & 0xFF) << 32) |
( static_cast<uint64_t>(l_cmd.substep & 0xFF ) ) );
l_pCurrentMsg->data[1] = 0;
OpenPOWER on IntegriCloud