summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/makefile1
-rw-r--r--src/usr/initservice/istepdispatcher/istep_mbox_msgs.H13
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C118
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.H12
-rw-r--r--src/usr/initservice/istepdispatcher/makefile2
-rw-r--r--src/usr/isteps/makefile1
-rw-r--r--src/usr/isteps/p9_phbPerst/makefile41
7 files changed, 183 insertions, 5 deletions
diff --git a/src/makefile b/src/makefile
index 8beb307dd..0c456373d 100644
--- a/src/makefile
+++ b/src/makefile
@@ -199,6 +199,7 @@ EXTENDED_MODULES += xz
EXTENDED_MODULES += p9_stop_util
EXTENDED_MODULES += isteps_mss
EXTENDED_MODULES += p9_cpuWkup
+EXTENDED_MODULES += p9_phbPerst
EXTENDED_MODULES += $(if $(CONFIG_ENABLE_HDAT_IN_HOSTBOOT),hdat)
EXTENDED_MODULES += $(if $(CONFIG_SECUREBOOT),secureboot_ext)
diff --git a/src/usr/initservice/istepdispatcher/istep_mbox_msgs.H b/src/usr/initservice/istepdispatcher/istep_mbox_msgs.H
index c7e7fdb11..afc0e6b04 100644
--- a/src/usr/initservice/istepdispatcher/istep_mbox_msgs.H
+++ b/src/usr/initservice/istepdispatcher/istep_mbox_msgs.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* [+] 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. */
@@ -59,7 +61,9 @@ enum
HWSVR_IPL_PROGRESS_CODE = 0x11,
HWSVR_DO_IOVALID_PROCESSING = 0xC1,
HWSVR_COALESCE_HOST = 0xC2,
- HWSVR_DO_SHUTDOWN = 0x12
+ HWSVR_DO_SHUTDOWN = 0x12,
+ HWSVR_PERST_ASSERT = 0x20,
+ HWSVR_PERST_NEGATE = 0x21
};
// ------------------------------------------------------------------
@@ -83,7 +87,10 @@ enum
HWSVR_DO_SHUTDOWN,
COALESCE_HOST = MBOX::FIRST_UNSECURE_MSG |
HWSVR_COALESCE_HOST,
-
+ PERST_ASSERT = MBOX::FIRST_UNSECURE_MSG |
+ HWSVR_PERST_ASSERT,
+ PERST_NEGATE = MBOX::FIRST_UNSECURE_MSG |
+ HWSVR_PERST_NEGATE
};
} // namespace
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index 44749df3f..fd3165b80 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -79,6 +79,8 @@
#include <trace/trace.H>
#include <util/utilmbox_scratch.H>
#include <secureboot/service.H>
+#include <p9_perst_phb.H>
+#include <plat_hwp_invoker.H>
// ---------------------------
// Used to grab SBE boot side
@@ -132,7 +134,8 @@ IStepDispatcher::IStepDispatcher() :
iv_substepToCompleteBeforeShutdown(0),
iv_acceptIstepMessages(true),
iv_newGardRecord(false),
- iv_stopIpl(false)
+ iv_stopIpl(false),
+ iv_p9_phbPerstLibLoaded(false)
{
mutex_init(&iv_bkPtMutex);
@@ -1349,6 +1352,21 @@ void IStepDispatcher::msgHndlr()
// Further process the shutdown message
handleShutdownMsg(pMsg);
break;
+
+ case PERST_ASSERT:
+ // PERST Assert requested from Fsp
+ TRACFCOMP(g_trac_initsvc, INFO_MRK"msgHndlr: PERST_ASSERT");
+ // Further process the PERST Assert message
+ handlePerstMsg(pMsg);
+ break;
+
+ case PERST_NEGATE:
+ // PERST Negate requested from Fsp
+ TRACFCOMP(g_trac_initsvc, INFO_MRK"msgHndlr: PERST_NEGATE");
+ // Further process the PERST Negate message
+ handlePerstMsg(pMsg);
+ break;
+
default:
TRACFCOMP(g_trac_initsvc, ERR_MRK"msgHndlr: Ignoring unknown message 0x%08x",
pMsg->type);
@@ -2124,6 +2142,104 @@ void IStepDispatcher::handleProcFabIovalidMsg(msg_t * & io_pMsg)
TRACFCOMP( g_trac_initsvc, EXIT_MRK"IStepDispatcher::handleProcFabIovalidMsg");
}
+
+// ----------------------------------------------------------------------------
+// IStepDispatcher::handlePerstMsg()
+// ----------------------------------------------------------------------------
+void IStepDispatcher::handlePerstMsg(msg_t * & io_pMsg)
+{
+ TRACFCOMP(g_trac_initsvc, ENTER_MRK"IStepDispatcher::handlePerstMsg");
+
+ // assume the HWP will succeed
+ io_pMsg->data[1] = true;
+
+ errlHndl_t l_errl = NULL;
+
+ do
+ {
+ if // HWP Perst Libraries have not yet been loaded
+ ( iv_p9_phbPerstLibLoaded == false )
+ {
+ // load the libraries
+ l_errl = VFS::module_load( "p9_phbPerst.so" );
+
+ if (l_errl)
+ {
+ TRACFCOMP( g_trac_initsvc,
+ "handlePerstMsg: Error loading p9_phbPerst, "
+ "PLID = 0x%x",
+ l_errl->plid() );
+
+ io_pMsg->data[1] = false;
+ errlCommit( l_errl, INITSVC_COMP_ID );
+ break;
+ }
+ else
+ {
+ iv_p9_phbPerstLibLoaded = true;
+ }
+ } // end load libraries
+
+ // translate message inputs to fapi target and HWP Perst action
+ const TARGETING::ATTR_HUID_type huid =
+ static_cast <const TARGETING::ATTR_HUID_type>(io_pMsg->data[0]);
+ TARGETING::Target * pInputTarget =
+ TARGETING::Target::getTargetFromHuid( huid );
+
+ const fapi2::Target<fapi2::TARGET_TYPE_PHB> fapi2_target(pInputTarget);
+
+ uint32_t msgPerstAction = io_pMsg->type;
+
+ PERST_ACTION hwpPerstAction = (msgPerstAction == PERST_ASSERT) ?
+ ACTIVATE_PERST : DEACTIVATE_PERST;
+
+ // Execute the PERST directive
+ FAPI_INVOKE_HWP( l_errl,
+ p9_perst_phb,
+ fapi2_target,
+ hwpPerstAction );
+
+ if(l_errl)
+ {
+ TRACFCOMP( g_trac_initsvc,
+ "ERROR : call p9_perst_phb, PLID=0x%x",
+ l_errl->plid() );
+ l_errl->collectTrace("INITSVC",256);
+ l_errl->collectTrace("FAPI",256);
+ errlCommit(l_errl, HWPF_COMP_ID);
+
+ io_pMsg->data[1] = false;
+ }
+ } while(0);
+
+ if (msg_is_async(io_pMsg))
+ {
+ // It is expected that handle Perst messages are sync.
+ // otherwise we don't have a way to send the results
+ // back to the FSP.
+ // This leg drops results on the floor
+ TRACFBIN( g_trac_initsvc,
+ INFO_MRK
+ "IStepDispatcher::handlePerstMsg :"
+ "Async msg, no Response to FSP, Msg = ",
+ io_pMsg,
+ sizeof(*io_pMsg) );
+
+ msg_free(io_pMsg);
+ io_pMsg = NULL;
+ }
+ else
+ {
+ // Send the message back as a response
+ msg_respond(iv_msgQ, io_pMsg);
+ io_pMsg = NULL;
+ }
+
+ TRACFCOMP(g_trac_initsvc, EXIT_MRK"IStepDispatcher::handlePerstMsg");
+
+ return;
+}
+
// ----------------------------------------------------------------------------
// IStepDispatcher::sendProgressCode()
// This method has a default of true for i_needsLock
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H
index 59e0fd45b..51b429f4a 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.H
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H
@@ -346,6 +346,15 @@ private:
void handleIStepRequestMsg(msg_t * & io_pMsg);
/**
+ * @brief Handles a PERST request message.
+ *
+ * Calls p9_perst_phb() to perform the requested function
+ *
+ * @param[io] io_pMsg Reference to pointer to message (cleaned up)
+ */
+ void handlePerstMsg(msg_t * & io_pMsg);
+
+ /**
* @brief This function will be used to query the istep master list and the
* other istep headers to know what functions/tasks need to be started
* for the Istep/Substep that we are in.
@@ -472,6 +481,9 @@ private:
// the istep dispatcher should stop executing steps
bool iv_stopIpl;
+ // Instance variable to state if the PHB Perst libraries are loaded
+ bool iv_p9_phbPerstLibLoaded;
+
// Message Queue for receiving message from SP or SPless user console
msg_q_t iv_msgQ;
diff --git a/src/usr/initservice/istepdispatcher/makefile b/src/usr/initservice/istepdispatcher/makefile
index a2dcb4704..19b5f0197 100644
--- a/src/usr/initservice/istepdispatcher/makefile
+++ b/src/usr/initservice/istepdispatcher/makefile
@@ -27,12 +27,12 @@ MODULE = istepdisp
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer
-# Next includes required for attribute override support
EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/nest/
VPATH = ${ROOTPATH}/src/usr/initservice/bootconfig/
diff --git a/src/usr/isteps/makefile b/src/usr/isteps/makefile
index 64adc3eed..7f84c85fd 100644
--- a/src/usr/isteps/makefile
+++ b/src/usr/isteps/makefile
@@ -44,6 +44,7 @@ SUBDIRS+=p9_stop_util.d
SUBDIRS+=mss.d
SUBDIRS+=cen.d
SUBDIRS+=cpuWkup.d
+SUBDIRS+=p9_phbPerst.d
OBJS += hwpisteperror.o
OBJS += hwpistepud.o
diff --git a/src/usr/isteps/p9_phbPerst/makefile b/src/usr/isteps/p9_phbPerst/makefile
new file mode 100644
index 000000000..9ca17f183
--- /dev/null
+++ b/src/usr/isteps/p9_phbPerst/makefile
@@ -0,0 +1,41 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/isteps/p9_phbPerst/makefile $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2017
+# [+] 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 = p9_phbPerst
+PROCEDURES_PATH = ${ROOTPATH}/src/import/chips/p9/procedures
+
+EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/nest/
+EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
+EXTRAINCDIR += ${ROOTPATH}/obj/genfiles/
+
+include ${ROOTPATH}/procedure.rules.mk
+include $(PROCEDURES_PATH)/hwp/nest/p9_perst_phb.mk
+include ${ROOTPATH}/config.mk
+
+VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/nest/
+
OpenPOWER on IntegriCloud