Skip to content

Commit

Permalink
PRD: Updates for Cumulus PLL analysis
Browse files Browse the repository at this point in the history
Change-Id: I239cd979f09b6e190c1ded70f780739286f15af8
RTC: 155673
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58027
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58329
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>
  • Loading branch information
bweisenb authored and zane131 committed May 5, 2018
1 parent 2ab7c3f commit b9f2362
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -49,13 +49,11 @@ int32_t ClockResolution::Resolve(STEP_CODE_DATA_STRUCT & serviceData)
if ( (iv_targetType == TYPE_PROC) ||
(iv_targetType == TYPE_MEMBUF) )
{
// even though we pass in pos=0 for systemref clk,
// getActiveRefClk will make sure it returns the active osc.
TargetHandle_t l_ptargetClock =
PlatServices::getActiveRefClk(iv_ptargetClock,
TYPE_OSCREFCLK, 0);
PlatServices::getActiveRefClk(iv_ptargetClock, TYPE_OSCREFCLK);

// Callout this chip if nothing else.
// Or in the case of hostboot, use this chip for addClockCallout
if(NULL == l_ptargetClock)
{
l_ptargetClock = iv_ptargetClock;
Expand All @@ -73,6 +71,29 @@ int32_t ClockResolution::Resolve(STEP_CODE_DATA_STRUCT & serviceData)
PRDcalloutData::TYPE_PROCCLK));
#endif
}
else if (iv_targetType == TYPE_PEC)
{
TargetHandle_t l_ptargetClock =
PlatServices::getActiveRefClk(iv_ptargetClock, TYPE_OSCPCICLK);

// Callout this chip if nothing else.
if(NULL == l_ptargetClock)
{
l_ptargetClock = iv_ptargetClock;
}

// callout the clock source
// HB does not have the osc target modeled
// so we need to use the proc target with
// osc clock type to call out
#ifndef __HOSTBOOT_MODULE
serviceData.service_data->SetCallout(l_ptargetClock);
#else
serviceData.service_data->SetCallout(
PRDcallout(l_ptargetClock,
PRDcalloutData::TYPE_PCICLK));
#endif
}
// Get all connected chips for non-CLOCK_CARD types.
else
{
Expand Down
3 changes: 2 additions & 1 deletion src/usr/diag/prdf/common/iipconst.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -91,6 +91,7 @@ enum DOMAIN_ID

CLOCK_DOMAIN_FAB = 0x90,
CLOCK_DOMAIN_MEMBUF = 0x91,
CLOCK_DOMAIN_IO = 0x92,

END_DOMAIN_ID
};
Expand Down
21 changes: 14 additions & 7 deletions src/usr/diag/prdf/common/plat/p9/prdfP9Configurator.C
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ errlHndl_t PlatConfigurator::addDomainChips( TARGETING::TYPE i_type,
}

// Generic empty PLL domain map
PllDomainMap pllDmnMap;
PllDomainMap sysRefPllDmnMap;
PllDomainMap mfRefPllDmnMap;

// Add each chip to the chip domain.
for ( const auto & trgt : trgtList )
Expand All @@ -340,13 +341,16 @@ errlHndl_t PlatConfigurator::addDomainChips( TARGETING::TYPE i_type,
switch ( i_type )
{
case TYPE_PROC:
addChipToPllDomain( CLOCK_DOMAIN_FAB, pllDmnMap,
addChipToPllDomain( CLOCK_DOMAIN_FAB, sysRefPllDmnMap,
chip, trgt, TYPE_PROC,
scanFac, resFac );
addChipToPllDomain( CLOCK_DOMAIN_IO, mfRefPllDmnMap,
chip, trgt, TYPE_PEC,
scanFac, resFac );
break;

case TYPE_MEMBUF:
addChipToPllDomain( CLOCK_DOMAIN_MEMBUF, pllDmnMap,
addChipToPllDomain( CLOCK_DOMAIN_MEMBUF, sysRefPllDmnMap,
chip, trgt, TYPE_MEMBUF,
scanFac, resFac );
break;
Expand All @@ -356,7 +360,10 @@ errlHndl_t PlatConfigurator::addDomainChips( TARGETING::TYPE i_type,
}

// Add the PLL domain maps to the PLL domain map list.
if ( !pllDmnMap.empty() ) io_pllDmnLst.push_back( pllDmnMap );
if ( !sysRefPllDmnMap.empty() )
io_pllDmnLst.push_back( sysRefPllDmnMap );
if ( !mfRefPllDmnMap.empty() )
io_pllDmnLst.push_back( mfRefPllDmnMap );

// Flush rule table cache since objects are all built.
Prdr::LoadChipCache::flushCache();
Expand All @@ -381,18 +388,18 @@ void PlatConfigurator::addChipToPllDomain( DOMAIN_ID i_domainId,
// that is not very maintainable code. Instead, we should be querying
// clock domain attributes so that this code does not need to be
// modified if the clock domains change.
uint32_t pos = 0;
uint32_t pos = getTargetPosition( getConnectedParent( i_trgt, TYPE_NODE ) );

if ( io_pllDmnMap.end() == io_pllDmnMap.find(pos) )
{
Resolution & clock = i_resFac.GetClockResolution( i_trgt, i_type );

#ifdef __HOSTBOOT_MODULE
io_pllDmnMap[pos] = new PllDomain( i_domainId, clock,
ThresholdResolution::cv_mnfgDefault );
ThresholdResolution::cv_mnfgDefault );
#else
io_pllDmnMap[pos] = new PllDomain( i_domainId, clock, CONTENT_HW,
ThresholdResolution::cv_mnfgDefault );
ThresholdResolution::cv_mnfgDefault );
#endif
}

Expand Down
19 changes: 10 additions & 9 deletions src/usr/diag/prdf/common/plat/p9/prdfP9PllDomain.C
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData,
serviceData.service_data->SetUERE();
}

// TODO: RTC 155673 - use attributes to callout active clock sources
// For Nimbus sys ref and mf ref clock source is the same

// always suspect the clock source
closeClockSource.Resolve(serviceData);
if(&closeClockSource != &farClockSource)
Expand Down Expand Up @@ -298,19 +295,23 @@ int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData,

}

// TODO: RTC 155673 - Handle redundant Osc failovers
// Shouldn't see these on nimbus
if (mfFoList.size() > 0)
{
PRDF_ERR( PRDF_FUNC "Unexpected PCI osc failover detected" );
mskErrType |= PCI_OSC_FAILOVER;
serviceData.service_data->SetCallout( LEVEL2_SUPPORT, MRU_LOW );

// Set Signature
serviceData.service_data->GetErrorSignature()->
setChipId(pciList[0]->getHuid());
serviceData.service_data->SetErrorSig( PRDFSIG_MF_REF_FAILOVER );
}
if (sysRefFoList.size() > 0)
{
PRDF_ERR( PRDF_FUNC "Unexpected Sys osc failover detected" );
mskErrType |= SYS_OSC_FAILOVER;
serviceData.service_data->SetCallout( LEVEL2_SUPPORT, MRU_LOW );

// Set Signature
serviceData.service_data->GetErrorSignature()->
setChipId(pciList[0]->getHuid());
serviceData.service_data->SetErrorSig( PRDFSIG_SYS_REF_FAILOVER );
}

if (serviceData.service_data->IsAtThreshold())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -35,4 +35,7 @@ PRDR_ERROR_SIGNATURE( ERepair_FWThrExceeded, 0xffff0001, "",

/* PLL Extra signatures */
PRDR_ERROR_SIGNATURE( PLL_ERROR, 0x00ed0000, "","PLL error" );
PRDR_ERROR_SIGNATURE( MF_REF_FAILOVER, 0x00ed0001, "", "MF Ref Clk failover" );
PRDR_ERROR_SIGNATURE( SYS_REF_FAILOVER, 0x00ed0002, "",
"Sys Ref Clk failover" );
#endif // __prdfP9ProcMbCommonExtraSig_H
3 changes: 1 addition & 2 deletions src/usr/diag/prdf/common/plat/prdfPlatServices_common.H
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,7 @@ int32_t getCfam( ExtensibleChip * i_chip,
*/
TARGETING::TargetHandle_t getActiveRefClk(
TARGETING::TargetHandle_t i_procTarget,
TARGETING::TYPE i_connType,
uint32_t i_oscPos);
TARGETING::TYPE i_connType);


/**
Expand Down
4 changes: 3 additions & 1 deletion src/usr/diag/prdf/common/plat/prdfTargetServices.C
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,9 @@ TARGETING::TargetHandle_t getClockId(TARGETING::TargetHandle_t

PredicateIsFunctional l_funcFilter;
PredicateCTM l_oscFilter(CLASS_CHIP, i_connType);
PredicateCTM l_peerFilter(CLASS_UNIT, TYPE_MFREFCLKENDPT);
PredicateCTM l_peerFilter(CLASS_UNIT,
(i_connType == TYPE_OSCREFCLK ?
TYPE_SYSREFCLKENDPT:TYPE_MFREFCLKENDPT));
PredicatePostfixExpr l_funcAndOscFilter, l_funcAndPeerFilter;
l_funcAndOscFilter.push(&l_oscFilter).push(&l_funcFilter).And();
l_funcAndPeerFilter.push(&l_peerFilter).push(&l_funcFilter).And();
Expand Down
7 changes: 2 additions & 5 deletions src/usr/diag/prdf/plat/prdfPlatServices.C
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,9 @@ int32_t getCfam( ExtensibleChip * i_chip,

TARGETING::TargetHandle_t getActiveRefClk(TARGETING::TargetHandle_t
i_procTarget,
TARGETING::TYPE i_connType,
uint32_t i_oscPos)
TARGETING::TYPE i_connType)
{
return PlatServices::getClockId( i_procTarget,
i_connType,
i_oscPos );
return nullptr;
}

//##############################################################################
Expand Down

0 comments on commit b9f2362

Please sign in to comment.