summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi
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/ipmi
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/ipmi')
-rw-r--r--src/usr/ipmi/ipmisensor.C74
1 files changed, 64 insertions, 10 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
//
//
OpenPOWER on IntegriCloud