diff options
author | Christian Geddes <crgeddes@us.ibm.com> | 2017-10-17 00:18:25 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2017-10-17 01:24:19 -0400 |
commit | 34320d3ac1583b69aeec136ab98445b35b34a381 (patch) | |
tree | 4cf5359f1dc65b8ec7ccf244963b7bb809c99215 /src/usr/isteps/istep21 | |
parent | 241fe35f78ea4eb1132f2c47da4ca1105f993a18 (diff) | |
download | talos-hostboot-34320d3ac1583b69aeec136ab98445b35b34a381.tar.gz talos-hostboot-34320d3ac1583b69aeec136ab98445b35b34a381.zip |
Revert "Re-apply p9_int_scom inits on shutdown path"
This reverts commit db91ab91d557b402c4f0709e3aaa20bb8025b27c.
Change-Id: Id83de4fe211c56de6fa11cc124d57910c434feb7
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48476
Tested-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/usr/isteps/istep21')
-rw-r--r-- | src/usr/isteps/istep21/call_host_start_payload.C | 224 | ||||
-rw-r--r-- | src/usr/isteps/istep21/makefile | 1 |
2 files changed, 71 insertions, 154 deletions
diff --git a/src/usr/isteps/istep21/call_host_start_payload.C b/src/usr/isteps/istep21/call_host_start_payload.C index 72b4cdc33..661af9d77 100644 --- a/src/usr/isteps/istep21/call_host_start_payload.C +++ b/src/usr/isteps/istep21/call_host_start_payload.C @@ -52,8 +52,6 @@ #include <p9_cpu_special_wakeup.H> #include <ipmi/ipmiwatchdog.H> #include <config.h> -#include <errno.h> -#include <p9_int_scom.H> #ifdef CONFIG_DRTM_TRIGGERING #include <secureboot/drtm.H> @@ -76,7 +74,7 @@ namespace ISTEP_21 * @param[in] Host boot master instance number (logical node number) * @param[in] Is this the master HB instance [true|false] * - * @return errlHndl_t - nullptr if succesful, otherwise a pointer to the error + * @return errlHndl_t - NULL if succesful, otherwise a pointer to the error * log. */ errlHndl_t callShutdown ( uint64_t i_hbInstance, bool i_masterIntance ); @@ -85,7 +83,7 @@ errlHndl_t callShutdown ( uint64_t i_hbInstance, bool i_masterIntance ); * @brief This function will send an IPC message to all other HB instances * to perfrom the shutdown sequence. * @param[in] Hostboot master instance number (logical node number) - * @Return errlHndlt_t - nullptr if succesful, otherwise an error Handle + * @Return errlHndlt_t - Null if succesful, otherwise an error Handle */ errlHndl_t broadcastShutdown ( uint64_t i_hbInstance ); @@ -108,7 +106,7 @@ errlHndl_t enableCoreCheckstops(); * @brief This function will clear the PORE BARs. Needs to be done * depending on payload type * - * @return errlHndl_t - nullptr if successful, otherwise a pointer to the error + * @return errlHndl_t - NULL if successful, otherwise a pointer to the error * log. */ errlHndl_t clearPoreBars ( void ); @@ -121,168 +119,90 @@ errlHndl_t clearPoreBars ( void ); * * @param[in] i_spFuncs - The SpFuncs system attribute. * - * @return errlHndl_t - nullptr if successful, otherwise a pointer to the error + * @return errlHndl_t - NULL if successful, otherwise a pointer to the error * log. */ errlHndl_t notifyFsp ( bool i_istepModeFlag, TARGETING::SpFunctions i_spFuncs ); -enum msg_preshutdown_types_t -{ - MSG_PRE_SHUTDOWN_INITS = 1 //Tells the msgQ to run inits that - //are needed before shutdown -}; - -void msgHandler(msg_q_t i_msgQ) -{ - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ENTER_MRK"call_host_start_payload::msgHandler()"); - - while(1) - { - msg_t* msg = msg_wait(i_msgQ); // wait for interrupt msg - - switch(msg->type) - { - case MSG_PRE_SHUTDOWN_INITS: - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,"Pre-Shutdown Inits event received"); - errlHndl_t l_errl = NULL; - TARGETING::TargetHandleList l_cpuTargetList; - getAllChips(l_cpuTargetList, TYPE_PROC); - fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM; - - for (const auto & l_cpu_target: l_cpuTargetList) - { - fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2_proc_target(l_cpu_target); - FAPI_INVOKE_HWP( l_errl, - p9_int_scom, - l_cpu_target, - FAPI_SYSTEM); - if(l_errl) - { - l_errl->collectTrace("ISTEPS_TRACE",256); - errlCommit(l_errl, ISTEP_COMP_ID ); - } - } - - msg_respond(i_msgQ, msg); - } - break; - default: - msg->data[1] = -EINVAL; - msg_respond(i_msgQ, msg); - } - } -} - - -/** -* Helper function to start the messge handler -*/ -void* msg_handler(msg_q_t i_msgQ) -{ - msgHandler(i_msgQ); - return NULL; -} - void* call_host_start_payload (void *io_pArgs) { - errlHndl_t l_errl = nullptr; + errlHndl_t l_errl = NULL; IStepError l_StepError; TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_host_start_payload entry" ); - do{ + // Place a separator in the TPM to indicate we are passing control + // to the next level of firmware in the stack + l_errl = TRUSTEDBOOT::pcrExtendSeparator(); - // Place a separator in the TPM to indicate we are passing control - // to the next level of firmware in the stack - l_errl = TRUSTEDBOOT::pcrExtendSeparator(); + // For single-node systems, the non-master processors can be in a + // different logical (powerbus) group. Need to migrate task to master. + task_affinity_pin(); + task_affinity_migrate_to_master(); - if(l_errl) - { - break; - } + uint64_t this_node = PIR_t(task_getcpuid()).groupId; - msg_q_t l_msgQ = msg_q_create(); - - // Register event to be called on shutdown - INITSERVICE::registerShutdownEvent(l_msgQ, - MSG_PRE_SHUTDOWN_INITS, - INITSERVICE::PRESHUTDOWN_INIT_PRIORITY); - - // Create a task to handle the messages - task_create(ISTEP_21::msg_handler, l_msgQ); - - // For single-node systems, the non-master processors can be in a - // different logical (powerbus) group. Need to migrate task to master. - task_affinity_pin(); - task_affinity_migrate_to_master(); - - uint64_t this_node = PIR_t(task_getcpuid()).groupId; - - task_affinity_unpin(); + task_affinity_unpin(); #ifdef CONFIG_BMC_IPMI - // TODO ISSUE 118082 - // ENABLE CODE BELOW ONCE OPAL COMPLETES ipmi WATCHDOG + // TODO ISSUE 118082 + // ENABLE CODE BELOW ONCE OPAL COMPLETES ipmi WATCHDOG #if 0 - //run the ipmi watchdog for a longer period to transition - // to opel - errlHndl_t err_ipmi = IPMIWATCHDOG::setWatchDogTimer( - IPMIWATCHDOG::DEFAULT_HB_OPAL_TRANSITION_COUNTDOWN); + //run the ipmi watchdog for a longer period to transition + // to opel + errlHndl_t err_ipmi = IPMIWATCHDOG::setWatchDogTimer( + IPMIWATCHDOG::DEFAULT_HB_OPAL_TRANSITION_COUNTDOWN); - if(err_ipmi) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "init: ERROR: Set IPMI watchdog Failed"); - err_ipmi->collectTrace("ISTEPS_TRACE",256); - errlCommit(err_ipmi, ISTEP_COMP_ID ); + if(err_ipmi) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "init: ERROR: Set IPMI watchdog Failed"); + err_ipmi->collectTrace("ISTEPS_TRACE",256); + errlCommit(err_ipmi, ISTEP_COMP_ID ); - } + } #endif - // TODO ISSUE 118082 - // REMOVE CODE BELOW ONCE OPAL COMPLETES IPMI WATCHDOG - // THE CODE BELOW STOPS THE IPMI TIMER FROM RUNNING - // TO PREVENT IT GETTING TRIGGERED DURING HB_OPAL TRANSITION + // TODO ISSUE 118082 + // REMOVE CODE BELOW ONCE OPAL COMPLETES IPMI WATCHDOG + // THE CODE BELOW STOPS THE IPMI TIMER FROM RUNNING + // TO PREVENT IT GETTING TRIGGERED DURING HB_OPAL TRANSITION - // Call setWatchdogTimer without the default DON'T STOP - // flag to stop the watchdog timer - errlHndl_t err_ipmi = IPMIWATCHDOG::setWatchDogTimer( - IPMIWATCHDOG::DEFAULT_HB_OPAL_TRANSITION_COUNTDOWN, - IPMIWATCHDOG::BIOS_FRB2); + // Call setWatchdogTimer without the default DON'T STOP + // flag to stop the watchdog timer + errlHndl_t err_ipmi = IPMIWATCHDOG::setWatchDogTimer( + IPMIWATCHDOG::DEFAULT_HB_OPAL_TRANSITION_COUNTDOWN, + IPMIWATCHDOG::BIOS_FRB2); - if(err_ipmi) - { - TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "init: ERROR: Set IPMI watchdog Failed"); - err_ipmi->collectTrace("ISTEPS_TRACE",256); - errlCommit(err_ipmi, ISTEP_COMP_ID ); - } + if(err_ipmi) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "init: ERROR: Set IPMI watchdog Failed"); + err_ipmi->collectTrace("ISTEPS_TRACE",256); + errlCommit(err_ipmi, ISTEP_COMP_ID ); + + } #endif - // broadcast shutdown to other HB instances. - l_errl = broadcastShutdown(this_node); + // broadcast shutdown to other HB instances. + l_errl = broadcastShutdown(this_node); - if(l_errl) - { - break; - } + if( l_errl == NULL) + { // - Run CXX testcases l_errl = INITSERVICE::executeUnitTests(); - - if(l_errl) - { - break; - } - + } #ifdef CONFIG_DRTM_TRIGGERING + + if(l_errl == nullptr) + { bool drtmMpipl = false; SECUREBOOT::DRTM::isDrtmMpipl(drtmMpipl); if(!drtmMpipl) @@ -306,29 +226,27 @@ void* call_host_start_payload (void *io_pArgs) TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ERR_MRK "call_host_start_payload: Failed in call to " "initiateDrtm()"); - break; } } } + } + #endif + if( l_errl == NULL ) + { l_errl = disableSpecialWakeup(); - if(l_errl) - { - break; - } + } + if( l_errl == NULL ) + { // - Call shutdown using payload base, and payload entry. // - base/entry will be from system attributes // - this will start the payload (Phyp) // NOTE: this call will not return if successful. l_errl = callShutdown(this_node, true); - if(l_errl) - { - break; - } - }while(0); + }; if( l_errl ) { @@ -356,7 +274,7 @@ void* call_host_start_payload (void *io_pArgs) errlHndl_t callShutdown ( uint64_t i_masterInstance, bool i_isMaster) { - errlHndl_t err = nullptr; + errlHndl_t err = NULL; uint64_t payloadBase = 0x0; uint64_t payloadEntry = 0x0; uint64_t payloadData = 0x0; @@ -401,10 +319,10 @@ errlHndl_t callShutdown ( uint64_t i_masterInstance, // Get Target Service, and the system target. TargetService& tS = targetService(); - TARGETING::Target* sys = nullptr; + TARGETING::Target* sys = NULL; (void) tS.getTopLevelTarget( sys ); - if( nullptr == sys ) + if( NULL == sys ) { // Error getting system target to get payload related values. We // will create an error to be passed back. This will cause the @@ -486,10 +404,10 @@ errlHndl_t callShutdown ( uint64_t i_masterInstance, errlHndl_t broadcastShutdown ( uint64_t i_hbInstance ) { - errlHndl_t err = nullptr; - TARGETING::Target * sys = nullptr; + errlHndl_t err = NULL; + TARGETING::Target * sys = NULL; TARGETING::targetService().getTopLevelTarget( sys ); - assert(sys != nullptr); + assert(sys != NULL); TARGETING::ATTR_HB_EXISTING_IMAGE_type hb_images = sys->getAttr<TARGETING::ATTR_HB_EXISTING_IMAGE>(); @@ -585,7 +503,7 @@ errlHndl_t broadcastShutdown ( uint64_t i_hbInstance ) errlHndl_t disableSpecialWakeup() { - errlHndl_t l_errl = nullptr; + errlHndl_t l_errl = NULL; TargetHandleList l_cores; getAllChiplets(l_cores, TYPE_CORE); @@ -634,7 +552,7 @@ errlHndl_t disableSpecialWakeup() */ errlHndl_t enableCoreCheckstops() { - errlHndl_t l_errl = nullptr; + errlHndl_t l_errl = NULL; //@TODO RTC:133848 #if 0 void* l_slwPtr = NULL; @@ -799,12 +717,12 @@ errlHndl_t enableCoreCheckstops() * @brief This function will clear the PORE BARs. Needs to be done * depending on payload type * - * @return errlHndl_t - nullptr if successful, otherwise a pointer to the error + * @return errlHndl_t - NULL if successful, otherwise a pointer to the error * log. */ errlHndl_t clearPoreBars ( void ) { - errlHndl_t l_errl = nullptr; + errlHndl_t l_errl = NULL; TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "set PORE bars back to 0" ); @@ -872,7 +790,7 @@ errlHndl_t clearPoreBars ( void ) errlHndl_t notifyFsp ( bool i_istepModeFlag, TARGETING::SpFunctions i_spFuncs ) { - errlHndl_t err = nullptr; + errlHndl_t err = NULL; TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, ENTER_MRK"notifyFsp()" ); diff --git a/src/usr/isteps/istep21/makefile b/src/usr/isteps/istep21/makefile index 348756343..8601669d8 100644 --- a/src/usr/isteps/istep21/makefile +++ b/src/usr/isteps/istep21/makefile @@ -26,7 +26,6 @@ ROOTPATH = ../../../.. MODULE = istep21 EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/ -EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/initfiles/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/ EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/ |