summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/hwas/common/hwas.C24
-rw-r--r--src/usr/hwas/test/hwas1test.H54
2 files changed, 74 insertions, 4 deletions
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C
index 4b08ba6ac..fa0c16882 100644
--- a/src/usr/hwas/common/hwas.C
+++ b/src/usr/hwas/common/hwas.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -655,10 +655,28 @@ bool isDescFunctional(const TARGETING::TargetHandle_t &i_desc,
}
}
else
- if (i_desc->getAttr<ATTR_TYPE>() == TYPE_PEC)
+ if ((i_desc->getAttr<ATTR_TYPE>() == TYPE_PEC)
+ || (i_desc->getAttr<ATTR_TYPE>() == TYPE_PHB))
{
+ Target * l_targ = NULL;
+
+ if (i_desc->getAttr<ATTR_TYPE>() == TYPE_PHB)
+ {
+ //First get Parent PEC target as there are no PG bits for PHB
+ TargetHandleList pParentPECList;
+ getParentAffinityTargetsByState(pParentPECList, i_desc,
+ CLASS_UNIT, TYPE_PEC, UTIL_FILTER_ALL);
+ HWAS_ASSERT((pParentPECList.size() == 1),
+ "isDescFunctional(): pParentPECList != 1");
+ l_targ = pParentPECList[0];
+ }
+ else
+ {
+ l_targ = const_cast<TARGETING::Target*>(i_desc);
+ }
+
ATTR_CHIP_UNIT_type indexPCI =
- i_desc->getAttr<ATTR_CHIP_UNIT>();
+ l_targ->getAttr<ATTR_CHIP_UNIT>();
// Check all bits in PCIx entry
if (i_pgData[VPD_CP00_PG_PCI0_INDEX + indexPCI] !=
VPD_CP00_PG_PCIx_GOOD[indexPCI])
diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H
index 667d03a46..7dd7b70ed 100644
--- a/src/usr/hwas/test/hwas1test.H
+++ b/src/usr/hwas/test/hwas1test.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -911,7 +911,59 @@ public:
(uint16_t)VPD_CP00_PG_PCIx_GOOD[l_chipUnit];
}
break;
+ case TYPE_PHB:
+ {
+ TS_INFO( "testHWASisDescFunctional: "
+ "PCI%d is not functional for PHB target",
+ l_chipUnit);
+ //First get Parent PEC target as there are no PG bits
+ // for PHB
+ TargetHandleList pParentPECList;
+ getParentAffinityTargetsByState(pParentPECList, pDesc,
+ CLASS_UNIT, TYPE_PEC, UTIL_FILTER_PRESENT);
+ HWAS_ASSERT((pParentPECList.size() == 1),
+ "testHWASisDescFunctional(): pParentPECList != 1");
+ Target *l_parentPEC = pParentPECList[0];
+
+ //Check if parent PEC's PG Data marks it good
+ ATTR_CHIP_UNIT_type l_indexPCI =
+ l_parentPEC->getAttr<ATTR_CHIP_UNIT>();
+
+ for (l_mask = 0x8000;
+ l_mask > 0;
+ l_mask >>= 1)
+ {
+ if (pgData[VPD_CP00_PG_PCI0_INDEX + l_indexPCI] &
+ l_mask)
+ {
+ // Turn off a bit that should be on
+ pgData[VPD_CP00_PG_PCI0_INDEX + l_indexPCI] &=
+ ~l_mask;
+ }
+ else
+ {
+ // Turn on a bit that should be off
+ pgData[VPD_CP00_PG_PCI0_INDEX + l_indexPCI] |=
+ l_mask;
+ }
+ if (isDescFunctional(pDesc, pgData))
+ {
+ TS_FAIL("testHWASisDescFunctional>"
+ "functional = 0x%x, should be false, "
+ "PCI%d = 0x%04x, mask = 0x%04x",
+ isDescFunctional(pDesc, pgData),
+ l_indexPCI,
+ pgData[VPD_CP00_PG_PCI0_INDEX
+ + l_indexPCI],
+ l_mask);
+ }
+ // Restore the "all good" data
+ pgData[VPD_CP00_PG_PCI0_INDEX + l_indexPCI] =
+ (uint16_t)VPD_CP00_PG_PCIx_GOOD[l_indexPCI];
+ }
+ break;
+ }
case TYPE_EQ:
TS_INFO( "testHWASisDescFunctional: "
"EQ%d is not functional", l_chipUnit);
OpenPOWER on IntegriCloud