summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2012-05-30 15:18:33 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-06-11 15:22:24 -0500
commitfffa10e2abde6ee52b9d3dec77ca669867625d87 (patch)
tree433d15df7034cddb0f200e3528129aec67755a51 /src/usr/hwas
parent13bb136b9d635d3737ae270d8dc9c0924a5495cf (diff)
downloadtalos-hostboot-fffa10e2abde6ee52b9d3dec77ca669867625d87.tar.gz
talos-hostboot-fffa10e2abde6ee52b9d3dec77ca669867625d87.zip
HWAS code common between hostboot and FSP
Corrections to common and hostboot platform-specific code to make this code work for both hostboot and FSP. In addition, make printing of HUID consistant with other previous changes. Also, added hwas/common files to fsp distribution tools so that they are included in the fsp.tar for common usage. Change-Id: Ia761606ab446dd794bf8e112430cc2e072f46991 RTC: 39793 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1130 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwas')
-rw-r--r--src/usr/hwas/common/common.mk41
-rw-r--r--src/usr/hwas/common/hwas.C (renamed from src/usr/hwas/hwas.C)77
-rw-r--r--src/usr/hwas/deconfigGard.C4
-rw-r--r--src/usr/hwas/hostbootIstep.C (renamed from src/usr/hwas/plat/hostbootIstep.C)51
-rw-r--r--src/usr/hwas/hwasPlat.C (renamed from src/usr/hwas/plat/hwasPlat.C)64
-rw-r--r--src/usr/hwas/makefile10
-rw-r--r--src/usr/hwas/test/hwasGardTest.H2
-rw-r--r--src/usr/hwas/testHWP.C4
8 files changed, 147 insertions, 106 deletions
diff --git a/src/usr/hwas/common/common.mk b/src/usr/hwas/common/common.mk
new file mode 100644
index 000000000..bbe51e885
--- /dev/null
+++ b/src/usr/hwas/common/common.mk
@@ -0,0 +1,41 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwas/common/common.mk $
+#
+# IBM CONFIDENTIAL
+#
+# COPYRIGHT International Business Machines Corp. 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
+################################################################################
+#
+# @file hwas/common.mk
+#
+# @brief Common hwas makefile to be included in
+# hwas/makefile
+#
+################################################################################
+
+HWAS_OBJS = \
+ hwas.o
+
+OTHER_OBJS =
+
+# Common
+COMMON_HWAS_OBJS = \
+ ${HWAS_OBJS} \
+ ${OTHER_OBJS}
+
diff --git a/src/usr/hwas/hwas.C b/src/usr/hwas/common/hwas.C
index 2baf602ec..9080f64c0 100644
--- a/src/usr/hwas/hwas.C
+++ b/src/usr/hwas/common/hwas.C
@@ -1,26 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/hwas/hwas.C $
-//
-// 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/usr/hwas/common/hwas.C $
+ *
+ * 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
+ */
/**
* @file hwas.C
*
@@ -34,20 +34,25 @@
// Includes
/******************************************************************************/
#include <stdint.h>
-#include <assert.h>
-#include <initservice/taskargs.H>
#include <targeting/common/commontargeting.H>
-#include <hwas/hwas.H>
-#include <hwas/hwasCommon.H>
-#include <hwas/hwasError.H>
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
+#include <hwas/common/hwasError.H>
namespace HWAS
{
using namespace TARGETING;
+using namespace HWAS::COMMON;
+// trace setup; used by HWAS_DBG and HWAS_ERR macros
+HWAS_TD_t g_trac_dbg_hwas = NULL; // debug - fast
+HWAS_TD_t g_trac_imp_hwas = NULL; // important - slow
+
+TRAC_INIT(&g_trac_dbg_hwas, "HWAS", 1024 );
+TRAC_INIT(&g_trac_imp_hwas, "HWAS_I", 1024 );
/**
* @brief simple helper fn to get and set hwas state to poweredOn,
@@ -100,11 +105,11 @@ errlHndl_t discoverTargets()
Target* pSys;
targetService().getTopLevelTarget(pSys);
- 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 %x (%p) - marked present",
+ HWAS_DBG("pSys %.8X (%p) - marked present",
pSys->getAttr<ATTR_HUID>(), pSys);
// find CLASS_ENC
@@ -121,7 +126,7 @@ errlHndl_t discoverTargets()
// mark it as present
enableHwasState(pEnc, true);
- HWAS_DBG("pEnc %x (%p) - marked present",
+ HWAS_DBG("pEnc %.8X (%p) - marked present",
pEnc->getAttr<ATTR_HUID>(), pEnc);
} // for pEnc_it
@@ -177,7 +182,7 @@ errlHndl_t discoverTargets()
// errl is now NULL
}
- HWAS_DBG("pTarget %x (%p) - detected present %s functional",
+ HWAS_DBG("pTarget %.8X (%p) - detected present %s functional",
pTarget->getAttr<ATTR_HUID>(), pTarget,
isFunctional ? "and" : "NOT");
@@ -195,7 +200,7 @@ errlHndl_t discoverTargets()
{
TargetHandle_t pDesc = *pDesc_it;
enableHwasState(pDesc, isFunctional);
- HWAS_DBG("pDesc %x (%p) - marked present %s functional",
+ HWAS_DBG("pDesc %.8X (%p) - marked present %s functional",
pDesc->getAttr<ATTR_HUID>(), pDesc,
isFunctional ? "and" : "NOT");
}
@@ -203,13 +208,13 @@ errlHndl_t discoverTargets()
} while (0);
- if (errl != NULL)
+ if (errl == NULL)
{
- HWAS_ERR("discoverTargets returning errl %p", errl);
+ HWAS_INF("discoverTargets exit with no error");
}
else
{
- HWAS_INF("discoverTargets exit with no error");
+ HWAS_ERR("discoverTargets returning errl %p", errl);
}
return errl;
} // discoverTargets
diff --git a/src/usr/hwas/deconfigGard.C b/src/usr/hwas/deconfigGard.C
index 7e3c936ed..28a7b917d 100644
--- a/src/usr/hwas/deconfigGard.C
+++ b/src/usr/hwas/deconfigGard.C
@@ -31,11 +31,10 @@
#include <errl/errlmanager.H>
#include <errl/errludtarget.H>
#include <hwas/deconfigGard.H>
-#include <hwas/hwas_reasoncodes.H>
+#include <hwas/common/hwas_reasoncodes.H>
#include <pnor/pnorif.H>
// Trace definition
-trace_desc_t* g_trac_deconf = NULL;
#define __COMP_TD__ g_trac_deconf
// TODO The DeconfigGard code needs to trace a target. The current recommended
@@ -54,6 +53,7 @@ trace_desc_t* g_trac_deconf = NULL;
namespace HWAS
{
+HWAS_TD_t g_trac_deconf = NULL;
errlHndl_t collectGard()
{
diff --git a/src/usr/hwas/plat/hostbootIstep.C b/src/usr/hwas/hostbootIstep.C
index 292b4ee3c..99b4d9ff2 100644
--- a/src/usr/hwas/plat/hostbootIstep.C
+++ b/src/usr/hwas/hostbootIstep.C
@@ -1,35 +1,36 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/hwas/plat/hostbootIstep.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/hwas/hostbootIstep.C $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 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
+ */
/**
* @file hostbootIstep.C
*
* @brief hostboot istep-called functions
*/
-#include <hwas/hwas.H>
-#include <hwas/hwasCommon.H>
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
-#include <hwas/plat/hostbootIstep.H>
+#include <hwas/hostbootIstep.H>
#include <hwas/deconfigGard.H>
#include <fsi/fsiif.H>
diff --git a/src/usr/hwas/plat/hwasPlat.C b/src/usr/hwas/hwasPlat.C
index c3d315078..c47a134af 100644
--- a/src/usr/hwas/plat/hwasPlat.C
+++ b/src/usr/hwas/hwasPlat.C
@@ -1,45 +1,39 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/hwas/plat/hwasPlat.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/hwas/hwasPlat.C $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 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
+ */
/**
* @file hwasPlat.C
*
* @brief Platform specifics
*/
-#include <hwas/hwas.H>
-#include <hwas/hwasCommon.H>
-#include <hwas/hwasError.H>
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
+#include <hwas/common/hwasError.H>
#include <devicefw/driverif.H>
#include <initservice/taskargs.H>
-// trace setup; used by HWAS_DBG and HWAS_ERR macros
-trace_desc_t *g_trac_dbg_hwas = NULL; // debug - fast
-trace_desc_t *g_trac_imp_hwas = NULL; // important - slow
-
-TRAC_INIT(&g_trac_dbg_hwas, "HWAS", 2048 );
-TRAC_INIT(&g_trac_imp_hwas, "HWAS_I", 2048 );
-
namespace HWAS
{
@@ -73,12 +67,12 @@ 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 %x (%p) - id %x ec %x",
+ HWAS_DBG( "i_target %.8X (%p) - id %x ec %x",
i_target->getAttr<ATTR_HUID>(), i_target, id, ec);
}
else
{ // errl was set - this is an error condition.
- HWAS_ERR( "i_target %x (%p) - failed ID/EC read",
+ HWAS_ERR( "i_target %.8X (%p) - failed ID/EC read",
i_target->getAttr<ATTR_HUID>(), i_target);
}
@@ -106,7 +100,7 @@ errlHndl_t platPresenceDetect(TargetHandleList &io_targets)
errl = deviceRead(pTarget, &present, presentSize,
DEVICE_PRESENT_ADDRESS());
- if (errl != NULL)
+ 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);
diff --git a/src/usr/hwas/makefile b/src/usr/hwas/makefile
index 1c7223a9e..57958474a 100644
--- a/src/usr/hwas/makefile
+++ b/src/usr/hwas/makefile
@@ -1,11 +1,11 @@
-# IBM_PROLOG_BEGIN_TAG
+# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/hwas/makefile $
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011-2012
#
# p1
#
@@ -19,14 +19,14 @@
#
# Origin: 30
#
-# IBM_PROLOG_END
-
+# IBM_PROLOG_END_TAG
ROOTPATH = ../../..
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwas
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwas/plat
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwas/common
VPATH += ${ROOTPATH}/src/usr/hwas/plat
+VPATH += ${ROOTPATH}/src/usr/hwas/common
MODULE = hwas
diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H
index ad143ff19..9338678e9 100644
--- a/src/usr/hwas/test/hwasGardTest.H
+++ b/src/usr/hwas/test/hwasGardTest.H
@@ -38,7 +38,7 @@
#include <errl/errlmanager.H>
#include <targeting/common/targetservice.H>
#include <hwas/deconfigGard.H>
-#include <hwas/hwas_reasoncodes.H>
+#include <hwas/common/hwas_reasoncodes.H>
class HwasGardTest: public CxxTest::TestSuite
{
diff --git a/src/usr/hwas/testHWP.C b/src/usr/hwas/testHWP.C
index a3895d388..05d928762 100644
--- a/src/usr/hwas/testHWP.C
+++ b/src/usr/hwas/testHWP.C
@@ -62,11 +62,11 @@ using namespace fapi;
/******************************************************************************/
// Globals/Constants
/******************************************************************************/
-extern trace_desc_t *g_trac_imp_hwas;
-
namespace HWAS
{
+extern HWAS_TD_t g_trac_imp_hwas;
+
void testHWP( void * io_pArgs )
{
errlHndl_t l_err = NULL;
OpenPOWER on IntegriCloud