diff options
author | Brian Bakke <bbakke@us.ibm.com> | 2017-10-13 10:02:11 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-10-31 12:51:41 -0400 |
commit | 0abd9ab92d13875ab7898847fde9e985279512b8 (patch) | |
tree | abfb9d0b94c58a5c242630a52a81eff2e3fbfdaa /src/usr/initservice | |
parent | f77b89e3527e40da04b9889f64562e20b620cc12 (diff) | |
download | talos-hostboot-0abd9ab92d13875ab7898847fde9e985279512b8.tar.gz talos-hostboot-0abd9ab92d13875ab7898847fde9e985279512b8.zip |
Story 173854 - Hostboot service to run phb perst procedure
Change-Id: Ib9dc57f91f655e1b9a943a455cd0c0510eb47c45
RTC: 173854
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48384
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/initservice')
-rw-r--r-- | src/usr/initservice/istepdispatcher/istep_mbox_msgs.H | 13 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.C | 118 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.H | 12 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/makefile | 2 |
4 files changed, 140 insertions, 5 deletions
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/ |