diff options
author | Marty Gloff <mgloff@us.ibm.com> | 2017-01-17 10:22:08 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-02-10 17:53:03 -0500 |
commit | b00bd99484f2ec6e16e51705d124b52c13a39e37 (patch) | |
tree | 6dc80f58050f6e4f371f1b0480ca395ff910c232 /src | |
parent | 1be6c479bcf84d858260ab64ea9ed46d6633ffbb (diff) | |
download | blackbird-hostboot-b00bd99484f2ec6e16e51705d124b52c13a39e37.tar.gz blackbird-hostboot-b00bd99484f2ec6e16e51705d124b52c13a39e37.zip |
Quiesce SBE before writing SEEPROM
Call sendPsuQuiesceSbe before doing the deviceWrite of the SBE SEEPROM
with the SBE image.
Change-Id: I6d3cec5b0430b8083acabc30bb7ff14ba5e1b56e
RTC:158899
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34994
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/sbeio/sbe_psudd.H | 14 | ||||
-rw-r--r-- | src/include/usr/sbeio/sbeioif.H | 14 | ||||
-rw-r--r-- | src/include/usr/sbeio/sbeioreasoncodes.H | 2 | ||||
-rw-r--r-- | src/usr/sbe/sbe_update.C | 21 | ||||
-rw-r--r-- | src/usr/sbe/sbe_update.H | 2 | ||||
-rw-r--r-- | src/usr/sbe/test/sbeupdatetest.H | 6 | ||||
-rw-r--r-- | src/usr/sbeio/sbe_coreStateControl.C | 17 | ||||
-rw-r--r-- | src/usr/sbeio/sbe_psuQuiesce.C | 21 | ||||
-rw-r--r-- | src/usr/sbeio/sbe_psudd.C | 25 | ||||
-rw-r--r-- | src/usr/sbeio/sbe_systemConfig.C | 10 | ||||
-rw-r--r-- | src/usr/scan/scandd.C | 7 |
11 files changed, 93 insertions, 46 deletions
diff --git a/src/include/usr/sbeio/sbe_psudd.H b/src/include/usr/sbeio/sbe_psudd.H index c16a3baa2..2ad545f5f 100644 --- a/src/include/usr/sbeio/sbe_psudd.H +++ b/src/include/usr/sbeio/sbe_psudd.H @@ -440,19 +440,21 @@ class SbePsu }; /** - * @Brief perform SBE PSU chip-op + * @brief perform SBE PSU chip-op * + * @param[in] i_target Proc target to use for PSU Request * @param[in] i_pPsuRequest Pointer to PSU request commands * @param[out] o_pPsuResponse Pointer to PSU response * @param[in] i_timeout Time out for response * @param[in] i_reqMsgs 4 bit mask telling which regs to write * @param[in] i_rspMsgs 4 bit mask telling which regs to read */ - errlHndl_t performPsuChipOp(psuCommand * i_pPsuCommand, - psuResponse * o_pPsuResponse, - const uint64_t i_timeout, - uint8_t i_reqMsgs, - uint8_t i_rspMsgs); + errlHndl_t performPsuChipOp(TARGETING::Target * i_target, + psuCommand * i_pPsuRequest, + psuResponse * o_pPsuResponse, + const uint64_t i_timeout, + uint8_t i_reqMsgs, + uint8_t i_rspMsgs); protected: diff --git a/src/include/usr/sbeio/sbeioif.H b/src/include/usr/sbeio/sbeioif.H index 0a94caae3..3c014df48 100644 --- a/src/include/usr/sbeio/sbeioif.H +++ b/src/include/usr/sbeio/sbeioif.H @@ -62,12 +62,14 @@ namespace SBEIO errlHndl_t sendSystemConfig(const uint64_t i_systemConfig ); /** - * @brief Sends a PSU chipOp to quiesce the SBE - * - * @return errlHndl_t Error log handle on failure. - * - */ - errlHndl_t sendPsuQueisceSbeCmd (); + * @brief Sends a PSU chipOp to quiesce the SBE + * + * @param[in] i_target Target with SBE to quiesce + * + * @return errlHndl_t Error log handle on failure. + * + */ + errlHndl_t sendPsuQuiesceSbe(TARGETING::Target * i_target); /** * @brief Get SCOM via SBE FIFO diff --git a/src/include/usr/sbeio/sbeioreasoncodes.H b/src/include/usr/sbeio/sbeioreasoncodes.H index abd9540ca..7294a45c3 100644 --- a/src/include/usr/sbeio/sbeioreasoncodes.H +++ b/src/include/usr/sbeio/sbeioreasoncodes.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* Contributors Listed Below - COPYRIGHT 2013,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C index c85d9e7e4..5f2617559 100644 --- a/src/usr/sbe/sbe_update.C +++ b/src/usr/sbe/sbe_update.C @@ -50,6 +50,7 @@ #include <console/consoleif.H> #include <config.h> #include <sbe/sbeif.H> +#include <sbeio/sbeioif.H> #include <sbe/sbereasoncodes.H> #include "sbe_update.H" #include "sbe_resolve_sides.H" @@ -2598,6 +2599,26 @@ namespace SBE reinterpret_cast<void*>(SBE_ECC_IMG_VADDR), 0x80); + //Quiesce the SBE before writing current SBE + if ( ( ( io_sbeState.seeprom_side_to_update == EEPROM::SBE_PRIMARY ) + && + ( io_sbeState.cur_seeprom_side == SBE_SEEPROM0 ) ) + || + ( ( io_sbeState.seeprom_side_to_update == EEPROM::SBE_BACKUP ) + && + ( io_sbeState.cur_seeprom_side == SBE_SEEPROM1 ) ) ) + { + err = SBEIO::sendPsuQuiesceSbe(io_sbeState.target); + + if(err) + { + TRACFCOMP( g_trac_sbe, ERR_MRK"updateSeepromSide() - Error " + "quiescing SBE. RC=0x%X, PLID=0x%lX", + ERRL_GETRC_SAFE(err), ERRL_GETPLID_SAFE(err)); + break; + } + } + //Write new data to seeprom TRACFCOMP( g_trac_sbe, INFO_MRK"updateSeepromSide(): Write New " "SBE Image for Target 0x%X to Seeprom %d", diff --git a/src/usr/sbe/sbe_update.H b/src/usr/sbe/sbe_update.H index 7bea0e3c6..7b86bd3b7 100644 --- a/src/usr/sbe/sbe_update.H +++ b/src/usr/sbe/sbe_update.H @@ -159,7 +159,7 @@ namespace SBE enum sbeSeepromSide_t { SBE_SEEPROM0 = 0x00, // corresponds to EEPROM::SBE_PRIMARY - SBE_SEEPROM1 = 0x01, // corresponts to EEPROM::SBE_BACKUP + SBE_SEEPROM1 = 0x01, // corresponds to EEPROM::SBE_BACKUP SBE_SEEPROM_INVALID = 0xFF, }; diff --git a/src/usr/sbe/test/sbeupdatetest.H b/src/usr/sbe/test/sbeupdatetest.H index 22eb42646..7fd5295f6 100644 --- a/src/usr/sbe/test/sbeupdatetest.H +++ b/src/usr/sbe/test/sbeupdatetest.H @@ -858,7 +858,7 @@ class SBEUpdateTest: public CxxTest::TestSuite } total++; -// err = performUpdateActions(sbeState); @TODO RTC:158899 Seem to need to quiesce SBE before updating + err = performUpdateActions(sbeState); if(err) { fails++; @@ -867,7 +867,7 @@ class SBEUpdateTest: public CxxTest::TestSuite } // Make sure MVPD and SBE were updated -/* if ( ! ( ( sbeState.update_actions & MVPD_UPDATE_COMPLETE ) && + if ( ! ( ( sbeState.update_actions & MVPD_UPDATE_COMPLETE ) && ( sbeState.update_actions & SBE_UPDATE_COMPLETE ) ) ) { TRACFCOMP( g_trac_sbe, ERR_MRK"testSbeUpdateTarget(): " @@ -876,7 +876,7 @@ class SBEUpdateTest: public CxxTest::TestSuite fails++; TS_FAIL("testSbeUpdateTarget() - performUpdateActions() did not complete actions"); break; - } @TODO RTC:158899 Seem to need to quiesce SBE before updating */ + } }while(0); diff --git a/src/usr/sbeio/sbe_coreStateControl.C b/src/usr/sbeio/sbe_coreStateControl.C index b449d6516..6c102d755 100644 --- a/src/usr/sbeio/sbe_coreStateControl.C +++ b/src/usr/sbeio/sbe_coreStateControl.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -32,6 +32,7 @@ #include <errl/errlmanager.H> #include <sbeio/sbeioif.H> #include <sbeio/sbe_psudd.H> +#include <targeting/common/targetservice.H> extern trace_desc_t* g_trac_sbeio; @@ -59,6 +60,10 @@ errlHndl_t startDeadmanLoop(const uint64_t i_waitTime ) SBE_TRACD(ENTER_MRK "startDeadmanLoop waitTime=0x%x",i_waitTime); + // Find master proc for target of PSU command + TARGETING::Target * l_master = nullptr; + (void)TARGETING::targetService().masterProcChipTargetHandle(l_master); + SbePsu::psuCommand l_psuCommand( SbePsu::SBE_DMCONTROL_START | SbePsu::SBE_DMCONTROL_RESPONSE_REQUIRED, //control flags @@ -69,7 +74,8 @@ errlHndl_t startDeadmanLoop(const uint64_t i_waitTime ) // set up PSU command message l_psuCommand.cd1_ControlDeadmanLoop_WaitTime = i_waitTime; - errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(&l_psuCommand, + errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(l_master, + &l_psuCommand, &l_psuResponse, SbePsu::MAX_PSU_SHORT_TIMEOUT_NS, SbePsu::SBE_DMCONTROL_START_REQ_USED_REGS, @@ -94,6 +100,10 @@ errlHndl_t stopDeadmanLoop() SBE_TRACD(ENTER_MRK "stopDeadmanLoop"); + // Find master proc for target of PSU command + TARGETING::Target * l_master = nullptr; + (void)TARGETING::targetService().masterProcChipTargetHandle(l_master); + SbePsu::psuCommand l_psuCommand( SbePsu::SBE_DMCONTROL_STOP + SbePsu::SBE_DMCONTROL_RESPONSE_REQUIRED, //control flags @@ -101,7 +111,8 @@ errlHndl_t stopDeadmanLoop() SbePsu::SBE_CMD_CONTROL_DEADMAN_LOOP); //comand SbePsu::psuResponse l_psuResponse; - errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(&l_psuCommand, + errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(l_master, + &l_psuCommand, &l_psuResponse, SbePsu::MAX_PSU_SHORT_TIMEOUT_NS, SbePsu::SBE_DMCONTROL_STOP_REQ_USED_REGS, diff --git a/src/usr/sbeio/sbe_psuQuiesce.C b/src/usr/sbeio/sbe_psuQuiesce.C index 60ae012bb..906615157 100644 --- a/src/usr/sbeio/sbe_psuQuiesce.C +++ b/src/usr/sbeio/sbe_psuQuiesce.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -45,12 +45,14 @@ namespace SBEIO { /** - * @brief Sends a PSU chipOp to quiesce the SBE - * - * @return errlHndl_t Error log handle on failure. - * - */ - errlHndl_t psuQuiesce( ) + * @brief Sends a PSU chipOp to quiesce the SBE + * + * @param[in] i_target Target with SBE to quiesce + * + * @return errlHndl_t Error log handle on failure. + * + */ + errlHndl_t sendPsuQuiesceSbe(TARGETING::Target * i_target) { errlHndl_t errl = NULL; @@ -64,13 +66,14 @@ namespace SBEIO SbePsu::psuResponse l_psuResponse; - errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(&l_psuCommand, + errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(i_target, + &l_psuCommand, &l_psuResponse, SbePsu::MAX_PSU_SHORT_TIMEOUT_NS, SbePsu::SBE_QUIESCE_REQ_USED_REGS, SbePsu::SBE_QUIESCE_RSP_USED_REGS); - SBE_TRACD(EXIT_MRK "psuQuiesce"); + SBE_TRACD(EXIT_MRK "sendPsuQuiesceSbe"); return errl; }; diff --git a/src/usr/sbeio/sbe_psudd.C b/src/usr/sbeio/sbe_psudd.C index 7f1bdd7be..e6cd88a9d 100644 --- a/src/usr/sbeio/sbe_psudd.C +++ b/src/usr/sbeio/sbe_psudd.C @@ -35,7 +35,6 @@ #include <errl/errlmanager.H> #include <errl/errludtarget.H> #include <targeting/common/target.H> -#include <targeting/common/targetservice.H> #include <errl/errlreasoncodes.H> #include <sbeio/sbeioreasoncodes.H> #include <initservice/initserviceif.H> //@todo-RTC:149454-Remove @@ -111,21 +110,22 @@ SbePsu::~SbePsu() /** * @brief perform SBE PSU chip-op * + * @param[in] i_target Proc target to use for PSU Request * @param[in] i_pPsuRequest Pointer to PSU request commands * @param[out] o_pPsuResponse Pointer to PSU response * @param[in] i_timeout Time out for response * @param[in] i_reqMsgs 4 bit mask telling which regs to write * @param[in] i_rspMsgs 4 bit mask telling which regs to read */ -errlHndl_t SbePsu::performPsuChipOp(psuCommand * i_pPsuRequest, - psuResponse * o_pPsuResponse, - const uint64_t i_timeout, - uint8_t i_reqMsgs, - uint8_t i_rspMsgs) +errlHndl_t SbePsu::performPsuChipOp(TARGETING::Target * i_target, + psuCommand * i_pPsuRequest, + psuResponse * o_pPsuResponse, + const uint64_t i_timeout, + uint8_t i_reqMsgs, + uint8_t i_rspMsgs) { errlHndl_t errl = NULL; - TARGETING::Target * l_target = NULL; static mutex_t l_psuOpMux = MUTEX_INITIALIZER; SBE_TRACD(ENTER_MRK "performPsuChipOp"); @@ -133,14 +133,13 @@ errlHndl_t SbePsu::performPsuChipOp(psuCommand * i_pPsuRequest, //Serialize access to PSU mutex_lock(&l_psuOpMux); - //Use master proc for SBE PSU access - (void)TARGETING::targetService().masterProcChipTargetHandle(l_target); - assert(l_target,"performPsuChipOp: master proc target is NULL"); + // Check that target is not NULL + assert(i_target != nullptr,"performPsuChipOp: proc target is NULL"); do { // write PSU Request - errl = writeRequest(l_target, + errl = writeRequest(i_target, i_pPsuRequest, i_reqMsgs); if (errl)//error has been generated @@ -151,7 +150,7 @@ errlHndl_t SbePsu::performPsuChipOp(psuCommand * i_pPsuRequest, } // read PSU response and check results - errl = readResponse(l_target, + errl = readResponse(i_target, i_pPsuRequest, o_pPsuResponse, i_timeout, @@ -194,7 +193,7 @@ errlHndl_t SbePsu::performPsuChipOp(psuCommand * i_pPsuRequest, orig_plid, TWO_UINT32_TO_UINT64(orig_rc,orig_mod)); MAGIC_INST_GET_SBE_TRACES( - l_target->getAttr<TARGETING::ATTR_POSITION>(), + i_target->getAttr<TARGETING::ATTR_POSITION>(), SBEIO_HWSV_COLLECT_SBE_RC); INITSERVICE::doShutdown( SBEIO_HWSV_COLLECT_SBE_RC ); } diff --git a/src/usr/sbeio/sbe_systemConfig.C b/src/usr/sbeio/sbe_systemConfig.C index 16d11624a..817a181f6 100644 --- a/src/usr/sbeio/sbe_systemConfig.C +++ b/src/usr/sbeio/sbe_systemConfig.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -33,6 +33,7 @@ #include <errl/errlmanager.H> #include <sbeio/sbeioif.H> #include <sbeio/sbe_psudd.H> +#include <targeting/common/targetservice.H> extern trace_desc_t* g_trac_sbeio; @@ -63,6 +64,10 @@ namespace SBEIO SBE_TRACD(ENTER_MRK "sending system configuration from HB -> SBE i_systemConfig=0x%x",i_systemConfig); + // Find master proc for target of PSU command + TARGETING::Target * l_master = nullptr; + (void)TARGETING::targetService().masterProcChipTargetHandle(l_master); + SbePsu::psuCommand l_psuCommand( SbePsu::SBE_REQUIRE_RESPONSE, //control flags SbePsu::SBE_PSU_GENERIC_MESSAGE, //command class @@ -72,7 +77,8 @@ namespace SBEIO // set up PSU command message l_psuCommand.cd2_SetSystemConfig_SystemFabricIdMap = i_systemConfig; - errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(&l_psuCommand, + errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(l_master, + &l_psuCommand, &l_psuResponse, SbePsu::MAX_PSU_SHORT_TIMEOUT_NS, SbePsu::SBE_SYSTEM_CONFIG_REQ_USED_REGS, diff --git a/src/usr/scan/scandd.C b/src/usr/scan/scandd.C index b12befb22..3b62a0c57 100644 --- a/src/usr/scan/scandd.C +++ b/src/usr/scan/scandd.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -317,11 +317,14 @@ errlHndl_t sbeScanPerformOp(TARGETING::Target * i_target, va_list i_args) ":: sbeScanPerformOp() RingMode:%.8X ", l_psuCommand.cd3_PutRing_RingMode ); - l_errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(&l_psuCommand, + /* + l_errl = SBEIO::SbePsu::getTheInstance().performPsuChipOp(nullptr, + &l_psuCommand, &l_psuResponse, SbePsu::MAX_PSU_SHORT_TIMEOUT_NS, SbePsu::SBE_DMCONTROL_START_REQ_USED_REGS, SbePsu::SBE_DMCONTROL_START_RSP_USED_REGS); + */ TRACFCOMP( g_trac_scandd, EXIT_MRK "exiting :: sbeScanPerformOp()"); |