summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/ipmi/ipmisensor.H125
-rw-r--r--src/usr/ipmi/ipmisensor.C74
-rwxr-xr-xsrc/usr/targeting/common/genHwsvMrwXml.pl82
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml15
-rw-r--r--src/usr/targeting/common/xmltohb/target_types.xml5
5 files changed, 236 insertions, 65 deletions
diff --git a/src/include/usr/ipmi/ipmisensor.H b/src/include/usr/ipmi/ipmisensor.H
index c060471ca..e27ce84b6 100644
--- a/src/include/usr/ipmi/ipmisensor.H
+++ b/src/include/usr/ipmi/ipmisensor.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -42,6 +42,50 @@
namespace SENSOR
{
+
+ /**
+ * @enum procStatusSensorOffsets
+ * Sensor specific completion codes, defined in IPMI Spec.
+ *
+ */
+ enum procStatusSensorOffsets
+ {
+ IERR = 0x00,
+ THERMAL_TRIP = 0x01,
+ BIST_FAILURE = 0x02,
+ HANG_IN_POST = 0x03,
+ INIT_FAILURE = 0x04,
+ PROC_CONFIG_ERROR = 0x05,
+ BIOS_ERROR = 0x06,
+ PROC_PRESENCE_DETECTED = 0x07,
+ PROC_DISABLED = 0x08,
+ TERMINATOR_PRESNCE_DETECTED = 0x09,
+ PROCESSOR_THROTTLED = 0x0A,
+ MACHINE_CHECK_EXCEPTION = 0x0B,
+ CORRECTABLE_MACHINE_CHECK = 0x0C,
+
+ };
+
+ /**
+ * @enum dimmStatusSensorOffsets
+ * Dimm specific offsets for status sensor, defined in IPMI Spec.
+ *
+ */
+ enum dimmStatusSensorOffsets
+ {
+ CORRECTABLE_ECC_ERROR = 0x00,
+ UNCORRECTABLE_ECC_ERROR = 0x01,
+ PARITY_ERROR = 0x02,
+ MEMORY_SCRUB_ERROR = 0x03,
+ MEMORY_DEVICE_DISABLED = 0x04,
+ CORRECTABLE_ECC_ER_LIMIT_REACH = 0x05,
+ MEM_DEVICE_PRESENCE_DETECTED = 0x06,
+ MEM_CONFIG_ERROR = 0x07,
+ SPARE = 0x08,
+ MEMORY_AUTOMATICALLY_THROTTLED = 0x09,
+ CRITICAL_OVER_TEMP = 0x0A,
+ };
+
//** Bit definition for set sensor reading cmd operation field
// [7:6] 10b - write given values to event data bytes let BMC handle
// offset in event data 1 when an external event is
@@ -68,7 +112,7 @@ namespace SENSOR
static const uint16_t SENSOR_NAME_MINOR_MASK = 0x00FF;
/**
- * @struct set_sensor_reading_request
+ * @struct setSensorReadingRequest
* structure holding the data for the set sensor reading command which
* Hostboot will send to the BMC to update sensor status/readings.
*
@@ -91,7 +135,6 @@ namespace SENSOR
};
}PACKED;
-
/**
* @enum completionCode
* Sensor specific completion codes, defined in IPMI Spec.
@@ -103,27 +146,7 @@ namespace SENSOR
CC_EVENT_DATA_BYTES_NOT_SETTABLE = 0x81
};
- /**
- * @enum procStatusSensorOffsets
- * Sensor specific completion codes, defined in IPMI Spec.
- *
- */
- enum procStatusSensorOfffsets
- {
- PROC_PRESENT = 0x07,
- PROC_FUNCTIONAL_OFFSET = 0x08,
- };
- /**
- * @enum dimmStatusSensorOffsets
- * Dimm specific offsets for status sensor, defined in IPMI Spec.
- *
- */
- enum dimmStatusSensorOffsets
- {
- DIMM_PRESENT_OFFSET = 0x06,
- DIMM_FUNCTIONAL_OFFSET = 0x04,
- };
/**
* @class SensorBase
@@ -636,6 +659,62 @@ namespace SENSOR
*/
void updateBMCFaultSensorStatus(void);
+ /*
+ * @class OCCActiveSensor
+ *
+ * @brief Specialized class to handle OCC_Active sensors.
+ *
+ * @par Detailed Description:
+ * Provides the functionality needed to set the functional status of
+ * the OCCs. The object will determine from the Target* which of
+ * the OCC sensors to set. The OCC_Active sensor is defined as a
+ * processor type sensor so it will use the offsets defined in the
+ * ipmi spec for that type of sensor.
+ */
+
+ class OCCActiveSensor : public SensorBase
+ {
+
+ public:
+
+ /**
+ * @enum stateEnum
+ *
+ * enum defining the state of the OCC sensor
+ */
+ enum OccStateEnum
+ {
+ OCC_ACTIVE = 0x0001,
+ OCC_NOT_ACTIVE = 0x0002
+ };
+
+ /**
+ * @brief Constructor for an OccActive sensor
+ *
+ * The OCCActiveSensor sensor is used to mark the OCC as functional
+ *
+ * The IPMI sensor number for this sensor is associated with
+ * each instance of a Processor target.
+ *
+ */
+ OCCActiveSensor( TARGETING::Target * );
+
+ /**
+ * @brief Destructor for OCC_Active
+ *
+ */
+ ~OCCActiveSensor();
+
+ errlHndl_t setState( OccStateEnum i_state );
+
+ private:
+ // disable the default constructor
+ OCCActiveSensor();
+
+ uint8_t iv_functionalOffset;
+
+ };
+
/**
* @brief Update DIMM/CORE/Processor status sensors on the BMC.
* Update the present/functional status on the BMC for status sensors
diff --git a/src/usr/ipmi/ipmisensor.C b/src/usr/ipmi/ipmisensor.C
index 6f61e21e0..33105161c 100644
--- a/src/usr/ipmi/ipmisensor.C
+++ b/src/usr/ipmi/ipmisensor.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -316,11 +316,11 @@ namespace SENSOR
}
- // given an array[][2] compare the number in the first column to the passed
- // in key value
+ // given an array[][2] compare the sensor name, located in the first column,
+ // to the passed in key value
static inline bool compare_it( uint16_t (&a)[2], uint16_t key )
{
- return a[0] < key;
+ return a[TARGETING::IPMI_SENSOR_ARRAY_NAME_OFFSET] < key;
};
/**
@@ -438,10 +438,12 @@ namespace SENSOR
// we have not reached the end of the array and the iterator
// returned from lower_bound is pointing to an entry which equals
// the one we are searching for.
- if( ( ptr != end ) && ( (*ptr)[0] == iv_name ) )
+ if( ( ptr != end ) &&
+ ( (*ptr)[TARGETING::IPMI_SENSOR_ARRAY_NAME_OFFSET] == iv_name ) )
{
// found it
- l_sensor_number = (*ptr)[1];
+ l_sensor_number =
+ (*ptr)[TARGETING::IPMI_SENSOR_ARRAY_NUMBER_OFFSET];
TRACFCOMP(g_trac_ipmi,"Found sensor number %d for HUID=0x%x",
l_sensor_number, TARGETING::get_huid(iv_target));
@@ -529,16 +531,16 @@ namespace SENSOR
{
case TARGETING::TYPE_DIMM:
{
- iv_functionalOffset = 0x04;
- iv_presentOffset = 0x06;
+ iv_functionalOffset = MEMORY_DEVICE_DISABLED;
+ iv_presentOffset = MEM_DEVICE_PRESENCE_DETECTED;
break;
}
case TARGETING::TYPE_PROC:
case TARGETING::TYPE_CORE:
{
- iv_functionalOffset = 0x08;
- iv_presentOffset = 0x07;
+ iv_functionalOffset = PROC_DISABLED;
+ iv_presentOffset = PROC_PRESENCE_DETECTED;
break;
}
@@ -693,6 +695,58 @@ namespace SENSOR
}
//
+ // OCC Active Sensor - uses occ target
+ //
+ //
+ OCCActiveSensor::OCCActiveSensor( TARGETING::Target * i_pTarget )
+ :SensorBase(TARGETING::SENSOR_NAME_OCC_ACTIVE, i_pTarget ),
+ iv_functionalOffset(PROC_DISABLED)
+ {
+
+ };
+
+ //
+ // OCCActiveSensor destructor
+ //
+ //
+ OCCActiveSensor::~OCCActiveSensor(){};
+
+ // Convert the input status to the correct sensor offset value, then
+ // send the message to the BMC to update the event status for this sensor.
+ errlHndl_t OCCActiveSensor::setState( OccStateEnum i_state )
+ {
+
+ errlHndl_t l_err = NULL;
+
+ uint16_t func_mask = setMask( iv_functionalOffset );
+
+ switch ( i_state )
+ {
+
+ case OCC_ACTIVE:
+ // turn off the disabled bit
+ iv_msg->iv_deassertion_mask = func_mask;
+ break;
+
+ case OCC_NOT_ACTIVE:
+ // assert the disabled bit
+ iv_msg->iv_assertion_mask = func_mask;
+ break;
+
+ default:
+ // assert that it is non-functional
+ iv_msg->iv_assertion_mask = func_mask;
+ break;
+ }
+
+ l_err = writeSensorData();
+
+
+ return l_err;
+
+ };
+
+ //
// HostStausSensor constructor - uses system target
//
//
diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl
index 4f3529252..54902b7bf 100755
--- a/src/usr/targeting/common/genHwsvMrwXml.pl
+++ b/src/usr/targeting/common/genHwsvMrwXml.pl
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2013,2014
+# Contributors Listed Below - COPYRIGHT 2013,2015
# [+] International Business Machines Corp.
#
#
@@ -2075,15 +2075,15 @@ sub generate_sys
<attribute>
<id>IPMI_SENSORS</id>
<default>
- 0x0700,0x07,
- 0x0800,0x04,
- 0x0900,0x05,
- 0x0a00,0x08,
- 0x0b00,0x09,
- 0x0c00,0x06,
- 0x0d00,0x00,
- 0x0e00,0xFF,
- 0x0F00,0xFF,
+ 0x0700,0x07, <!-- OS_Boot -->
+ 0x0800,0x04, <!-- Host_Status -->
+ 0x0900,0x05, <!-- FW_Boot_Progress -->
+ 0x0b00,0x09, <!-- Power_Cap -->
+ 0x0c00,0x06, <!-- PCI -->
+ 0x0d00,0x00, <!-- Boot_watchdog -->
+ 0x0e00,0xFF, <!-- Reboot_Count -->
+ 0x1000,0xFF, <!-- System_Event -->
+ 0x1010,0xFF, <!-- APSS Fault -->
0xFFFF,0xFF,
0xFFFF,0xFF,
0xFFFF,0xFF,
@@ -2522,10 +2522,10 @@ sub generate_system_node
<attribute>
<id>IPMI_SENSORS</id>
<default>
- 0x1017,0x14,
- 0x101A,0x15,
- 0x101B,0x16,
- 0xFFFF,0xFF,
+ 0x1000,0x80, <!-- Backplane fault sensor -->
+ 0x1017,0x14, <!-- TOD clock fault sensor -->
+ 0x101A,0x15, <!-- REF clock fault sensor -->
+ 0x101B,0x16, <!-- PCI clock fault sensor -->
0xFFFF,0xFF,
0xFFFF,0xFF,
0xFFFF,0xFF,
@@ -3093,8 +3093,8 @@ sub generate_proc
<attribute>
<id>IPMI_SENSORS</id>
<default>
- 0x0100, 0x12,
- 0x0500, 0x03,
+ 0x0100, 0x12, <!-- Temperature sensor -->
+ 0x0500, 0x03, <!-- State sensor -->
0xFFFF, 0xFF,
0xFFFF, 0xFF,
0xFFFF, 0xFF,
@@ -3198,8 +3198,8 @@ sub generate_ex_core
<attribute>
<id>IPMI_SENSORS</id>
<default>
- 0x0100, 0x13,
- 0x0500, 0x02,
+ 0x0100, 0x13, <!-- Temperature sensor -->
+ 0x0500, 0x02, <!-- State sensor -->
0xFFFF, 0xFF,
0xFFFF, 0xFF,
0xFFFF, 0xFF,
@@ -4012,8 +4012,8 @@ sub generate_centaur
<attribute>
<id>IPMI_SENSORS</id>
<default>
- 0x0100, 0xFF,
- 0x0500, 0xFF,
+ 0x0100, 0xFF, <!-- Temperature sensor -->
+ 0x0500, 0xFF, <!-- State sensor -->
0xFFFF, 0xFF,
0xFFFF, 0xFF,
0xFFFF, 0xFF,
@@ -4289,8 +4289,8 @@ sub generate_is_dimm
<attribute>
<id>IPMI_SENSORS</id>
<default>
- 0x0100, 0xFF,
- 0x0500, 0x01,
+ 0x0100, 0xFF, <!-- Temperature sensor -->
+ 0x0500, 0x01, <!-- State sensor -->
0xFFFF, 0xFF,
0xFFFF, 0xFF,
0xFFFF, 0xFF,
@@ -4459,8 +4459,8 @@ sub generate_dimm
<attribute>
<id>IPMI_SENSORS</id>
<default>
- 0x0100, 0xFF,
- 0x0500, 0x01,
+ 0x0100, 0xFF, <!-- Temperature sensor -->
+ 0x0500, 0x01, <!-- State sensor -->
0xFFFF, 0xFF,
0xFFFF, 0xFF,
0xFFFF, 0xFF,
@@ -4672,8 +4672,38 @@ sub generate_occ
<attribute>
<id>OCC_MASTER_CAPABLE</id>
<default>$mastercapable</default>
- </attribute>
-</targetInstance>\n";
+ </attribute>\n";
+
+ # $TODO RTC:110399
+ # hardcode for now both palmetto and habenaro are
+ # currently the same - this will change though
+ #
+ if( $haveFSPs == 0 )
+ {
+ print "\n<!-- IPMI sensor numbers -->
+ <attribute>
+ <id>IPMI_SENSORS</id>
+ <default>
+ 0x0a00, 0x08, <!-- Occ_active -->
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF,
+ 0xFFFF, 0xFF
+ </default>
+ </attribute>\n";
+ }
+print "</targetInstance>\n";
}
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index 297c8b64b..76b9e8046 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
-<!-- Contributors Listed Below - COPYRIGHT 2012,2014 -->
+<!-- Contributors Listed Below - COPYRIGHT 2012,2015 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
@@ -407,14 +407,14 @@
<value>0x0e00</value>
</enumerator>
<enumerator>
- <name>POWER</name>
- <value>0x0f00</value>
- </enumerator>
- <enumerator>
<name>FAULT</name>
<value>0x1000</value>
</enumerator>
<enumerator>
+ <name>APSS_FAULT</name> <!-- APSS Fault -->
+ <value>0x1010</value>
+ </enumerator>
+ <enumerator>
<name>TOD_CLOCK_FAULT</name>
<value>0x1017</value>
</enumerator>
@@ -426,6 +426,11 @@
<name>PCI_CLOCK_FAULT</name>
<value>0x101B</value>
</enumerator>
+ <enumerator>
+ <name>APSS_CHANNEL</name> <!-- Power sensors -->
+ <value>0x1100</value> <!-- 16 channels -->
+ </enumerator>
+
</enumerationType>
<enumerationType>
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index 46ac33acb..5f73d87d5 100644
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
-<!-- Contributors Listed Below - COPYRIGHT 2012,2014 -->
+<!-- Contributors Listed Below - COPYRIGHT 2012,2015 -->
<!-- [+] Google Inc. -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
@@ -1682,6 +1682,9 @@
<attribute>
<id>OCC_MASTER_CAPABLE</id>
</attribute>
+ <attribute>
+ <id>IPMI_SENSORS</id>
+ </attribute>
</targetType>
</attributes>
OpenPOWER on IntegriCloud