Skip to content

Commit

Permalink
PRD: finished porting handleRrFo() for MBA
Browse files Browse the repository at this point in the history
Change-Id: I83f1cf86e877710c14fcd606b5ed293c32439ceb
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58232
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58328
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed May 5, 2018
1 parent e811117 commit 2ab7c3f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 110 deletions.
3 changes: 0 additions & 3 deletions src/usr/diag/prdf/common/plat/cen/prdf_plat_cen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ prd_incpath += ${PRD_SRC_PATH}/common/plat/cen
# Object files common to both FSP and Hostboot
################################################################################

# plat/cen/ (non-rule plugin related)
prd_obj += prdfCenMbaDomain.o

# plat/cen/ (rule plugin related)
prd_rule_plugin += prdfCenMba_common.o
prd_rule_plugin += prdfCenMembuf_common.o
Expand Down
77 changes: 0 additions & 77 deletions src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C
Original file line number Diff line number Diff line change
Expand Up @@ -333,83 +333,6 @@ int32_t CenMbaTdCtlr::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc,
#undef PRDF_FUNC
}

//------------------------------------------------------------------------------

int32_t CenMbaTdCtlr::handleRrFo()
{
#define PRDF_FUNC "[CenMbaTdCtlr::handleRrFo] "

int32_t o_rc = SUCCESS;

do
{
// NOTE: For performance reasons, we will not call initialize() yet.
// Instead, we will first query the hardware to determine if the
// TD controller even needed to be involved. Then we will call
// initialize(), if needed.

// Check for condition which may require to start a maintenance
// command during R/R or F/o.
// We will not start maintenance for any of following conditions
// 1. Maintenance command is already running.
// 2. Maintenance command complete bit is set.

// Check if maintenance command is running currently.
SCAN_COMM_REGISTER_CLASS * mbmsr =
iv_mbaChip->getRegister("MBMSR");

o_rc = mbmsr->Read();
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "Read() failed on MBMSR");
break;
}

if ( mbmsr->IsBitSet(0) )
break;

// Check if maintenance command complete attention is set.
SCAN_COMM_REGISTER_CLASS * mbaSpa =
iv_mbaChip->getRegister("MBASPA");
o_rc = mbaSpa->Read();
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "Read() failed on MBASPA");
break;
}

if ( mbaSpa->IsBitSet(0) || mbaSpa->IsBitSet(8) )
break;

// Now that we know we need to use the TD controller, initialize it.
o_rc = initialize();
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "initialize() failed" );
break;
}

// Create a temporary sdc as we do not want to write separate
// version for startBgScrub during R/R and FO
// Also we do not want to save this SDC. So set the "Don't save sdc"
// flag.
ServiceDataCollector serviceData;
STEP_CODE_DATA_STRUCT sdc;
sdc.service_data = &serviceData;
sdc.service_data->setFlag( ServiceDataCollector::DONT_SAVE_SDC );

o_rc = startNextTd( sdc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "startBgScrub() failed" );
break;
}
} while (0);

return o_rc;
#undef PRDF_FUNC
}

//------------------------------------------------------------------------------
// Private Functions
//------------------------------------------------------------------------------
Expand Down
14 changes: 0 additions & 14 deletions src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.H
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,6 @@ class CenMbaTdCtlr : public CenMbaTdCtlrCommon
iv_scrubResumeCounter(), iv_fetchAttnsMasked(false)
{}

/**
* @brief Handles reset-reload or FO scenario.
* @note This function will check if PRD was unable to restart maintenance
* command before R/R or FO. In that scenario, this function will
* start maintenance command. As during R/R or F/O we do not have any
* mechanism to restore the complete state of TD controller, we will
* not start any interrupted or pending TD procedure. We will only
* start BG scrub. If we found any chip marks during TD state
* machine initialize we will start VCM procedure rather than
* BG scrub.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
int32_t handleRrFo();

public: // Overloaded functions

int32_t handleCmdCompleteEvent( STEP_CODE_DATA_STRUCT & io_sc );
Expand Down
23 changes: 13 additions & 10 deletions src/usr/diag/prdf/common/prdfMain_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@

#include <prdfPlatConfigurator.H>

using namespace TARGETING;

namespace PRDF
{

using namespace PlatServices;

//------------------------------------------------------------------------------
// Forward references
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -159,20 +163,19 @@ errlHndl_t noLock_initialize()
#ifdef __HOSTBOOT_RUNTIME

// Handle R/R scenario.
TARGETING::Target* masterProc = nullptr;
TARGETING::targetService().masterProcChipTargetHandle(masterProc);

if (TARGETING::MODEL_NIMBUS == masterProc->getAttr<TARGETING::ATTR_MODEL>())
TARGETING::MODEL procModel = getChipModel( getMasterProc() );
if ( MODEL_NIMBUS == procModel )
{
((McbistDomain *)systemPtr->GetDomain(MCBIST_DOMAIN))->handleRrFo();
}
else if ( MODEL_CUMULUS == procModel )
{
McbistDomain * domain =
(McbistDomain *)systemPtr->GetDomain(MCBIST_DOMAIN);
domain->handleRrFo();
((MbaDomain *)systemPtr->GetDomain(MBA_DOMAIN))->handleRrFo();
}
else
{
MbaDomain * domain =
(MbaDomain *)systemPtr->GetDomain(MBA_DOMAIN);
domain->handleRrFo();
PRDF_ERR( PRDF_FUNC "Master PROC model %d not supported", procModel );
PRDF_ASSERT(false);
}

#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/common/plat/cen/prdfCenMbaDomain.C $ */
/* $Source: src/usr/diag/prdf/plat/cen/prdfCenMbaDomain_rt.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -34,9 +34,9 @@
#include <prdfExtensibleChip.H>
#include <prdfPlatServices.H>
#include <prdfTrace.H>
#ifdef __HOSTBOOT_RUNTIME

// Platform includes
#include <prdfCenMbaDataBundle.H>
#endif

using namespace TARGETING;

Expand All @@ -45,7 +45,6 @@ namespace PRDF

using namespace PlatServices;

#ifdef __HOSTBOOT_RUNTIME
void MbaDomain::handleRrFo()
{
#define PRDF_FUNC "[MbaDomain::handleRrFo] "
Expand Down Expand Up @@ -75,6 +74,5 @@ void MbaDomain::handleRrFo()

#undef PRDF_FUNC
}
#endif

} // end namespace PRDF
3 changes: 3 additions & 0 deletions src/usr/diag/prdf/plat/cen/prdf_plat_cen_hb_only.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@ endif

ifeq (${HOSTBOOT_RUNTIME},1)

# plat/cen/ (non-rule plugin related)
prd_obj += prdfCenMbaDomain_rt.o

endif

0 comments on commit 2ab7c3f

Please sign in to comment.