summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2014-12-08 15:27:36 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-01-09 16:27:06 -0600
commit031ea19e048867f5e25ec4bdfe38b64830eaf4fe (patch)
treec282456b3c6ff043352b569d9f52617c33113a62 /src/usr
parent162d892ecec8dc8d7b45a6ee2ab2517adc56b594 (diff)
downloadblackbird-hostboot-031ea19e048867f5e25ec4bdfe38b64830eaf4fe.tar.gz
blackbird-hostboot-031ea19e048867f5e25ec4bdfe38b64830eaf4fe.zip
Create interface for the OCC_active sensor
add code to manipulate the Occ_Active sensor for use by htmgt and others. Change-Id: I4013a0999138d4c3901f8cb42f121589226e0bf3 RTC:119073 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14783 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-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
4 files changed, 134 insertions, 42 deletions
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