summaryrefslogtreecommitdiffstats
path: root/src/usr/diag
diff options
context:
space:
mode:
authorCaleb Palmer <cnpalmer@us.ibm.com>2018-03-12 10:45:01 -0500
committerZane C. Shelley <zshelle@us.ibm.com>2018-03-14 10:46:22 -0400
commit8f68014a90f61f0b1384914a0f62615ffff95009 (patch)
tree5cdb0cf99ee514242ad444bb3b38ab3c3e350d66 /src/usr/diag
parent5353bb457253ce24121357c6ab3da1c158602a7b (diff)
downloadtalos-hostboot-8f68014a90f61f0b1384914a0f62615ffff95009.tar.gz
talos-hostboot-8f68014a90f61f0b1384914a0f62615ffff95009.zip
MDIA: ensure full MBA target support for P9
Change-Id: I16fa359948c03725dae6ef70b4964dcb8b5edb16 RTC: 187474 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55653 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: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Diffstat (limited to 'src/usr/diag')
-rw-r--r--src/usr/diag/mdia/mdiafwd.H37
-rw-r--r--src/usr/diag/mdia/mdiamba.C31
-rw-r--r--src/usr/diag/mdia/mdiasm.C129
-rw-r--r--src/usr/diag/mdia/mdiasmimpl.H4
-rw-r--r--src/usr/diag/mdia/mdiaworkitem.C6
-rw-r--r--src/usr/diag/mdia/mdiaworkitem.H8
6 files changed, 141 insertions, 74 deletions
diff --git a/src/usr/diag/mdia/mdiafwd.H b/src/usr/diag/mdia/mdiafwd.H
index fb693084e..64fbf7887 100644
--- a/src/usr/diag/mdia/mdiafwd.H
+++ b/src/usr/diag/mdia/mdiafwd.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2017 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -97,11 +97,10 @@ enum
MCBIST_FIR_ACT1 = 0x07012307,
// mcs unit regs
- MCI_FIR = 0x02011840,
- MCI_FIR_MASK = 0x02011843,
- MCI_FIR_ACT0 = 0x02011846,
- MCI_FIR_ACT1 = 0x02011847,
- MCS_MODE4 = 0x0201181A,
+ CHI_FIR = 0x07010900,
+ CHI_FIR_MASK = 0x07010903,
+ CHI_FIR_ACT0 = 0x07010906,
+ CHI_FIR_ACT1 = 0x07010907,
// proc regs
IPOLL_MASK = 0x000F0033,
@@ -168,22 +167,22 @@ typedef std::vector<uint64_t> MonitorIDs;
* @brief getDiagnosticMode get the mode (scrub, init, one, four, nine)
*
* @param[in] i_globals policy flags needed to determine the mode
- * @param[in] i_target the mba target for which the mode is determined
- * @param[out] o_mode the mode for the target mba
+ * @param[in] i_target the mba/mcbist target for which the mode is determined
+ * @param[out] o_mode the mode for the target mba/mcbist
*
* @retval 0 no error
* @retval !0 unexpected error occurred
*/
errlHndl_t getDiagnosticMode(
const Globals & i_globals,
- TARGETING::TargetHandle_t i_mba,
+ TARGETING::TargetHandle_t i_trgt,
DiagMode & o_mode);
/**
- * @brief getWorkFlow get the workflow for an mba target
+ * @brief getWorkFlow get the workflow for an mba/mcbist target
*
* @param[in] i_mode the diagnostic mode for the target
- * @param[out] o_wf the workflow for the mba target
+ * @param[out] o_wf the workflow for the mba/mcbist target
* @param[in] i_globals policy flags needed to determine MNFG status
*
* @retval 0 no error
@@ -202,23 +201,23 @@ errlHndl_t getWorkFlow(
void doStepCleanup(const Globals & i_globals);
/**
- * @brief check if hw state has been changed for an mba's
- * associated targets
+ * @brief check if hw state has been changed for an mba
+ * or mcbist's associated targets
*
- * @param[in] i_mba input mba target
+ * @param[in] i_trgt input mba/mcbist target
*
* @retval true if hw state has been changed or else
*/
-bool isHWStateChanged(TARGETING::TargetHandle_t i_mba);
+bool isHWStateChanged(TARGETING::TargetHandle_t i_trgt);
/**
- * @brief clear hw changed state for an mba's
- * associated targets
+ * @brief clear hw changed state for an mba
+ * or mcbist's associated targets
*
- * @param[in] i_mba input mba target
+ * @param[in] i_trgt input mba/mcbist target
*
*/
-void clearHWStateChanged(TARGETING::TargetHandle_t i_mba);
+void clearHWStateChanged(TARGETING::TargetHandle_t i_trgt);
}
#endif
diff --git a/src/usr/diag/mdia/mdiamba.C b/src/usr/diag/mdia/mdiamba.C
index d17775926..f5f6bef13 100644
--- a/src/usr/diag/mdia/mdiamba.C
+++ b/src/usr/diag/mdia/mdiamba.C
@@ -224,14 +224,14 @@ errlHndl_t getWorkFlow(
}
/*
- * Local helper function to return a list of Centaur
- * DIMMs, and MCS associated with the input MBA target
+ * Local helper function to return a list of DIMMs, MCS, and
+ * MCA/Centaur associated with the input MBA/MCBIST target
*
- * If i_queryOnly = true (Query)
- * - Return a list of DIMMs, Centaur, and
- * MCS connected to this MBA
+ * If i_queryOnly = true (Query) or MCBIST case
+ * - Return a list of DIMMs, Centaur/MCA, and
+ * MCS connected to this MBA/MCBIST
*
- * Else (Clear)
+ * Else (Clear) - Centaur case only
* - Return a list of DIMMs and
* (Centaur + MCS) if all the DIMMs behind this
* Centaur have hwchangedState flags cleared
@@ -265,18 +265,21 @@ TargetHandleList getMemTargetsForQueryOrClear(
// add associated MCBIST
o_list.push_back( i_trgt );
+ // add associated MCSs
+ TargetHandleList mcsList;
+ getChildAffinityTargets( mcsList, i_trgt, CLASS_UNIT, TYPE_MCS );
+ if ( !mcsList.empty() )
+ o_list.insert( o_list.end(), mcsList.begin(), mcsList.end() );
+
// add associated MCAs
TargetHandleList mcaList;
- getChildAffinityTargets(mcaList, i_trgt, CLASS_UNIT, TYPE_MCA);
-
+ getChildAffinityTargets( mcaList, i_trgt, CLASS_UNIT, TYPE_MCA );
if ( !mcaList.empty() )
- {
o_list.insert( o_list.end(), mcaList.begin(), mcaList.end() );
- }
}
// MBA target
- else
+ else if ( TYPE_MBA == trgtType )
{
// add associated Centaur
TargetHandleList targetList;
@@ -372,6 +375,12 @@ TargetHandleList getMemTargetsForQueryOrClear(
}
}
+ else
+ {
+ assert( false, "getMemTargetsForQueryOrClear: Invalid target "
+ "type from i_trgt: %x", get_huid(i_trgt) );
+ break;
+ }
} while(0);
diff --git a/src/usr/diag/mdia/mdiasm.C b/src/usr/diag/mdia/mdiasm.C
index 4da90c76d..000aeb9e8 100644
--- a/src/usr/diag/mdia/mdiasm.C
+++ b/src/usr/diag/mdia/mdiasm.C
@@ -116,12 +116,11 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log)
MEM_SPA_FIR_MASK,
};
- const uint64_t mcsRegs[] = {
- MCI_FIR,
- MCI_FIR_MASK,
- MCI_FIR_ACT0,
- MCI_FIR_ACT1,
- MCS_MODE4,
+ const uint64_t dmiRegs[] = {
+ CHI_FIR,
+ CHI_FIR_MASK,
+ CHI_FIR_ACT0,
+ CHI_FIR_ACT1,
};
const uint64_t mcbRegs[] = {
@@ -150,27 +149,27 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log)
// get the parent membuf
ConstTargetHandle_t membuf = getParentChip(i_target);
- // get the parent mcs
+ // get the parent dmi
TargetHandleList targetList;
- TargetHandle_t mcs = NULL;
+ TargetHandle_t dmi = NULL;
if(membuf)
{
getParentAffinityTargets(
targetList,
membuf,
CLASS_UNIT,
- TYPE_MCS);
+ TYPE_DMI);
}
if(targetList.size() == 1)
{
- mcs = targetList[0];
+ dmi = targetList[0];
}
// get the parent proc
ConstTargetHandle_t proc = NULL;
- if(mcs)
+ if(dmi)
{
- proc = getParentChip(mcs);
+ proc = getParentChip(dmi);
}
const struct Entry
@@ -182,7 +181,7 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log)
{i_target, mbaRegs, mbaRegs + sizeof(mbaRegs)/sizeof(*mbaRegs)},
{membuf, membufRegs,
membufRegs + sizeof(membufRegs)/sizeof(*membufRegs)},
- {mcs, mcsRegs, mcsRegs + sizeof(mcsRegs)/sizeof(*mcsRegs)},
+ {dmi, dmiRegs, dmiRegs + sizeof(dmiRegs)/sizeof(*dmiRegs)},
{proc, procRegs, procRegs + sizeof(procRegs)/sizeof(*procRegs)},
};
@@ -241,6 +240,11 @@ void addTimeoutFFDC(TargetHandle_t i_target, errlHndl_t & io_log)
}
}
}
+ else
+ {
+ assert( false, "addTimeoutFFDC: Invalid target type from i_target: %x",
+ get_huid(i_target) );
+ }
// collect these traces for timeout debugging
io_log->collectTrace("MDIA_FAST",512);
@@ -261,14 +265,20 @@ fapi2::TargetType getMdiaTargetType()
TARGETING::targetService().masterProcChipTargetHandle(masterProc);
if ( TARGETING::MODEL_CUMULUS ==
- masterProc->getAttr<TARGETING::ATTR_MODEL>() )
+ masterProc->getAttr<TARGETING::ATTR_MODEL>() )
{
targetType = fapi2::TARGET_TYPE_MBA_CHIPLET;
}
- else
+ else if ( TARGETING::MODEL_NIMBUS ==
+ masterProc->getAttr<TARGETING::ATTR_MODEL>() )
{
targetType = fapi2::TARGET_TYPE_MCBIST;
}
+ else
+ {
+ assert( false, "getMdiaTargetType: Invalid model type from "
+ "masterProc: %x", get_huid(masterProc) );
+ }
return targetType;
}
@@ -327,7 +337,11 @@ uint64_t getTimeoutValue()
}
// Do the setup for CE thresholds
-errlHndl_t ceErrorSetup( TargetHandle_t i_mba )
+template<TARGETING::TYPE T>
+errlHndl_t ceErrorSetup( TargetHandle_t i_mba );
+
+template<>
+errlHndl_t ceErrorSetup<TYPE_MBA>( TargetHandle_t i_mba )
{
errlHndl_t err = NULL;
@@ -347,6 +361,7 @@ errlHndl_t ceErrorSetup( TargetHandle_t i_mba )
{
MDIA_FAST("ceErrorSetup: deviceRead on 0x%08X failed HUID:0x%08X",
addr, get_huid(membuf));
+ errlCommit( err, MDIA_COMP_ID );
break;
}
@@ -364,6 +379,7 @@ errlHndl_t ceErrorSetup( TargetHandle_t i_mba )
{
MDIA_FAST("ceErrorSetup: deviceWrite on 0x%08X failed HUID:0x%08X",
addr, get_huid(i_mba));
+ errlCommit( err, MDIA_COMP_ID );
break;
}
} while(0);
@@ -394,6 +410,11 @@ uint64_t getMemSize(TargetHandle_t i_target)
TargetService::CHILD_BY_AFFINITY,
TargetService::ALL, &predAnd );
}
+ else
+ {
+ assert( false, "getMemSize: Invalid target type from i_target: %x",
+ get_huid(i_target) );
+ }
for (auto trgt : targetList)
{
@@ -442,19 +463,32 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
uint64_t mskData = 0;
size_t sz_uint64 = sizeof(uint64_t);
- // Init data for MCBIST.
- uint64_t firAddr = MCBIST_FIR;
- uint64_t firAndAddr = MCBIST_FIR_AND;
- uint64_t mskAddr = MCBIST_FIR_MASK;
- uint64_t bitMask = 0x0028000000000000;
+ uint64_t firAddr = 0;
+ uint64_t firAndAddr = 0;
+ uint64_t mskAddr = 0;
+ uint64_t bitMask = 0;
+ // Init data for MCBIST.
+ if ( TYPE_MCBIST == trgtType )
+ {
+ firAddr = MCBIST_FIR;
+ firAndAddr = MCBIST_FIR_AND;
+ mskAddr = MCBIST_FIR_MASK;
+ bitMask = 0x0028000000000000;
+ }
// Change if target type is MBA.
- if ( TYPE_MBA == trgtType )
+ else if ( TYPE_MBA == trgtType )
{
firAddr = MBA01_SPA;
mskAddr = MBA01_SPA_MASK;
bitMask = 0x8080000000000000; // bits 0 or 8
}
+ // Assert if unsupported type
+ else
+ {
+ assert( false, "processCommandTimeout: Invalid target type "
+ "from target: %x", get_huid(target) );
+ }
// Check for command complete. If set, don't time out.
err = deviceRead( target, &firData, sz_uint64,
@@ -564,7 +598,7 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
// If maint cmd complete bit is not on, time out
MDIA_FAST("sm: stopping command HUID:0x%08X", get_huid(target));
- //target type is MBA
+ // target type is MBA
if ( TYPE_MBA == trgtType )
{
fapi2::ReturnCode fapirc =
@@ -587,8 +621,8 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
errlCommit(err, MDIA_COMP_ID);
}
}
- //target type is MCBIST
- else
+ // target type is MCBIST
+ else if ( TYPE_MCBIST == trgtType )
{
fapi2::Target<fapi2::TARGET_TYPE_MCBIST> fapiMcbist(target);
FAPI_INVOKE_HWP( err, mss::memdiags::stop, fapiMcbist );
@@ -613,6 +647,12 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
errlCommit(err, MDIA_COMP_ID);
}
}
+ // Assert if unsupported type
+ else
+ {
+ assert( false, "processCommandTimeout: Invalid target type "
+ "from timed out target: %x", get_huid(target) );
+ }
(*wit)->data = NULL;
@@ -899,7 +939,7 @@ bool StateMachine::executeWorkItem(WorkFlowProperties * i_wfp)
case RESTORE_DRAM_REPAIRS:
{
- TargetHandle_t target = getTarget( *i_wfp);
+ TargetHandle_t target = getTarget( *i_wfp );
TYPE trgtType = target->getAttr<ATTR_TYPE>();
// MBA target
@@ -908,7 +948,7 @@ bool StateMachine::executeWorkItem(WorkFlowProperties * i_wfp)
rc = PRDF::restoreDramRepairs<TYPE_MBA>( target );
}
// MCBIST target
- else
+ else if ( TYPE_MCBIST == trgtType )
{
// Get the connected MCAs.
TargetHandleList mcaList;
@@ -921,7 +961,11 @@ bool StateMachine::executeWorkItem(WorkFlowProperties * i_wfp)
rc |= PRDF::restoreDramRepairs<TYPE_MCA>( mca );
}
}
-
+ else
+ {
+ assert( false, "executeWorkItem: Invalid target type from "
+ "target: %x", get_huid(target) );
+ }
break;
}
case START_PATTERN_0:
@@ -953,13 +997,13 @@ bool StateMachine::executeWorkItem(WorkFlowProperties * i_wfp)
{
MDIA_FAST("Executing analyzeIplCEStats");
bool calloutMade = false;
- TargetHandle_t mba = getTarget( *i_wfp);
- rc = PRDF::analyzeIplCEStats( mba,
- calloutMade);
- if( rc)
+ TargetHandle_t target = getTarget( *i_wfp );
+ rc = PRDF::analyzeIplCEStats( target,
+ calloutMade );
+ if( rc )
{
MDIA_FAST("executeWorkItem: PRDF::analyzeIplCEStats failed "
- "rc:%d HUID:0x%08X", rc, get_huid(mba));
+ "rc:%d HUID:0x%08X", rc, get_huid(target));
}
if( calloutMade )
{
@@ -1057,7 +1101,7 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp)
// We will always do ce setup though CE calculation
// is only done during MNFG. This will give use better ffdc.
- err = ceErrorSetup( target );
+ err = ceErrorSetup<TYPE_MBA>( target );
if( nullptr != err)
{
MDIA_FAST("sm: ceErrorSetup failed for mba. HUID:0x%08X",
@@ -1174,7 +1218,7 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp)
}
//target type is MCBIST
- else
+ else if (TYPE_MCBIST == trgtType)
{
fapi2::Target<fapi2::TARGET_TYPE_MCBIST> fapiMcbist(target);
mss::mcbist::stop_conditions stopCond;
@@ -1236,6 +1280,11 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp)
i_wfp.data = nullptr;
}
}
+ else
+ {
+ assert( false, "doMaintCommand: Invalid target type from "
+ "target: %x", get_huid(target) );
+ }
if ( nullptr == err )
{
@@ -1391,7 +1440,7 @@ bool StateMachine::processMaintCommandEvent(const MaintCommandEvent & i_event)
}
//target type is MBA
- if(TYPE_MBA == trgtType)
+ if ( TYPE_MBA == trgtType )
{
mss_MaintCmd * cmd = static_cast<mss_MaintCmd *>(wfp.data);
@@ -1429,7 +1478,7 @@ bool StateMachine::processMaintCommandEvent(const MaintCommandEvent & i_event)
}
}
//target type is MCBIST
- else
+ else if ( TYPE_MCBIST == trgtType )
{
if(flags & STOP_CMD)
{
@@ -1445,6 +1494,12 @@ bool StateMachine::processMaintCommandEvent(const MaintCommandEvent & i_event)
}
}
}
+ else
+ {
+ assert( false, "processMaintCommandEvent: Invalid target type "
+ "from target: %x", get_huid(target) );
+ }
+
// schedule the next work item
if((flags & START_NEXT_CMD) && !iv_shutdown)
{
diff --git a/src/usr/diag/mdia/mdiasmimpl.H b/src/usr/diag/mdia/mdiasmimpl.H
index f0c4cfb80..4fee23399 100644
--- a/src/usr/diag/mdia/mdiasmimpl.H
+++ b/src/usr/diag/mdia/mdiasmimpl.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -80,7 +80,7 @@ struct WorkFlowProperties
void * data;
/**
- * @brief mba position on membuf (0/1)
+ * @brief mba/mcbist position on membuf/proc (0/1)
*/
uint8_t chipUnit;
diff --git a/src/usr/diag/mdia/mdiaworkitem.C b/src/usr/diag/mdia/mdiaworkitem.C
index 06ac50620..79d5ed8ec 100644
--- a/src/usr/diag/mdia/mdiaworkitem.C
+++ b/src/usr/diag/mdia/mdiaworkitem.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -53,7 +55,7 @@ int64_t WorkItem::compare(const WorkItem & i_r) const
}
// if the state machine computed priority is the same,
- // give higher priority to mbas on different dmi busses
+ // give higher priority to mbas/mcbists on different dmi busses
if(iv_chipUnit < i_r.iv_chipUnit)
{
diff --git a/src/usr/diag/mdia/mdiaworkitem.H b/src/usr/diag/mdia/mdiaworkitem.H
index 1b631977a..dd74e05f6 100644
--- a/src/usr/diag/mdia/mdiaworkitem.H
+++ b/src/usr/diag/mdia/mdiaworkitem.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2018 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -65,7 +67,7 @@ class WorkItem
* @param[in] i_sm state machine to forward call to
* @param[in] i_wfp state machine state snapshot
* @param[in] i_priority work item priority
- * @param[in] i_chipUnit mba position (0/1)
+ * @param[in] i_chipUnit mba/mcbist position (0/1)
*/
WorkItem(StateMachine & i_sm, WorkFlowProperties * i_wfp,
uint64_t i_priority, uint8_t i_chipUnit);
@@ -88,7 +90,7 @@ class WorkItem
uint64_t iv_priority;
/**
- * @brief the mba number on the membuf (0/1)
+ * @brief the mba/mcbist number on the membuf/proc (0/1)
*/
uint8_t iv_chipUnit;
OpenPOWER on IntegriCloud