Skip to content

Commit

Permalink
sbe_retry_handler refactor
Browse files Browse the repository at this point in the history
Previously the sbe_retry_handler had logic and wording that
assumed that it was being used to tell if the slave sbe booted or not.
However this code has many more use cases then that. Also there was some
indirect recursion that made the code hard to follow. With this refactor
the code should be easier to follow and the vocabulary used should be more
generic.

Change-Id: If6520197b3dd561857e336ed89d9356c1f2601d6
CQ: SW416106
RTC: 167191
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55896
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>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Apr 6, 2018
1 parent 02f8995 commit ba8c8bf
Show file tree
Hide file tree
Showing 12 changed files with 1,006 additions and 808 deletions.
235 changes: 143 additions & 92 deletions src/include/usr/sbeio/sbe_retry_handler.H

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/include/usr/sbeio/sbeioreasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ enum sbeioReasonCode
SBEIO_RETURNED_FFDC = SBEIO_COMP_ID | 0x57,
SBEIO_SLAVE_TIMEOUT = SBEIO_COMP_ID | 0x58,
SBEIO_ATTEMPTING_REBOOT = SBEIO_COMP_ID | 0x59,
SBEIO_UNSUPPORTED_REQUEST = SBEIO_COMP_ID | 0x5A,
SBEIO_MORE_FFDC_THAN_EXPECTED = SBEIO_COMP_ID | 0x5B,
SBEIO_EXCEED_MAX_SIDE_SWITCHES = SBEIO_COMP_ID | 0x5C,
SBEIO_EXCEED_MAX_SIDE_BOOTS = SBEIO_COMP_ID | 0x5D,

// SBE Vital Attention error codes
SBEIO_SBE_RC_VALUE_INFO = SBEIO_COMP_ID | 0x60,
Expand Down
40 changes: 14 additions & 26 deletions src/usr/isteps/istep08/call_proc_check_slave_sbe_seeprom_complete.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -129,13 +129,24 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs )
" on processor target %.8X",
TARGETING::get_huid(l_cpu_target));

//Note no PLID passed in
SBEIO::SbeRetryHandler l_SBEobj = SBEIO::SbeRetryHandler(
SBEIO::SbeRetryHandler::SBE_MODE_OF_OPERATION::ATTEMPT_REBOOT);

l_SBEobj.setSbeRestartMethod(SBEIO::SbeRetryHandler::
SBE_RESTART_METHOD::START_CBS);

// We want to tell the retry handler that we have just powered
// on the sbe, to distinguish this case from other cases where
// we have determine there is something wrong w/ the sbe and
// want to diagnose the problem
l_SBEobj.setInitialPowerOn(true);

l_SBEobj.main_sbe_handler(l_cpu_target);

// No error and still functional
if(l_cpu_target->getAttr<ATTR_HWAS_STATE>().functional)
// We will judge whether or not the SBE had a succesful
// boot or not depending on if it made it to runtime or not
if(l_SBEobj.isSbeAtRuntime())
{
// Set attribute indicating that SBE is started
l_cpu_target->setAttr<ATTR_SBE_IS_STARTED>(1);
Expand Down Expand Up @@ -173,29 +184,6 @@ void* call_proc_check_slave_sbe_seeprom_complete( void *io_pArgs )
"Running p9_extract_sbe_rc HWP"
" on processor target %.8X",
TARGETING::get_huid(l_cpu_target) );
//@TODO-RTC:100963-Do something with the RETURN_ACTION
P9_EXTRACT_SBE_RC::RETURN_ACTION l_rcAction
= P9_EXTRACT_SBE_RC::RE_IPL;
FAPI_INVOKE_HWP(l_errl, p9_extract_sbe_rc,
l_fapi2ProcTarget,
l_rcAction);
if (l_errl)
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
"ERROR : proc_check_slave_sbe_seeprom_complete "
"failed, p9_extract_sbe_rc HWP returning errorlog PLID=0x%x",
l_errl->plid());
// capture the target data in the elog
ErrlUserDetailsTarget(l_cpu_target).addToLog( l_errl );
// Create IStep error log and cross reference to error that occurred
l_stepError.addErrorDetails( l_errl );
// Commit error log
errlCommit( l_errl, HWPF_COMP_ID );
}
**/
} // end of going through all processors

Expand Down
3 changes: 1 addition & 2 deletions src/usr/isteps/istep08/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,2017
# Contributors Listed Below - COPYRIGHT 2015,2018
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -74,7 +74,6 @@ include ${PROCEDURES_PATH}/hwp/perv/p9_start_cbs.mk

# proc_check_slave_sbe_seeprom_complete : Check Slave SBE Complete
include ${PROCEDURES_PATH}/hwp/perv/p9_check_slave_sbe_seeprom_complete.mk
include ${PROCEDURES_PATH}/hwp/sbe/p9_get_sbe_msg_register.mk
include ${PROCEDURES_PATH}/hwp/perv/p9_getecid.mk

# host_p9_fbc_eff_config
Expand Down
30 changes: 28 additions & 2 deletions src/usr/sbeio/common/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,31 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
SBEIO_COMMON_OBJS += sbe_attn.o
SBEIO_COMMON_OBJS += sbe_retry_handler.o

#Common .mk files to include
include ${ROOTPATH}/procedure.rules.mk
include ${ROOTPATH}/src/import/chips/p9/procedures/hwp/sbe/p9_get_sbe_msg_register.mk
include ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/p9_start_cbs.mk

#Common Include Paths
EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/ffdc
EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/perv
EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/lib
EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/sbe
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}/src/import/chips/common/utils/imageProcs

#Common Objects
OBJS += p9_extract_sbe_rc.o
OBJS += p9_ppe_common.o
OBJS += sbe_attn.o
OBJS += sbe_retry_handler.o

#Common VPATHs
VPATH += ${ROOTPATH}/src/usr/sbeio/common
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/sbe/
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/lib/
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/
42 changes: 4 additions & 38 deletions src/usr/sbeio/common/sbe_attn.C
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ namespace SBEIO
TARGETING::get_huid(i_procTarg) );
errlHndl_t l_errhdl = nullptr;

uint32_t l_sbePlid = getSbeRC(i_procTarg);

TRACFCOMP( g_trac_sbeio, "handleVitalAttn> Returned SBE PLID=0x%x",
l_sbePlid);

// TODO 167191 Full SBE Belly-Up Handling for OP
#ifdef __HOSTBOOT_RUNTIME
// Inform OPAL, SBE is currently disabled
if (TARGETING::is_sapphire_load())
Expand All @@ -74,16 +70,13 @@ namespace SBEIO

SbeRetryHandler l_sbeObj = SbeRetryHandler(
SbeRetryHandler::SBE_MODE_OF_OPERATION::ATTEMPT_REBOOT);
// @todo - RTC:180242. Once the hreset method is finalized,
// we can call the sbe handler with that method
//l_sbeObj.setSbeRestartMethod(SbeRetryHandler::
// SBE_RESTART_METHOD::HRESET);

l_sbeObj.main_sbe_handler(i_procTarg);
//l_sbeObj.main_sbe_handler(i_procTarg);


#ifdef __HOSTBOOT_RUNTIME
// Inform OPAL the state of the SBE after a retry
if (l_sbeObj.getSbeRestart())
if (l_sbeObj.isSbeAtRuntime())
{
if (TARGETING::is_sapphire_load())
{
Expand All @@ -100,31 +93,4 @@ namespace SBEIO
return l_errhdl;
}

uint32_t getSbeRC(TARGETING::Target* i_target)
{
TRACFCOMP( g_trac_sbeio, ENTER_MRK "getSbeRC()");

errlHndl_t l_errl = nullptr;

uint32_t l_errlPlid = NULL;
const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> l_fapi2ProcTarget(
const_cast<TARGETING::Target*> (i_target));

P9_EXTRACT_SBE_RC::RETURN_ACTION l_ret =
P9_EXTRACT_SBE_RC::REIPL_UPD_SEEPROM;
FAPI_INVOKE_HWP(l_errl, p9_extract_sbe_rc,
l_fapi2ProcTarget, l_ret);

if(l_errl)
{
TRACFCOMP(g_trac_sbeio, "ERROR: p9_extract_sbe_rc HWP returning "
"errorlog PLID: 0x%x", l_errl->plid());

ERRORLOG::ErrlUserDetailsTarget(i_target).addToLog(l_errl);
l_errlPlid = l_errl->plid();
}

return l_errlPlid;
}

};

0 comments on commit ba8c8bf

Please sign in to comment.