diff options
author | Bill Hoffa <wghoffa@us.ibm.com> | 2017-01-06 14:03:09 -0600 |
---|---|---|
committer | Matthew A. Ploetz <maploetz@us.ibm.com> | 2017-01-12 16:25:54 -0500 |
commit | caba5e2793fe5c021fead24b2157dc03d5b9133b (patch) | |
tree | cd9d750679d563a641b659abb791239c0ba2fac7 /src/usr | |
parent | 42013d80fce1c1e4386cda63c9c7115382f3c4eb (diff) | |
download | talos-hostboot-caba5e2793fe5c021fead24b2157dc03d5b9133b.tar.gz talos-hostboot-caba5e2793fe5c021fead24b2157dc03d5b9133b.zip |
Deconfig PHB targets when PEC target not in PG
Change-Id: I2ad6c28c3e91e4878aec150352bed2859de3efa7
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34513
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/hwas/common/hwas.C | 24 | ||||
-rw-r--r-- | src/usr/hwas/test/hwas1test.H | 54 |
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); |