Skip to content

Commit c201607

Browse files
cnpalmerzane131
authored andcommitted
MDIA: Update maint cmds with Centaur Hwp
Change-Id: I7b2d34e511392fae0a6f3671aa6ab8dea00205c8 RTC: 155857 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46542 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-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: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
1 parent 22edf15 commit c201607

File tree

4 files changed

+104
-86
lines changed

4 files changed

+104
-86
lines changed

src/usr/diag/mdia/makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ EXTRAINCDIR += ${ROOTPATH}/src/import/
4242
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2
4343
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/targeting/common
4444
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs
45+
##########################################################
46+
# Following is needed to include p9c_mss_maint_cmds.H
47+
##########################################################
48+
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/centaur/common/include
49+
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/centaur/procedures/hwp/memory
50+
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/centaur/procedures/hwp/memory/lib/shared
4551

4652
MODULE = mdia
4753

src/usr/diag/mdia/mdiafwd.H

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ enum
9696
MCBIST_FIR_ACT0 = 0x07012306,
9797
MCBIST_FIR_ACT1 = 0x07012307,
9898

99-
//TODO RTC 155857
10099
// mcs unit regs
101100
MCI_FIR = 0x02011840,
102101
MCI_FIR_MASK = 0x02011843,

src/usr/diag/mdia/mdiamba.C

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ errlHndl_t getDiagnosticMode(
141141
o_mode = FOUR_PATTERNS;
142142
}
143143

144+
// TODO RTC 180118
145+
// For Cumulus PON we will only support init to 0
146+
ConstTargetHandle_t parent = getParentChip( i_trgt );
147+
if ( MODEL_CUMULUS == parent->getAttr<ATTR_MODEL>() )
148+
{
149+
o_mode = ONE_PATTERN;
150+
}
151+
144152
} while(0);
145153

146154
MDIA_FAST("getDiagnosticMode: trgt: %x, o_mode: 0x%x, "

src/usr/diag/mdia/mdiasm.C

Lines changed: 90 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <config.h>
4747
#include <initservice/initserviceif.H>
4848
#include <sys/time.h>
49+
#include <p9c_mss_maint_cmds.H>
4950

5051
using namespace TARGETING;
5152
using namespace ERRORLOG;
@@ -565,29 +566,25 @@ void StateMachine::processCommandTimeout(const MonitorIDs & i_monitorIDs)
565566
//target type is MBA
566567
if ( TYPE_MBA == trgtType )
567568
{
568-
//TODO RTC 155857
569-
//no longer have the mss_MaintCmd class at the moment
570-
//will need to update once we have Cumulus support
571-
572-
//fapi2::ReturnCode fapirc =
573-
// static_cast<mss_MaintCmd *>((*wit)->data)->stopCmd();
574-
//err = fapi2::rcToErrl(fapirc);
575-
576-
//if( nullptr != err )
577-
//{
578-
// MDIA_ERR("sm: mss_MaintCmd::stopCmd failed");
579-
// errlCommit(err, MDIA_COMP_ID);
580-
//}
581-
582-
//fapirc =
583-
// static_cast<mss_MaintCmd *>((*wit)->data)->cleanupCmd();
584-
//err = fapi2::rcToErrl(fapirc);
585-
586-
//if( nullptr != err )
587-
//{
588-
// MDIA_ERR("sm: mss_MaintCmd::cleanupCmd failed");
589-
// errlCommit(err, MDIA_COMP_ID);
590-
//}
569+
fapi2::ReturnCode fapirc =
570+
static_cast<mss_MaintCmd *>((*wit)->data)->stopCmd();
571+
err = fapi2::rcToErrl(fapirc);
572+
573+
if( nullptr != err )
574+
{
575+
MDIA_ERR("sm: mss_MaintCmd::stopCmd failed");
576+
errlCommit(err, MDIA_COMP_ID);
577+
}
578+
579+
fapirc =
580+
static_cast<mss_MaintCmd *>((*wit)->data)->cleanupCmd();
581+
err = fapi2::rcToErrl(fapirc);
582+
583+
if( nullptr != err )
584+
{
585+
MDIA_ERR("sm: mss_MaintCmd::cleanupCmd failed");
586+
errlCommit(err, MDIA_COMP_ID);
587+
}
591588
}
592589
//target type is MCBIST
593590
else
@@ -1018,9 +1015,7 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp)
10181015
//target type is MBA
10191016
if (TYPE_MBA == trgtType)
10201017
{
1021-
/*TODO RTC 155857
1022-
1023-
uint64_t stopCondition =
1018+
uint32_t stopCondition =
10241019
mss_MaintCmd::STOP_END_OF_RANK |
10251020
mss_MaintCmd::STOP_ON_MPE |
10261021
mss_MaintCmd::STOP_ON_UE |
@@ -1034,8 +1029,8 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp)
10341029
stopCondition |= mss_MaintCmd::STOP_ON_HARD_NCE_ETE;
10351030
}
10361031

1037-
ecmdDataBufferBase startAddr(64), endAddr(64);
1038-
mss_MaintCmd * cmd = NULL;
1032+
fapi2::buffer<uint64_t> startAddr, endAddr;
1033+
mss_MaintCmd * cmd = nullptr;
10391034
cmd = static_cast<mss_MaintCmd *>(i_wfp.data);
10401035
fapi2::Target<fapi2::TARGET_TYPE_MBA> fapiMba(target);
10411036

@@ -1049,46 +1044,58 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp)
10491044
break;
10501045
}
10511046

1052-
fapirc = mss_get_address_range(
1047+
fapi2::ReturnCode fapirc = mss_get_address_range(
10531048
fapiMba,
10541049
MSS_ALL_RANKS,
10551050
startAddr,
10561051
endAddr);
1057-
err = fapiRcToErrl(fapirc);
1052+
err = fapi2::rcToErrl(fapirc);
10581053

10591054
if(err)
10601055
{
10611056
MDIA_FAST("sm: get_address_range failed");
10621057
break;
10631058
}
10641059

1060+
ConstTargetHandle_t parent = getParentChip(target);
1061+
10651062
// new command...use the full range
10661063

10671064
switch(workItem)
10681065
{
10691066
case START_RANDOM_PATTERN:
1070-
cmd = new mss_SuperFastRandomInit(
1071-
fapiMba,
1072-
startAddr,
1073-
endAddr,
1074-
mss_MaintCmd::PATTERN_RANDOM,
1075-
stopCondition,
1076-
false);
1077-
1078-
MDIA_FAST("sm: random init %p on: %x", cmd,
1079-
get_huid(target));
1067+
// TODO RTC 180118
1068+
// For Cumulus PON we will only support init to 0
1069+
if ( MODEL_CUMULUS != parent->getAttr<ATTR_MODEL>() )
1070+
{
1071+
cmd = new mss_SuperFastRandomInit(
1072+
fapiMba,
1073+
startAddr,
1074+
endAddr,
1075+
mss_MaintCmd::PATTERN_RANDOM,
1076+
stopCondition,
1077+
false);
1078+
1079+
MDIA_FAST("sm: random init %p on: %x", cmd,
1080+
get_huid(target));
1081+
}
10801082
break;
10811083

10821084
case START_SCRUB:
1083-
cmd = new mss_SuperFastRead(
1084-
fapiMba,
1085-
startAddr,
1086-
endAddr,
1087-
stopCondition,
1088-
false);
1089-
1090-
MDIA_FAST("sm: scrub %p on: %x", cmd,
1091-
get_huid(target));
1085+
// TODO RTC 180118
1086+
// For Cumulus PON we will only support init to 0
1087+
if ( MODEL_CUMULUS != parent->getAttr<ATTR_MODEL>() )
1088+
{
1089+
cmd = new mss_SuperFastRead(
1090+
fapiMba,
1091+
startAddr,
1092+
endAddr,
1093+
stopCondition,
1094+
false);
1095+
1096+
MDIA_FAST("sm: scrub %p on: %x", cmd,
1097+
get_huid(target));
1098+
}
10921099
break;
10931100
case START_PATTERN_0:
10941101
case START_PATTERN_1:
@@ -1144,7 +1151,6 @@ errlHndl_t StateMachine::doMaintCommand(WorkFlowProperties & i_wfp)
11441151
}
11451152
}
11461153

1147-
*/
11481154
}
11491155
//target type is MCBIST
11501156
else
@@ -1376,41 +1382,40 @@ bool StateMachine::processMaintCommandEvent(const MaintCommandEvent & i_event)
13761382
//target type is MBA
13771383
if(TYPE_MBA == trgtType)
13781384
{
1379-
//TODO RTC 155857
1380-
//mss_MaintCmd * cmd = static_cast<mss_MaintCmd *>(wfp.data);
1381-
//
1382-
//if(cmd && (flags & STOP_CMD))
1383-
//{
1384-
// MDIA_FAST("sm: stopping command: %p", target);
1385-
1386-
// fapi2::ReturnCode fapirc = cmd->stopCmd();
1387-
// err = fapi2::rcToErrl(fapirc);
1388-
1389-
// if (nullptr != err)
1390-
// {
1391-
// MDIA_ERR("sm: mss_MaintCmd::stopCmd failed");
1392-
// errlCommit(err, MDIA_COMP_ID);
1393-
// }
1394-
//}
1395-
1396-
//if(cmd && (flags & CLEANUP_CMD))
1397-
//{
1398-
// // restore any init settings that
1399-
// // may have been changed by the command
1400-
1401-
// fapi2::ReturnCode fapirc = cmd->cleanupCmd();
1402-
// err = fapi2::rcToErrl(fapirc);
1403-
// if(nullptr != err)
1404-
// {
1405-
// MDIA_ERR("sm: mss_MaintCmd::cleanupCmd failed");
1406-
// errlCommit(err, MDIA_COMP_ID);
1407-
// }
1408-
//}
1409-
1410-
//if(cmd && (flags & DELETE_CMD))
1411-
//{
1412-
// delete cmd;
1413-
//}
1385+
mss_MaintCmd * cmd = static_cast<mss_MaintCmd *>(wfp.data);
1386+
1387+
if(cmd && (flags & STOP_CMD))
1388+
{
1389+
MDIA_FAST("sm: stopping command: %p", target);
1390+
1391+
fapi2::ReturnCode fapirc = cmd->stopCmd();
1392+
err = fapi2::rcToErrl(fapirc);
1393+
1394+
if (nullptr != err)
1395+
{
1396+
MDIA_ERR("sm: mss_MaintCmd::stopCmd failed");
1397+
errlCommit(err, MDIA_COMP_ID);
1398+
}
1399+
}
1400+
1401+
if(cmd && (flags & CLEANUP_CMD))
1402+
{
1403+
// restore any init settings that
1404+
// may have been changed by the command
1405+
1406+
fapi2::ReturnCode fapirc = cmd->cleanupCmd();
1407+
err = fapi2::rcToErrl(fapirc);
1408+
if(nullptr != err)
1409+
{
1410+
MDIA_ERR("sm: mss_MaintCmd::cleanupCmd failed");
1411+
errlCommit(err, MDIA_COMP_ID);
1412+
}
1413+
}
1414+
1415+
if(cmd && (flags & DELETE_CMD))
1416+
{
1417+
delete cmd;
1418+
}
14141419
}
14151420
//target type is MCBIST
14161421
else

0 commit comments

Comments
 (0)