summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2017-05-04 11:42:10 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-05-23 14:04:43 -0400
commit7ab9a90ab7fdf2a336ef327379001133d52d64ba (patch)
tree153000ab6c75cc8ce179c075efe14092bada1f6e /src/usr
parent6d153811271a104cd4471633e19d8b51c664fe5d (diff)
downloadtalos-hostboot-7ab9a90ab7fdf2a336ef327379001133d52d64ba.tar.gz
talos-hostboot-7ab9a90ab7fdf2a336ef327379001133d52d64ba.zip
deconfing/gard of OBUS_BRICK/NPU targets
Change-Id: I1388859a81ba8b2e040f6d136eafcf50f1f138ba RTC:173738 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40218 Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwas/common/deconfigGard.C52
-rw-r--r--src/usr/hwas/common/hwas.C33
-rw-r--r--src/usr/hwas/test/hwas1test.H68
-rw-r--r--src/usr/targeting/common/Targets.pm7
-rw-r--r--src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml48
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/target_types.xml2
6 files changed, 198 insertions, 12 deletions
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C
index b9b1fbf04..6f1925b9c 100644
--- a/src/usr/hwas/common/deconfigGard.C
+++ b/src/usr/hwas/common/deconfigGard.C
@@ -1951,6 +1951,58 @@ void DeconfigGard::_deconfigureByAssoc(
break;
} // TYPE_PHB
+ case TYPE_OBUS_BRICK:
+ {
+ TargetHandleList pParentObusList;
+ getParentAffinityTargetsByState(pParentObusList, &i_target,
+ CLASS_UNIT, TYPE_OBUS, UTIL_FILTER_PRESENT);
+ HWAS_ASSERT((pParentObusList.size() == 1),
+ "HWAS _deconfigureByAssoc: pParentObusList != 1");
+
+ Target *l_parentObus = pParentObusList[0];
+ if ((isFunctional(l_parentObus)) &&
+ (!anyChildFunctional(*l_parentObus)))
+ {
+ _deconfigureTarget(*l_parentObus,
+ i_errlEid, NULL, i_deconfigRule);
+ _deconfigureByAssoc(*l_parentObus,
+ i_errlEid,i_deconfigRule);
+ }
+
+ break;
+ } // TYPE_OBUS_BRICK
+ case TYPE_NPU:
+ {
+ //Get the parent proc associated with this npu
+ auto l_proc = getParentChip(&i_target);
+
+ //Get all the obus brick children associated with this proc
+ PredicateCTM l_obrickFilter (CLASS_UNIT, TYPE_OBUS_BRICK);
+ PredicateHwas l_predPres;
+ l_predPres.present(true);
+ PredicatePostfixExpr l_presentObricks;
+ l_presentObricks.push(&l_obrickFilter).push(&l_predPres).And();
+
+ TargetHandleList l_obrickList;
+ targetService().getAssociated(l_obrickList, l_proc,
+ TargetService::CHILD_BY_AFFINITY,
+ TargetService::ALL, &l_presentObricks);
+
+ for (auto l_obrick : l_obrickList)
+ {
+ //deconfigure each obrick that is non-smp
+ if (l_obrick->getAttr<ATTR_OPTICS_CONFIG_MODE>() !=
+ OPTICS_CONFIG_MODE_SMP)
+ {
+ _deconfigureTarget(*l_obrick,
+ i_errlEid, NULL, i_deconfigRule);
+ _deconfigureByAssoc(*l_obrick,
+ i_errlEid,i_deconfigRule);
+ }
+ }
+
+ break;
+ } // TYPE_NPU
default:
// no action
break;
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C
index 764aa70f1..79d541bb6 100644
--- a/src/usr/hwas/common/hwas.C
+++ b/src/usr/hwas/common/hwas.C
@@ -989,17 +989,36 @@ bool isDescFunctional(const TARGETING::TargetHandle_t &i_desc,
else
if (i_desc->getAttr<ATTR_TYPE>() == TYPE_OBUS_BRICK)
{
+ //If NPU is bad and Bricks are non-SMP, then mark them bad
+ if ((i_desc->getAttr<ATTR_OPTICS_CONFIG_MODE>()
+ != OPTICS_CONFIG_MODE_SMP) &&
+ ((i_pgData[VPD_CP00_PG_N3_INDEX] & VPD_CP00_PG_N3_NPU) != 0))
+ {
+ HWAS_INF("pDesc %.8X - OBUS_BRICK pgData[%d]: "
+ "actual 0x%04X, expected 0x%04X - bad",
+ i_desc->getAttr<ATTR_HUID>(),
+ VPD_CP00_PG_N3_INDEX,
+ i_pgData[VPD_CP00_PG_N3_INDEX],
+ (i_pgData[VPD_CP00_PG_N3_INDEX] &
+ ~VPD_CP00_PG_N3_NPU));
+ l_descFunctional = false;
+
+ }
+ }
+ else
+ if (i_desc->getAttr<ATTR_TYPE>() == TYPE_NPU)
+ {
// Check NPU bit in N3 entry
if ((i_pgData[VPD_CP00_PG_N3_INDEX] &
VPD_CP00_PG_N3_NPU) != 0)
{
- HWAS_INF("pDesc %.8X - OBUS_BRICK pgData[%d]: "
- "actual 0x%04X, expected 0x%04X - bad",
- i_desc->getAttr<ATTR_HUID>(),
- VPD_CP00_PG_N3_INDEX,
- i_pgData[VPD_CP00_PG_N3_INDEX],
- (i_pgData[VPD_CP00_PG_N3_INDEX] &
- ~VPD_CP00_PG_N3_NPU));
+ HWAS_INF("pDesc %.8X - NPU pgData[%d]: "
+ "actual 0x%04X, expected 0x%04X - bad",
+ i_desc->getAttr<ATTR_HUID>(),
+ VPD_CP00_PG_N3_INDEX,
+ i_pgData[VPD_CP00_PG_N3_INDEX],
+ (i_pgData[VPD_CP00_PG_N3_INDEX] &
+ ~VPD_CP00_PG_N3_NPU));
l_descFunctional = false;
}
}
diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H
index f038e46e5..0eca4045a 100644
--- a/src/usr/hwas/test/hwas1test.H
+++ b/src/usr/hwas/test/hwas1test.H
@@ -48,7 +48,6 @@
#include <targeting/common/commontargeting.H>
#include <targeting/common/utilFilter.H>
-
// Buffer with all good data (CUMULUS chip)
const uint16_t pgDataAllGood[HWAS::VPD_CP00_PG_DATA_ENTRIES] =
{(uint16_t)HWAS::VPD_CP00_PG_FSI_GOOD,
@@ -702,6 +701,18 @@ public:
pgData[VPD_CP00_PG_OB0_INDEX + l_chipUnit]);
break;
+ case TYPE_OBUS_BRICK:
+ sprintf(l_type_str, "OBUS_BRICK");
+ sprintf(l_pgData, ", pgData = 0x%04x",
+ pgData[VPD_CP00_PG_N3_INDEX]);
+ break;
+
+ case TYPE_NPU:
+ sprintf(l_type_str, "NPU");
+ sprintf(l_pgData, ", pgData = 0x%04x",
+ pgData[VPD_CP00_PG_N3_INDEX]);
+ break;
+
case TYPE_PERV:
sprintf(l_type_str, "PERV");
sprintf(l_pgData, ", pgData = 0x%04x",
@@ -1412,8 +1423,59 @@ public:
break;
case TYPE_OBUS_BRICK:
+ {
+ //Two cases here:
+ //OBRICK==SMP --> Target should be present regardless of PG
+ //OBRICK!=SMP --> Target should follow PG
+ //marking PG bad
+ pgData[VPD_CP00_PG_N3_INDEX] |=
+ (uint16_t)VPD_CP00_PG_N3_NPU;
+
+ ATTR_OPTICS_CONFIG_MODE_type config_mode =
+ pDesc->getAttr<ATTR_OPTICS_CONFIG_MODE>();
+
+ if (OPTICS_CONFIG_MODE_SMP == config_mode)
+ {
+ //Calling with target set as SMP
+ TS_INFO( "testHWASisDescFunctional: "
+ "OBUS_BRICK PG is bad and target is SMP");
+
+ //Since SMP, should always be true, but fail test if false
+ if (!isDescFunctional(pDesc, pgData))
+ {
+ TS_FAIL("testHWASisDescFunctional>"
+ "functional = 0x%x, should be true because"
+ "OBUS_BRICK is SMP: PG = 0x%04x.",
+ isDescFunctional(pDesc, pgData),
+ pgData[VPD_CP00_PG_N3_INDEX]);
+ }
+ }
+ else
+ {
+ TS_INFO( "testHWASisDescFunctional: "
+ "OBUS_BRICK PG is bad and target is NVLINK");
+
+ //Since non-SMP, should return false, but fail test if true
+ if (isDescFunctional(pDesc, pgData))
+ {
+ TS_FAIL("testHWASisDescFunctional>"
+ "functional = 0x%x, should be false because"
+ "OBUS_BRICK is NVLINK: PG = 0x%04x.",
+ isDescFunctional(pDesc, pgData),
+ pgData[VPD_CP00_PG_N3_INDEX]);
+ }
+ }
+
+ //Setting PG back to good data
+ pgData[VPD_CP00_PG_N3_INDEX] =
+ (uint16_t)VPD_CP00_PG_N3_GOOD;
+
+ break;
+ }
+
+ case TYPE_NPU:
TS_INFO( "testHWASisDescFunctional: "
- "NV is not functional");
+ "NPU is not functional");
pgData[VPD_CP00_PG_N3_INDEX] |=
(uint16_t)VPD_CP00_PG_N3_NPU;
@@ -1421,7 +1483,7 @@ public:
{
TS_FAIL("testHWASisDescFunctional>"
"functional = 0x%x, should be false, "
- "NV = 0x%04x.",
+ "NPU = 0x%04x.",
isDescFunctional(pDesc, pgData),
pgData[VPD_CP00_PG_N3_INDEX]);
}
diff --git a/src/usr/targeting/common/Targets.pm b/src/usr/targeting/common/Targets.pm
index 2bdbedf06..f10e4bddb 100644
--- a/src/usr/targeting/common/Targets.pm
+++ b/src/usr/targeting/common/Targets.pm
@@ -41,7 +41,7 @@ use constant
PERVASIVE_PARENT_MCA_OFFSET => 7,
PERVASIVE_PARENT_PEC_OFFSET => 13,
PERVASIVE_PARENT_PHB_OFFSET => 13,
-
+ PERVASIVE_PARENT_NPU_OFFSET => 5,
NUM_PROCS_PER_GROUP => 4,
};
@@ -859,6 +859,7 @@ sub getFapiName
$nonFapiTargets{"TPM"} = "NA";
$nonFapiTargets{"NVBUS"} = "NA";
$nonFapiTargets{"OCC"} = "NA";
+ $nonFapiTargets{"NPU"} = "NA";
}
if ($nonFapiTargets{$target} eq "NA")
@@ -961,6 +962,10 @@ sub getPervasiveForUnit
$unitToPervasive{"OBUS_BRICK$obrick"}
= PERVASIVE_PARENT_OBUS_OFFSET + $offset;
}
+ for my $npu (0..$maxInstance{"NPU"}-1)
+ {
+ $unitToPervasive{"NPU$npu"} = PERVASIVE_PARENT_NPU_OFFSET;
+ }
}
my $pervasive = "";
diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
index 3a94aaf9c..ca63e2b18 100644
--- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
+++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
@@ -3277,6 +3277,10 @@
<default>0</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>SMP</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>0</default>
</attribute>
@@ -3310,6 +3314,10 @@
<default>1</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>SMP</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>1</default>
</attribute>
@@ -3343,6 +3351,10 @@
<default>2</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>SMP</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>2</default>
</attribute>
@@ -3376,6 +3388,10 @@
<default>9</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>NVLINK</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>9</default>
</attribute>
@@ -3409,6 +3425,10 @@
<default>10</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>NVLINK</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>10</default>
</attribute>
@@ -3442,6 +3462,10 @@
<default>11</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>NVLINK</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>11</default>
</attribute>
@@ -8664,6 +8688,10 @@
<default>12</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>SMP</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>12</default>
</attribute>
@@ -8697,6 +8725,10 @@
<default>13</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>SMP</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>13</default>
</attribute>
@@ -8730,6 +8762,10 @@
<default>14</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>SMP</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>14</default>
</attribute>
@@ -8763,6 +8799,10 @@
<default>15</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>NVLINK</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>15</default>
</attribute>
@@ -8796,6 +8836,10 @@
<default>16</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>NVLINK</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>16</default>
</attribute>
@@ -8829,6 +8873,10 @@
<default>17</default>
</attribute>
<attribute>
+ <id>OPTICS_CONFIG_MODE</id>
+ <default>NVLINK</default>
+ </attribute>
+ <attribute>
<id>CHIP_UNIT</id>
<default>17</default>
</attribute>
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index 86ac8ed04..b727c000a 100755
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -2205,7 +2205,7 @@
<default>0</default> <!-- GARD -->
</attribute>
<attribute><id>OBUS_BRICK_LANE_MASK</id></attribute>
- <attribute><id>OPTICS_CONFIG_MODE</id><default>SMP</default></attribute>
+ <attribute><id>OPTICS_CONFIG_MODE</id></attribute>
<attribute><id>PARENT_PERVASIVE</id></attribute>
</targetType>
OpenPOWER on IntegriCloud