diff options
author | Lateef Quraishi <lateef@us.ibm.com> | 2016-08-25 17:23:33 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-09-02 10:07:18 -0400 |
commit | d85d7b3c2deecb0bb717084edba4168f8094679d (patch) | |
tree | 79198bdf41843be410e989a6f5680b9aa6f68cfd /src/usr/hwas | |
parent | e4866856c7642d1ae8c6ec4b9cf9d2042ecef103 (diff) | |
download | talos-hostboot-d85d7b3c2deecb0bb717084edba4168f8094679d.tar.gz talos-hostboot-d85d7b3c2deecb0bb717084edba4168f8094679d.zip |
Drive PERV target existence based on blueprint, not PG
Corrected wrong Proc 1 PERV HUIDs
Change-Id: I030585f9cc11fbd76d5a0d5fd2926a31090f3f76
RTC: 159350
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28821
Tested-by: Jenkins Server <pfd-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/hwas')
-rw-r--r-- | src/usr/hwas/common/hwas.C | 26 | ||||
-rw-r--r-- | src/usr/hwas/test/hwas1test.H | 90 |
2 files changed, 110 insertions, 6 deletions
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C index ec565272c..64f248dac 100644 --- a/src/usr/hwas/common/hwas.C +++ b/src/usr/hwas/common/hwas.C @@ -405,13 +405,27 @@ errlHndl_t discoverTargets() descFunctional = isDescFunctional(pDesc, pgData); } - // for sub-parts, if it's not functional, it's not present. - enableHwasState(pDesc, descFunctional, descFunctional, + if (pDesc->getAttr<ATTR_TYPE>() == TYPE_PERV) + { + // for sub-parts of PERV, it's always present. + enableHwasState(pDesc, chipFunctional, descFunctional, + errlEid); + HWAS_DBG("pDesc %.8X - marked %spresent, %sfunctional", + pDesc->getAttr<ATTR_HUID>(), + "", + descFunctional ? "" : "NOT "); + } + else + { + // for other sub-parts, if it's not functional, + // it's not present. + enableHwasState(pDesc, descFunctional, descFunctional, errlEid); - HWAS_DBG("pDesc %.8X - marked %spresent, %sfunctional", - pDesc->getAttr<ATTR_HUID>(), - descFunctional ? "" : "NOT ", - descFunctional ? "" : "NOT "); + HWAS_DBG("pDesc %.8X - marked %spresent, %sfunctional", + pDesc->getAttr<ATTR_HUID>(), + descFunctional ? "" : "NOT ", + descFunctional ? "" : "NOT "); + } } // set HWAS state to show CHIP is present, functional per above diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H index 1f24dadd0..4ad8e49a8 100644 --- a/src/usr/hwas/test/hwas1test.H +++ b/src/usr/hwas/test/hwas1test.H @@ -1303,6 +1303,96 @@ public: TS_TRACE( "testHWASrestrictECunits exit" ); } + /** + * @brief test pervStates + */ + void testHWASpervStates() + { + using namespace HWAS; + using namespace TARGETING; + + // find top level target + Target * pSys; + targetService().getTopLevelTarget(pSys); + + PredicateCTM predChip(CLASS_CHIP); + PredicateCTM predPerv(CLASS_UNIT, TYPE_PERV); + PredicatePostfixExpr checkExpr; + checkExpr.push(&predChip).Or().push(&predPerv).Or(); + + TargetHandleList pPervList; + // get list of all PERV targets + targetService().getAssociated( pPervList, pSys, + TargetService::CHILD, + TargetService::ALL, + &predPerv ); + // sort the list by ATTR_HUID to ensure that we + // start at the same place each time + std::sort(pPervList.begin(), pPervList.end(), + compareTargetHuid); + do + { + if (pPervList.empty()) + { + TS_FAIL("testHWASpervStates: empty pPervList"); + break; + } + // Iterate through all PERV chiplets + for (TargetHandleList::const_iterator + l_pervIter = pPervList.begin(); + l_pervIter != pPervList.end(); + ++l_pervIter) + { + Target * l_target = *l_pervIter; + + // The chip unit number of the perv target + // is the index into the PG data + ATTR_CHIP_UNIT_type chip_unit = + l_target->getAttr<ATTR_CHIP_UNIT>(); + + // get the HW State of the target + HwasState hwasState = l_target->getAttr<ATTR_HWAS_STATE>(); + + // get parent target and the HW state + const Target * l_ptarget; + l_ptarget = getParentChip(l_target); + HwasState phwasState = l_ptarget->getAttr<ATTR_HWAS_STATE>(); + + if (phwasState.present == true) + { + if (hwasState.present == false) + { + TS_FAIL("testHWASpervStates: PERV[%d] HUID: %.8X - is NOT Present", + chip_unit, + l_target->getAttr<ATTR_HUID>()); + break; + } + HWAS_DBG("PERV[%d]: HUID: %.8X - %spresent, %sfunctional", + chip_unit, + l_target->getAttr<ATTR_HUID>(), + hwasState.present ? "" : "NOT ", + hwasState.functional ? "" : "NOT "); + } + else + { + if (hwasState.present == true) + { + TS_FAIL("testHWASpervStates: PERV[%d] HUID: %.8X - is Present and Parent is NOT", + chip_unit, + l_target->getAttr<ATTR_HUID>()); + break; + } + HWAS_DBG("PERV[%d]: HUID: %.8X - %spresent, %sfunctional", + chip_unit, + l_target->getAttr<ATTR_HUID>(), + hwasState.present ? "" : "NOT ", + hwasState.functional ? "" : "NOT "); + } + } + } while(0); + + TS_TRACE( "testHWASpervStates exit" ); + } }; #endif // |