summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2015-03-11 19:19:09 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-04-02 17:37:45 -0500
commit248b81d8c291d59e1d864f5af24c9cc47bb51938 (patch)
tree3442a41290997d2eb70a6de188e970283fb54c6f /src
parent56ab0ee178b8277c4cc7e24e8535802821b4cba7 (diff)
downloadtalos-hostboot-248b81d8c291d59e1d864f5af24c9cc47bb51938.tar.gz
talos-hostboot-248b81d8c291d59e1d864f5af24c9cc47bb51938.zip
Update getFaultSensor to map all target types
-fix logic to return sensor for any target. Change-Id: I3bb842d6a8708762ee6163420cdda382eb4fca72 RTC:125231 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/16385 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/targeting/common/utilFilter.H13
-rw-r--r--src/usr/ipmi/ipmisensor.C70
-rw-r--r--src/usr/targeting/common/utilFilter.C33
3 files changed, 85 insertions, 31 deletions
diff --git a/src/include/usr/targeting/common/utilFilter.H b/src/include/usr/targeting/common/utilFilter.H
index 44f5fd95a..bccecfb18 100644
--- a/src/include/usr/targeting/common/utilFilter.H
+++ b/src/include/usr/targeting/common/utilFilter.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -258,6 +260,15 @@ const Target * getParentChip( const Target * i_pChiplet );
*/
const Target * getExChiplet( const Target * i_pCoreChiplet );
+/**
+ * @brief return the Core target of the specified input EX chiplet
+ *
+ * @parm[in] i_pExChiplet, EX chiplet target for retrieving the
+ * Core target
+ *
+ * @return Core target pointer or NULL if error
+ */
+const Target * getCoreChiplet( const Target * i_pExChiplet );
/**
* @brief Return a list of all cards in a system
diff --git a/src/usr/ipmi/ipmisensor.C b/src/usr/ipmi/ipmisensor.C
index 4b5b47858..1b3ebbd43 100644
--- a/src/usr/ipmi/ipmisensor.C
+++ b/src/usr/ipmi/ipmisensor.C
@@ -35,6 +35,7 @@
#include <targeting/common/utilFilter.H>
#include <ipmi/ipmi_reasoncodes.H>
#include <endian.h>
+
extern trace_desc_t * g_trac_ipmi;
namespace SENSOR
@@ -1057,52 +1058,63 @@ namespace SENSOR
switch( l_type )
{
- case TARGETING::TYPE_PROC:
- case TARGETING::TYPE_CORE:
- case TARGETING::TYPE_DIMM:
- case TARGETING::TYPE_MEMBUF:
- {
- l_sensor_number = StatusSensor(i_pTarget).getSensorNumber();
+ case TARGETING::TYPE_SYS:
+ {
+ TRACDCOMP(g_trac_ipmi, "returning the \"System Event\" sensor\n");
+ l_sensor_number = TARGETING::UTIL::getSensorNumber(
+ i_pTarget,
+ TARGETING::SENSOR_NAME_SYSTEM_EVENT );
+ break;
+ }
- break;
- }
+ case TARGETING::TYPE_NODE:
+ {
- case TARGETING::TYPE_OCC:
- {
- // should return the processor associated with this OCC
- TARGETING::ConstTargetHandle_t proc = getParentChip( i_pTarget);
+ TRACDCOMP(g_trac_ipmi, "return backplane fault sensor\n");
+ l_sensor_number = TARGETING::UTIL::getSensorNumber(
+ i_pTarget,
+ TARGETING::SENSOR_NAME_BACKPLANE_FAULT );
+ break;
+ }
- // we should get the processor as the parent here
- assert(i_pTarget,"OCC target failed to return parent proc");
+ case TARGETING::TYPE_DIMM:
+ case TARGETING::TYPE_MEMBUF:
+ case TARGETING::TYPE_PROC:
+ case TARGETING::TYPE_CORE:
+ {
+ l_sensor_number =
+ StatusSensor(i_pTarget).getSensorNumber();
+ break;
+ }
- l_sensor_number = getFaultSensorNumber( proc );
+ case TARGETING::TYPE_EX:
+ {
+ // sensor number attribute is associated with the core
+ const TARGETING::Target * targ = getCoreChiplet(i_pTarget);
- break;
- }
- default:
- {
- TARGETING::TargetHandle_t l_sys;
+ l_sensor_number = getFaultSensorNumber( targ );
- // get the "system error" sensor number associated with the
- // system target.
- TARGETING::targetService().getTopLevelTarget(l_sys);
+ break;
+ }
- l_sensor_number = TARGETING::UTIL::getSensorNumber(l_sys,
- TARGETING::SENSOR_NAME_SYSTEM_EVENT );
+ default:
+ {
- break;
- }
+ TARGETING::ConstTargetHandle_t targ =
+ getParentChip( i_pTarget);
+ l_sensor_number = getFaultSensorNumber( targ );
+ }
}
- TRACDCOMP(g_trac_ipmi,"<<getFaultSensorNumber() returning sensor number %d,");
+ TRACDCOMP(g_trac_ipmi,"<<getFaultSensorNumber() returning sensor number %#x", l_sensor_number);
return l_sensor_number;
}
// interface to retrieve the APSS channel sensor numbers.
errlHndl_t getAPSSChannelSensorNumbers(
- const uint16_t (* &o_sensor_numbers)[16])
+ const uint16_t (* &o_sensor_numbers)[16])
{
TARGETING::TargetHandle_t l_sys;
diff --git a/src/usr/targeting/common/utilFilter.C b/src/usr/targeting/common/utilFilter.C
index f31701b6d..ecd4f1321 100644
--- a/src/usr/targeting/common/utilFilter.C
+++ b/src/usr/targeting/common/utilFilter.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -455,6 +457,35 @@ const Target * getExChiplet( const Target * i_pCoreChiplet )
return l_pExChiplet;
}
+const Target * getCoreChiplet( const Target * i_pExChiplet )
+{
+ const Target * l_pCoreChiplet = NULL;
+
+ // Create a Class/Type/Model predicate to look for Core chiplet of the input
+ // ex (i.e. the ex's child)
+ TARGETING::PredicateCTM l_predicate(TARGETING::CLASS_UNIT);
+
+ // Create a vector of TARGETING::Target pointers
+ TARGETING::TargetHandleList l_coreList;
+
+ // The core is an immediate child of the ex
+ TARGETING::targetService().getAssociated(l_coreList, i_pExChiplet,
+ TARGETING::TargetService::CHILD,
+ TARGETING::TargetService::IMMEDIATE, &l_predicate);
+
+ if (l_coreList.size() == 1)
+ {
+ l_pCoreChiplet = l_coreList[0];
+ }
+ else
+ {
+ TARG_ERR("Number of Core chiplets is not 1, but %d", l_coreList.size());
+ }
+
+ return l_pCoreChiplet;
+}
+
+
void getPeerTargets(
TARGETING::TargetHandleList& o_peerTargetList,
OpenPOWER on IntegriCloud