summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2012-09-17 13:55:49 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-10-10 10:33:33 -0500
commit167b115362297b549ac9459b5301698ee2a86b4f (patch)
tree71080bcc0196cc4887bd7744c5230fe9a23c3657 /src
parent161d42331b54abd6a101d7cfe934e35639447d72 (diff)
downloadtalos-hostboot-167b115362297b549ac9459b5301698ee2a86b4f.tar.gz
talos-hostboot-167b115362297b549ac9459b5301698ee2a86b4f.zip
HWAS: Apply Partial Good to targets
New HWAS Platform function platReadPartialGood() will be called by HWAS common function discoverTargets(). The platReadPartialGood() will query the VPD for the PG keyword of the CP00 record, and return the vector. The discoverTargets() function will then parse the record to determine which chiplets should be marked functional or not, based on the values in the PG vector. Change-Id: If29d18a80f8703cc87394cf07d152918957ffd37 RTC: 35078 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1852 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Mark W. Wenning <wenning@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/hwas/common/hwas.H49
-rw-r--r--src/include/usr/hwas/common/hwasCommon.H43
-rw-r--r--src/include/usr/hwas/hwasPlatTrace.H3
-rw-r--r--src/usr/hwas/common/hwas.C208
-rw-r--r--src/usr/hwas/hwasPlat.C86
-rw-r--r--src/usr/hwas/test/hwas1test.H152
6 files changed, 445 insertions, 96 deletions
diff --git a/src/include/usr/hwas/common/hwas.H b/src/include/usr/hwas/common/hwas.H
index d1f56885e..2ea3f0350 100644
--- a/src/include/usr/hwas/common/hwas.H
+++ b/src/include/usr/hwas/common/hwas.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwas/hwas.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwas/common/hwas.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __HWAS_HWAS_H
#define __HWAS_HWAS_H
/**
@@ -65,8 +65,9 @@ errlHndl_t initHardware();
*
* Then call into the hwas platform-specific platPresenceDetect() function
* to read the hardware information, and apply it to the target states,
- * and call into the hwas platform-specifiction platReadIDEC() function
- * to get and set the ChipID and EC values.
+ * and call into the hwas platform-specific functions:
+ * platReadIDEC() to get and set the ChipID and EC values.
+ * platReadPartialGood() to get and set the partial good vector.
*
* @param none
*
diff --git a/src/include/usr/hwas/common/hwasCommon.H b/src/include/usr/hwas/common/hwasCommon.H
index 00eab2f55..547531ca8 100644
--- a/src/include/usr/hwas/common/hwasCommon.H
+++ b/src/include/usr/hwas/common/hwasCommon.H
@@ -74,6 +74,49 @@ errlHndl_t platPresenceDetect(TARGETING::TargetHandleList &io_targets);
*/
errlHndl_t platReadIDEC(const TARGETING::TargetHandle_t &i_target);
+/**
+ * @brief platform specific code to determine the PG vector of the input
+ * target. The platform specific code is responsible for returning the
+ * vector. The caller is reponsible for allocating and de-allocating the space.
+ *
+ * @param[in] i_target target to check for chip ID/EC
+ * @param[out] o_pgData pointer to area that will hold the partialGood vector
+ * read from VPD; must be malloc'ed by the caller,
+ * and must be VPD_CP00_PG_DATA_LENGTH in size.
+ *
+ * @return errlHndl_t valid errlHndl_t handle if there was an error
+ * NULL if no errors;
+ */
+errlHndl_t platReadPartialGood(const TARGETING::TargetHandle_t &i_target,
+ void *o_pgData);
+
+// constants the platReadPartialGood will use for looking at the VPD data
+const uint32_t VPD_CP00_PG_DATA_LENGTH = 64;
+const uint32_t VPD_CP00_PG_HDR_LENGTH = 1;
+
+// components of the partial good vector
+const uint32_t VPD_CP00_PG_PIB_INDEX = 0;
+const uint32_t VPD_CP00_PG_PIB_GOOD = 0x0000;
+
+const uint32_t VPD_CP00_PG_PERVASIVE_INDEX = 1;
+const uint32_t VPD_CP00_PG_PERVASIVE_GOOD = 0xF180;
+
+const uint32_t VPD_CP00_PG_POWERBUS_INDEX = 2;
+const uint32_t VPD_CP00_PG_POWERBUS_GOOD = 0xFC00;
+
+const uint32_t VPD_CP00_PG_XBUS_INDEX = 4;
+const uint32_t VPD_CP00_PG_XBUS_GOOD = 0xF000;
+
+const uint32_t VPD_CP00_PG_ABUS_INDEX = 8;
+const uint32_t VPD_CP00_PG_ABUS_GOOD = 0xE100;
+
+const uint32_t VPD_CP00_PG_PCIE_INDEX = 9;
+const uint32_t VPD_CP00_PG_PCIE_GOOD = 0xF700;
+
+const uint32_t VPD_CP00_PG_EX0_INDEX = 16;
+const uint32_t VPD_CP00_PG_EX0_GOOD = 0xF300;
+
+
} // namespace HWAS
#endif // HWASCOMMON_H_
diff --git a/src/include/usr/hwas/hwasPlatTrace.H b/src/include/usr/hwas/hwasPlatTrace.H
index fcabb9ba6..54077bf67 100644
--- a/src/include/usr/hwas/hwasPlatTrace.H
+++ b/src/include/usr/hwas/hwasPlatTrace.H
@@ -48,6 +48,9 @@ namespace HWAS
#define HWAS_DBG(_fmt_, _args_...) \
TRACDCOMP(g_trac_dbg_hwas, TRACE_FILENAME _fmt_, ##_args_)
+#define HWAS_DBG_BIN(_str_, _addr_, _len_) \
+ TRACDBIN(g_trac_dbg_hwas, TRACE_FILENAME _str_, _addr_, _len_)
+
// Information traces (go into slow trace buffer that should not wrap often)
#define HWAS_INF(_fmt_, _args_...) \
TRACFCOMP(g_trac_imp_hwas, TRACE_FILENAME _fmt_, ##_args_)
diff --git a/src/usr/hwas/common/hwas.C b/src/usr/hwas/common/hwas.C
index a89bd4bc7..df9997d76 100644
--- a/src/usr/hwas/common/hwas.C
+++ b/src/usr/hwas/common/hwas.C
@@ -58,15 +58,17 @@ TRAC_INIT(&g_trac_imp_hwas, "HWAS_I", 1024 );
* present, functional
*
* @param[in] i_target pointer to target that we're looking at
+ * @param[in] i_present boolean indicating present or not
+ * @param[in] i_functional boolean indicating functional or not
*
* @return none
*
*/
-void enableHwasState(Target *i_target, bool i_functional)
+void enableHwasState(Target *i_target, bool i_present, bool i_functional)
{
HwasState hwasState = i_target->getAttr<ATTR_HWAS_STATE>();
hwasState.poweredOn = true;
- hwasState.present = true;
+ hwasState.present = i_present;
hwasState.functional = i_functional;
i_target->setAttr<ATTR_HWAS_STATE>( hwasState );
}
@@ -103,12 +105,13 @@ errlHndl_t discoverTargets()
Target* pSys;
targetService().getTopLevelTarget(pSys);
- HWAS_ASSERT(pSys, "HWAS discoverTargets: no CLASS_SYS TopLevelTarget found");
+ HWAS_ASSERT(pSys,
+ "HWAS discoverTargets: no CLASS_SYS TopLevelTarget found");
// mark this as present
- enableHwasState(pSys, true);
- HWAS_DBG("pSys %.8X (%p) - marked present",
- pSys->getAttr<ATTR_HUID>(), pSys);
+ enableHwasState(pSys, true, true);
+ HWAS_DBG("pSys %.8X - marked present",
+ pSys->getAttr<ATTR_HUID>());
// find CLASS_ENC
PredicateCTM predEnc(CLASS_ENC);
@@ -123,9 +126,9 @@ errlHndl_t discoverTargets()
TargetHandle_t pEnc = *pEnc_it;
// mark it as present
- enableHwasState(pEnc, true);
- HWAS_DBG("pEnc %.8X (%p) - marked present",
- pEnc->getAttr<ATTR_HUID>(), pEnc);
+ enableHwasState(pEnc, true, true);
+ HWAS_DBG("pEnc %.8X - marked present",
+ pEnc->getAttr<ATTR_HUID>());
} // for pEnc_it
PredicateCTM predChip(CLASS_CHIP);
@@ -150,7 +153,9 @@ errlHndl_t discoverTargets()
// no errors - keep going
// for each, read their ID/EC level. if that works,
- // mark them and their descendants as present and functional
+ // mark them and their descendants as present
+ // read the partialGood vector to determine if any are not functional
+
for (TargetHandleList::iterator pTarget_it = pCheckPres.begin();
pTarget_it != pCheckPres.end();
pTarget_it++
@@ -158,35 +163,90 @@ errlHndl_t discoverTargets()
{
TargetHandle_t pTarget = *pTarget_it;
- // read Chip ID/EC data from these physical chips
+ bool chipFunctional = true;
+ bool chipPresent = true;
+ uint16_t pgData[VPD_CP00_PG_DATA_LENGTH / sizeof(uint16_t)];
+ bzero(pgData, sizeof(pgData));
if (pTarget->getAttr<ATTR_CLASS>() == CLASS_CHIP)
{
+ // read Chip ID/EC data from these physical chips
errl = platReadIDEC(pTarget);
- }
- bool isFunctional;
- if (!errl)
- { // no error
- isFunctional = true;
- }
- else
- { // read of ID/EC failed even tho we were present..
- isFunctional = false;
-
- // commit the error but keep going
- errlCommit(errl, HWAS_COMP_ID);
- // errl is now NULL
- }
-
- HWAS_DBG("pTarget %.8X (%p) - detected present %s functional",
- pTarget->getAttr<ATTR_HUID>(), pTarget,
- isFunctional ? "and" : "NOT");
-
- // set HWAS state to show it's present
- enableHwasState(pTarget, isFunctional);
+ if (errl)
+ { // read of ID/EC failed even tho we were present..
+ chipFunctional = false;
+
+ // commit the error but keep going
+ errlCommit(errl, HWAS_COMP_ID);
+ // errl is now NULL
+ }
+
+ if (pTarget->getAttr<ATTR_TYPE>() == TYPE_PROC)
+ {
+ // read partialGood vector from these as well.
+ errl = platReadPartialGood(pTarget, pgData);
+
+ if (errl)
+ { // read of PG failed even tho we were present..
+ chipFunctional = false;
+
+ // commit the error but keep going
+ errlCommit(errl, HWAS_COMP_ID);
+ // errl is now NULL
+ }
+ else
+ // look at the 'nest' logic to override the functionality
+ // of this proc
+ if (pgData[VPD_CP00_PG_PIB_INDEX] !=
+ VPD_CP00_PG_PIB_GOOD)
+ {
+ HWAS_DBG("pTarget %.8X - PIB bad. "
+ "pgPdata[%d]: expected 0x%04X - bad",
+ pTarget->getAttr<ATTR_HUID>(),
+ VPD_CP00_PG_PIB_INDEX,
+ VPD_CP00_PG_PIB_GOOD);
+ chipFunctional = false;
+ }
+ else
+ if (pgData[VPD_CP00_PG_PERVASIVE_INDEX] !=
+ VPD_CP00_PG_PERVASIVE_GOOD)
+ {
+ HWAS_DBG("pTarget %.8X - Pervasive bad. "
+ "pgPdata[%d]: expected 0x%04X - bad",
+ pTarget->getAttr<ATTR_HUID>(),
+ VPD_CP00_PG_PERVASIVE_INDEX,
+ VPD_CP00_PG_PERVASIVE_GOOD);
+ chipFunctional = false;
+ }
+ else
+ if (pgData[VPD_CP00_PG_POWERBUS_INDEX] !=
+ VPD_CP00_PG_POWERBUS_GOOD)
+ {
+ HWAS_DBG("pTarget %.8X - PowerBus bad. "
+ "pgPdata[%d]: expected 0x%04X - bad",
+ pTarget->getAttr<ATTR_HUID>(),
+ VPD_CP00_PG_POWERBUS_INDEX,
+ VPD_CP00_PG_POWERBUS_GOOD);
+ chipFunctional = false;
+ }
+ } // TYPE_PROC
+ } // CLASS_CHIP
+
+ // TODO: Story 35077 - add PR processing. roughly:
+ // totalcores = readPR();
+ // for each child ex in chip c
+ // if goodcores < totalcores
+ // if ex->functional==true
+ // goodcores++
+ // else
+ // ex->functional = false
+
+ HWAS_DBG("pTarget %.8X - detected present, %sfunctional",
+ pTarget->getAttr<ATTR_HUID>(),
+ chipFunctional ? "" : "NOT ");
// now need to mark all of this target's
- // physical descendants as present and NOT functional
+ // physical descendants as present and functional as appropriate
TargetHandleList pDescList;
targetService().getAssociated( pDescList, pTarget,
TargetService::CHILD, TargetService::ALL);
@@ -195,11 +255,85 @@ errlHndl_t discoverTargets()
pDesc_it++)
{
TargetHandle_t pDesc = *pDesc_it;
- enableHwasState(pDesc, isFunctional);
- HWAS_DBG("pDesc %.8X (%p) - marked present %s functional",
- pDesc->getAttr<ATTR_HUID>(), pDesc,
- isFunctional ? "and" : "NOT");
+ // by default, the descendant's functionality is 'inherited'
+ bool descFunctional = chipFunctional;
+
+ if (chipFunctional)
+ { // if the chip is functional, the look through the
+ // partialGood vector to see if its chiplets
+ // are functional
+ if ((pDesc->getAttr<ATTR_TYPE>() == TYPE_XBUS) &&
+ (pgData[VPD_CP00_PG_XBUS_INDEX] !=
+ VPD_CP00_PG_XBUS_GOOD))
+ {
+ HWAS_DBG("pDesc %.8X - XBUS bad. "
+ "pgPdata[%d]: expected 0x%04X - bad",
+ pDesc->getAttr<ATTR_HUID>(),
+ VPD_CP00_PG_XBUS_INDEX,
+ VPD_CP00_PG_XBUS_GOOD);
+ descFunctional = false;
+ }
+ else
+ if ((pDesc->getAttr<ATTR_TYPE>() == TYPE_ABUS) &&
+ (pgData[VPD_CP00_PG_ABUS_INDEX] !=
+ VPD_CP00_PG_ABUS_GOOD))
+ {
+ HWAS_DBG("pDesc %.8X - ABUS "
+ "pgPdata[%d]: expected 0x%04X - bad",
+ pDesc->getAttr<ATTR_HUID>(),
+ VPD_CP00_PG_ABUS_INDEX,
+ VPD_CP00_PG_ABUS_GOOD);
+ descFunctional = false;
+ }
+ else
+ if ((pDesc->getAttr<ATTR_TYPE>() == TYPE_PCI) &&
+ (pgData[VPD_CP00_PG_PCIE_INDEX] !=
+ VPD_CP00_PG_PCIE_GOOD))
+ {
+ HWAS_DBG("pDesc %.8X - PCIe "
+ "pgPdata[%d]: expected 0x%04X - bad",
+ pDesc->getAttr<ATTR_HUID>(),
+ VPD_CP00_PG_PCIE_INDEX,
+ VPD_CP00_PG_PCIE_GOOD);
+ descFunctional = false;
+ }
+ else
+ if ((pDesc->getAttr<ATTR_TYPE>() == TYPE_EX) ||
+ (pDesc->getAttr<ATTR_TYPE>() == TYPE_CORE)
+ )
+ {
+ ATTR_CHIP_UNIT_type indexEX =
+ pDesc->getAttr<ATTR_CHIP_UNIT>();
+ if (pgData[VPD_CP00_PG_EX0_INDEX + indexEX] !=
+ VPD_CP00_PG_EX0_GOOD)
+ {
+ HWAS_DBG("pDesc %.8X - EX%d "
+ "pgPdata[%d]: expected 0x%04X - bad",
+ pDesc->getAttr<ATTR_HUID>(), indexEX,
+ VPD_CP00_PG_EX0_INDEX + indexEX,
+ VPD_CP00_PG_EX0_GOOD);
+////////////////////////////////////////////////////////////////////////////////
+ // RTC: 49991 for now, return true because the VPD in
+ // hostboot is broken (has 0xF200 instead of 0xF300,
+ // and has the last 6 cores in the incorrect place)
+ descFunctional = true;
+ //descFunctional = false;
+////////////////////////////////////////////////////////////////////////////////
+ }
+ }
+ } // chipFunctional
+
+ // for sub-parts, if it's not functional, it's not present.
+ enableHwasState(pDesc, descFunctional, descFunctional);
+ 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
+ enableHwasState(pTarget, chipPresent, chipFunctional);
+
} // for pTarget_it
} while (0);
diff --git a/src/usr/hwas/hwasPlat.C b/src/usr/hwas/hwasPlat.C
index 950276993..0f1377ede 100644
--- a/src/usr/hwas/hwasPlat.C
+++ b/src/usr/hwas/hwasPlat.C
@@ -33,6 +33,8 @@
#include <devicefw/driverif.H>
#include <initservice/taskargs.H>
+#include <mvpd/mvpdenums.H>
+#include <stdio.h>
namespace HWAS
{
@@ -85,19 +87,83 @@ errlHndl_t platReadIDEC(const TargetHandle_t &i_target)
((id_ec & 0x000F000000000000ull) >> 44) |
((id_ec & 0x0000F00000000000ull) >> 44));
i_target->setAttr<ATTR_CHIP_ID>(id);
- HWAS_DBG( "i_target %.8X (%p) - id %x ec %x",
- i_target->getAttr<ATTR_HUID>(), i_target, id, ec);
+ HWAS_DBG( "i_target %.8X - id %x ec %x",
+ i_target->getAttr<ATTR_HUID>(), id, ec);
}
else
{ // errl was set - this is an error condition.
- HWAS_ERR( "i_target %.8X (%p) - failed ID/EC read",
- i_target->getAttr<ATTR_HUID>(), i_target);
+ HWAS_ERR( "i_target %.8X - failed ID/EC read",
+ i_target->getAttr<ATTR_HUID>());
}
return errl;
} // platReadIDEC
//******************************************************************************
+// platReadPartialGood function
+//******************************************************************************
+errlHndl_t platReadPartialGood(const TargetHandle_t &i_target,
+ void *o_pgData)
+{
+ errlHndl_t errl = NULL;
+ HWAS_DBG( "i_target %.8X",
+ i_target->getAttr<ATTR_HUID>());
+
+ // call deviceRead() to find the PartialGood record
+ uint8_t pgRaw[VPD_CP00_PG_HDR_LENGTH + VPD_CP00_PG_DATA_LENGTH];
+ size_t pgSize = sizeof(pgRaw);
+
+ errl = deviceRead(i_target, pgRaw, pgSize,
+ DEVICE_MVPD_ADDRESS(MVPD::CP00, MVPD::PG));
+
+ if (unlikely(errl != NULL))
+ { // errl was set - this is an error condition.
+ HWAS_ERR( "i_target %.8X - failed partialGood read",
+ i_target->getAttr<ATTR_HUID>());
+ }
+ else
+ {
+#if 0
+// Unit test. set P8_MURANO.config to have 4 procs, and this code will
+// alter the VPD so that some of the procs and chiplets should get marked
+// as NOT functional.
+ {
+ // skip past the header
+ uint16_t *pgData = reinterpret_cast <uint16_t *>(&pgRaw[VPD_CP00_PG_HDR_LENGTH]);
+ if (i_target->getAttr<ATTR_HUID>() == 0x70000)
+ { // 1st proc - let it go thru ok.
+ }
+ else
+ if (i_target->getAttr<ATTR_HUID>() == 0x70001)
+ { // 2nd proc - mark Pervasive bad - entire chip
+ // should be marked present and NOT functional
+ pgData[VPD_CP00_PG_PERVASIVE_INDEX] = 0;
+ }
+ else
+ if (i_target->getAttr<ATTR_HUID>() == 0x70002)
+ { // 3rd proc - part of XBUS is bad
+ pgData[VPD_CP00_PG_XBUS_INDEX] = 0;
+ }
+ else
+ if (i_target->getAttr<ATTR_HUID>() == 0x70003)
+ { // 4th proc - EX13 and EX14 are bad
+ pgData[VPD_CP00_PG_EX0_INDEX+13] = 0;
+ pgData[VPD_CP00_PG_EX0_INDEX+14] = 0;
+ }
+ }
+#endif
+
+ // skip past the header
+ void *pgData = static_cast<void *>(&pgRaw[VPD_CP00_PG_HDR_LENGTH]);
+ HWAS_DBG_BIN("PG record", pgData, VPD_CP00_PG_DATA_LENGTH);
+ // copy the data back into the caller's buffer
+ memcpy(o_pgData, pgData, VPD_CP00_PG_DATA_LENGTH);
+ }
+
+ return errl;
+} // platReadPartialGood
+
+//******************************************************************************
// platPresenceDetect function
//******************************************************************************
errlHndl_t platPresenceDetect(TargetHandleList &io_targets)
@@ -120,8 +186,8 @@ errlHndl_t platPresenceDetect(TargetHandleList &io_targets)
if (unlikely(errl != NULL))
{ // errl was set - this is an error condition.
- HWAS_ERR( "pTarget %.8X (%p) - failed presence detect",
- pTarget->getAttr<ATTR_HUID>(), pTarget);
+ HWAS_ERR( "pTarget %.8X - failed presence detect",
+ pTarget->getAttr<ATTR_HUID>());
// commit the error but keep going
errlCommit(errl, HWAS_COMP_ID);
@@ -133,16 +199,16 @@ errlHndl_t platPresenceDetect(TargetHandleList &io_targets)
if (present == true)
{
- HWAS_DBG( "pTarget %.8X (%p) - detected present",
- pTarget->getAttr<ATTR_HUID>(), pTarget);
+ HWAS_DBG( "pTarget %.8X - detected present",
+ pTarget->getAttr<ATTR_HUID>());
// advance to next entry in the list
pTarget_it++;
}
else
{ // chip not present -- remove from list
- HWAS_DBG( "pTarget %.8X (%p) - no presence",
- pTarget->getAttr<ATTR_HUID>(), pTarget);
+ HWAS_DBG( "pTarget %.8X - no presence",
+ pTarget->getAttr<ATTR_HUID>());
// erase this target, and 'increment' to next
pTarget_it = io_targets.erase(pTarget_it);
diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H
index 168aeba15..b541a0aff 100644
--- a/src/usr/hwas/test/hwas1test.H
+++ b/src/usr/hwas/test/hwas1test.H
@@ -1,33 +1,32 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/hwas/test/hwas1test.H $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2011-2012
- *
- * p1
- *
- * Object Code Only (OCO) source materials
- * Licensed Internal Code Source Materials
- * IBM HostBoot Licensed Internal Code
- *
- * The source code for this program is not published or other-
- * wise divested of its trade secrets, irrespective of what has
- * been deposited with the U.S. Copyright Office.
- *
- * Origin: 30
- *
- * IBM_PROLOG_END_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwas/test/hwas1test.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __TESTTARGETING_H
#define __TESTTARGETING_H
/**
* @file testtargeting.H
*
- * @brief Unit tests for HWAS (ISTEP 4)
+ * @brief Unit tests for HWAS
*/
//******************************************************************************
@@ -46,7 +45,8 @@
#include <fapiAttributeService.H>
#include <errl/errlmanager.H>
-// This component
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
#include <targeting/common/commontargeting.H>
class HWAS1test: public CxxTest::TestSuite
@@ -148,6 +148,108 @@ public:
TS_TRACE( "testHWASReadWrite exit" );
}
+ /**
+ * @brief test platReadIDEC
+ */
+ void testHWASplatReadIDEC()
+ {
+ using namespace TARGETING;
+
+ TS_TRACE( "testHWASplatReadIDEC entry" );
+
+ // call platReadIDEC with target that doesn't have an ID/EC
+ errlHndl_t l_errl;
+
+ Target* pSys;
+ targetService().getTopLevelTarget(pSys);
+
+ l_errl = HWAS::platReadIDEC(pSys);
+
+ if (l_errl)
+ {
+ // error log is expected case, delete it
+ delete l_errl;
+ }
+ else
+ {
+ TS_FAIL("testHWASplatReadIDEC>"
+ "No error from platReadIDEC(pSys).");
+ }
+
+ TS_TRACE( "testHWASplatReadIDEC exit" );
+ }
+
+ /**
+ * @brief test platReadPartialGood
+ */
+ void testHWASplatReadPartialGood()
+ {
+ using namespace TARGETING;
+
+ TS_TRACE( "testHWASplatReadPartialGood entry" );
+
+ // call platReadPartialGood with target that isn't in the VPD
+ errlHndl_t l_errl;
+
+ Target* pSys;
+ targetService().getTopLevelTarget(pSys);
+ uint8_t pgData[64];
+
+ l_errl = HWAS::platReadPartialGood(pSys, pgData);
+
+ if (l_errl)
+ {
+ // error log is expected case, delete it
+ delete l_errl;
+ }
+ else
+ {
+ TS_FAIL("testHWASplatReadPartialGood>"
+ "No error from platReadPartialGood(pSys).");
+ }
+
+ TS_TRACE( "testHWASplatReadPartialGood exit" );
+ }
+
+ /**
+ * @brief test platPresenceDetect
+ */
+ void testHWASplatPresenceDetect()
+ {
+ using namespace TARGETING;
+ using namespace HWAS;
+
+ TS_TRACE( "testHWASplatPresenceDetect entry" );
+
+ // call platPresenceDetect with target that won't return PRESENT
+ errlHndl_t l_errl;
+
+ TargetHandleList pCheckPres;
+ Target* pSys;
+ targetService().getTopLevelTarget(pSys);
+ pCheckPres.push_back(pSys);
+
+ l_errl = HWAS::platPresenceDetect(pCheckPres);
+
+ if (l_errl)
+ {
+ TS_FAIL("testHWASplatPresenceDetect>"
+ "Error from platPresenceDetect.");
+ }
+ else
+ {
+ // check to make sure list returned is now empty
+ if (pCheckPres.size() != 0)
+ {
+ TS_FAIL("testHWASplatPresenceDetect>"
+ "platPresenceDetect didn't return empty list");
+ }
+ }
+
+ TS_TRACE( "testHWASplatPresenceDetect exit" );
+ }
+
+
};
#endif //
OpenPOWER on IntegriCloud