Skip to content

Commit

Permalink
Initialize and test alt-master PNOR access in all boots
Browse files Browse the repository at this point in the history
   - Update to istep 10 (call_host_slave_sbe_update) to validate
     the alternate master pnor chip in all boots (no-op for systems
     with only one pnor chip)

   - Updates to pnor callout logic to callout as a PNOR part for
     several of the error paths

Change-Id: I9218f9a14496444288ea7985e1fb080c25f7f201
RTC: 200449
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71489
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>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
wghoffa authored and dcrowell77 committed Mar 1, 2019
1 parent 877a032 commit 7364f24
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 44 deletions.
19 changes: 12 additions & 7 deletions src/include/usr/errl/errlentry.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -508,14 +508,19 @@ public:
void removeDuplicateTraces(void);

/**
* @brief Remove the back trace user detail data
* When an error log is constructed, the back trace is automatically
* captured. This function removes the backtrace. This should be used when
* a caller knows that the backtrace is of no use and wants to limit the
* size of the error log.
*/
* @brief Remove the back trace user detail data
* When an error log is constructed, the back trace is automatically
* captured. This function removes the backtrace. This should be used when
* a caller knows that the backtrace is of no use and wants to limit the
* size of the error log.
*/
void removeBackTrace();

/**
* @brief remove all deconfigure elements from an errorlog
*/
void removeDeconfigure(void);

/**
* @brief Add a clock callout.
* The i_target is used to identify the actual clock to callout because
Expand Down
29 changes: 28 additions & 1 deletion src/usr/errl/errlentry.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -2004,6 +2004,33 @@ std::vector<void*> ErrlEntry::getUDSections(compId_t i_compId,
return copy_vector;
}

void ErrlEntry::removeDeconfigure()
{
//Loop through each section of the errorlog
for(auto & section : iv_SectionVector)
{
if (section->compId() == ERRL_COMP_ID && section->subSect() == ERRORLOG::ERRL_UDT_CALLOUT)
{
//Looking at hwasCallout.H only the HW, CLOCK, and PART Callouts have deconfigure entries,
// so only update those to ensure the ErrorType is GARD_NULL
if (reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->type == HWAS::HW_CALLOUT)
{
reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->gardErrorType = HWAS::GARD_NULL;
reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->deconfigState = HWAS::NO_DECONFIG;
}
else if (reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->type == HWAS::CLOCK_CALLOUT)
{
reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->clkGardErrorType = HWAS::GARD_NULL;
reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->clkDeconfigState = HWAS::NO_DECONFIG;
}
else if (reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->type == HWAS::PART_CALLOUT)
{
reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->partGardErrorType = HWAS::GARD_NULL;
reinterpret_cast<HWAS::callout_ud_t*>(section->iv_pData)->partDeconfigState = HWAS::NO_DECONFIG;
}
}
}
}

void ErrlEntry::removeDuplicateTraces()
{
Expand Down
73 changes: 55 additions & 18 deletions src/usr/isteps/istep10/call_host_slave_sbe_update.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
#include <sys/time.h>
#include <hwas/common/hwasCommon.H>

// fapi2 HWP invoker
#include <fapi2/plat_hwp_invoker.H>

#include <fapi2.H>
#include <p9_sbe_lpc_init.H>

// Easy macro replace for unit testing
//#define TRACUCOMP(args...) TRACFCOMP(args)
#define TRACUCOMP(args...)
Expand Down Expand Up @@ -286,37 +292,68 @@ void* call_host_slave_sbe_update (void *io_pArgs)

#endif

// Call to Validate any Alternative Master's connection to PNOR
// Only call this in MNFG mode
// Any error returned should not fail istep
// Run LPC Init on Alt Master Procs
// Get list of all processors
TARGETING::TargetHandleList l_procList;
TARGETING::getAllChips(l_procList,
TARGETING::TYPE_PROC,
true); // true: return functional targets

// Get target service and the system target
TargetService& tS = targetService();
TARGETING::Target* sys = NULL;
(void) tS.getTopLevelTarget( sys );
assert(sys, "call_host_slave_sbe_update() system target is NULL");

TARGETING::ATTR_MNFG_FLAGS_type mnfg_flags;
mnfg_flags = sys->getAttr<TARGETING::ATTR_MNFG_FLAGS>();
if ( mnfg_flags & MNFG_FLAG_THRESHOLDS )
// Loop through all processors
for (const auto & l_target : l_procList)
{
l_errl = PNOR::validateAltMaster();
if (l_errl)
// Check if processor is MASTER_CANDIDATE
TARGETING::ATTR_PROC_MASTER_TYPE_type type_enum =
l_target->getAttr<TARGETING::ATTR_PROC_MASTER_TYPE>();

if ( type_enum == TARGETING::PROC_MASTER_TYPE_MASTER_CANDIDATE )
{
// Commit error
errlCommit( l_errl, HWPF_COMP_ID );
break;
// Initialize the LPC Bus by calling the p9_sbe_lpc_init hwp
fapi2::Target <fapi2::TARGET_TYPE_PROC_CHIP> l_fapi_target (l_target);
FAPI_INVOKE_HWP(l_errl, p9_sbe_lpc_init, l_fapi_target);

if (l_errl)
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
INFO_MRK"PNOR::validateAltMaster> p9_sbe_lpc_init returns error, rc=0x%X",
l_errl->reasonCode());

// capture the target data in the elog
ErrlUserDetailsTarget(l_target).addToLog(l_errl);
//Remove any deconfigure information, we only need the PNOR Part callout and do not want
// to deconfigure the entire proc because of a PNOR part problem
l_errl->removeDeconfigure();
// Commit error
errlCommit( l_errl, HWPF_COMP_ID );
}
else
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"SUCCESS running p9_sbe_lpc_init HWP on "
"target HUID %.8X", TARGETING::get_huid(l_target));
}
}
}

// Call to Validate any Alternative Master's connection to PNOR
// Any error returned should not fail istep
l_errl = PNOR::validateAltMaster();
if (l_errl)
{
//Remove any deconfigure information, we only need the PNOR Part callout and do not want
// to deconfigure the entire proc because of a PNOR part problem
l_errl->removeDeconfigure();
// Commit error
errlCommit( l_errl, HWPF_COMP_ID );
}

// Set SEEPROM_VERSIONS_MATCH attributes for each processor
// this will be used later on by the sbe_retry code to determine
// if it is safe to switch seeprom sides during recovery attempts
l_errl = SBE::querySbeSeepromVersions();
if(l_errl)
{
l_StepError.addErrorDetails( l_errl);
l_StepError.addErrorDetails(l_errl);
errlCommit( l_errl, HWPF_COMP_ID);
}

Expand Down
1 change: 1 addition & 0 deletions src/usr/isteps/istep10/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ include ${INITFILES_HWP_PATH}/p9_fbc_cd_hp1_scom.mk
include ${INITFILES_HWP_PATH}/p9_fbc_cd_hp2_scom.mk
include ${INITFILES_HWP_PATH}/p9_fbc_cd_hp3_scom.mk
include ${PERV_HWP_PATH}/p9_update_security_ctrl.mk
include ${PERV_HWP_PATH}/p9_sbe_lpc_init.mk

# Note that p9_int_scom.mk is included in fapi2.mk for
# workaround reasons so we are not including it here
Expand Down
12 changes: 9 additions & 3 deletions src/usr/pnor/pnor_sfcdd.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -420,10 +420,16 @@ PnorSfcDD::PnorSfcDD( TARGETING::Target* i_target )

if( l_err )
{
TRACFCOMP( g_trac_pnor, "Failure to initialize the PNOR logic, shutting down :: RC=%.4X", ERRL_GETRC_SAFE(l_err) );
TRACFCOMP( g_trac_pnor, "Failure to initialize the PNOR logic :: RC=%.4X", ERRL_GETRC_SAFE(l_err) );
l_err->collectTrace(PNOR_COMP_NAME);
ERRORLOG::errlCommit(l_err,PNOR_COMP_ID);
INITSERVICE::doShutdown( PNOR::RC_PNOR_INIT_FAILURE );

//Only shutdown if this error occurs on the master proc
if (TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL == iv_target)
{
TRACFCOMP( g_trac_pnor, "PNOR Error on Master Proc, shutting down");
INITSERVICE::doShutdown( PNOR::RC_PNOR_INIT_FAILURE );
}
}

TRACFCOMP(g_trac_pnor, EXIT_MRK "PnorSfcDD::PnorSfcDD()" );
Expand Down
35 changes: 20 additions & 15 deletions src/usr/pnor/pnorvalid.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2014,2018 */
/* Contributors Listed Below - COPYRIGHT 2014,2019 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
Expand Down Expand Up @@ -191,6 +191,13 @@ errlHndl_t validateAltMaster( void )
TARGETING::get_huid(procList[i]), l_err->eid(),
l_err->reasonCode());

l_err->addPartCallout(
procList[i],
HWAS::PNOR_PART_TYPE,
HWAS::SRCI_PRIORITY_LOW,
HWAS::NO_DECONFIG,
HWAS::GARD_NULL);

l_err->collectTrace(PNOR_COMP_NAME);

// if there was an error, commit here and then proceed to
Expand All @@ -216,13 +223,12 @@ errlHndl_t validateAltMaster( void )
TARGETING::get_huid(procList[i]), l_err->eid(),
l_err->reasonCode());

// Limited in callout: no PNOR target, so calling out processor
l_err->addHwCallout(
procList[i],
HWAS::SRCI_PRIORITY_HIGH,
HWAS::NO_DECONFIG,
HWAS::GARD_NULL );

l_err->addPartCallout(
procList[i],
HWAS::PNOR_PART_TYPE,
HWAS::SRCI_PRIORITY_HIGH,
HWAS::NO_DECONFIG,
HWAS::GARD_NULL);

l_err->collectTrace(PNOR_COMP_NAME);

Expand Down Expand Up @@ -260,13 +266,12 @@ errlHndl_t validateAltMaster( void )
TARGETING::get_huid(procList[i]),
0);

// Limited in callout: no PNOR target, so calling out processor
l_err->addHwCallout(
procList[i],
HWAS::SRCI_PRIORITY_HIGH,
HWAS::NO_DECONFIG,
HWAS::GARD_NULL );

l_err->addPartCallout(
procList[i],
HWAS::PNOR_PART_TYPE,
HWAS::SRCI_PRIORITY_HIGH,
HWAS::NO_DECONFIG,
HWAS::GARD_NULL);

TRACFBIN(g_trac_pnor, "tocBuffer", tocBuffer, 0x20);

Expand Down

0 comments on commit 7364f24

Please sign in to comment.