diff options
| author | Nick Bofferding <bofferdn@us.ibm.com> | 2014-11-26 15:21:57 -0600 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-12-13 11:31:28 -0600 |
| commit | 96205b6f33afcef886784a3ad1362e58127aa284 (patch) | |
| tree | 2d623b9757999b8fe0df719fc67822e8dcfc5f85 /src/include | |
| parent | b5fa2d654e3c321f039a88a51afffce76d4a94a9 (diff) | |
| download | blackbird-hostboot-96205b6f33afcef886784a3ad1362e58127aa284.tar.gz blackbird-hostboot-96205b6f33afcef886784a3ad1362e58127aa284.zip | |
Support simple clock callouts
- Added new simple fault sensor to report clock faults
- Updated MRW parser to generate clock fault sensors
- Updated attribute definition to support clock fault sensors
- Initialize clock fault sensors when Hostboot starts
- Report clock fault to BMC when clock is called out
- Terminate system (config option) when clock is deconfigured
Change-Id: I5e4de8a7c509a45feaad948a565f4f614f821786
RTC: 117344
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14643
Tested-by: Jenkins Server
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/usr/ipmi/ipmisensor.H | 109 | ||||
| -rw-r--r-- | src/include/usr/targeting/common/predicates/predicateattrval.H | 8 |
2 files changed, 114 insertions, 3 deletions
diff --git a/src/include/usr/ipmi/ipmisensor.H b/src/include/usr/ipmi/ipmisensor.H index 74e9da09f..c060471ca 100644 --- a/src/include/usr/ipmi/ipmisensor.H +++ b/src/include/usr/ipmi/ipmisensor.H @@ -58,10 +58,15 @@ namespace SENSOR // Status command" for // details on this byte. - // sensors have the range 0x0-0xFE - 0xFF is reserved for invalid sensor static const uint16_t INVALID_SENSOR = 0xFF; + // Mask which preserves major type of the sensor + static const uint16_t SENSOR_NAME_MAJOR_MASK = 0xFF00; + + // Mask which preserves minor type of the sensor + static const uint16_t SENSOR_NAME_MINOR_MASK = 0x00FF; + /** * @struct set_sensor_reading_request * structure holding the data for the set sensor reading command which @@ -530,6 +535,108 @@ namespace SENSOR }; /** + * @class FaultSensor + * + * @brief Specialized class implementing a simple fault sensor + * + * @par Detailed Description: + * Provides the functionality needed to assert or deassert a fault + * condition for a given target. These are typically used for + * things that have failed which may not have a full targeting + * implementation. Implemented using a 0x03 'digital' discrete + * generic sensor profile. + */ + class FaultSensor : public SensorBase + { + public: + + /** + * @enum FAULT_SENSOR_OFFSET + * + * Indicates the correct sensor offset to use for sensor fault + * assertions/deassertions. + */ + enum FAULT_SENSOR_OFFSET + { + FAULT_DEASSERTED_OFFSET = 0x00, + FAULT_ASSERTED_OFFSET = 0x01, + }; + + /** + * @enum FAULT_STATE + * + * Enum indicating whether the fault sensor is asserted or not + */ + enum FAULT_STATE + { + FAULT_STATE_DEASSERTED = 0x00, + FAULT_STATE_ASSERTED = 0x01, + }; + + /** + * @brief Constructor for a fault sensor + * + * @param[in] i_pTarget + * Target associated with the fault sensor. Must not be NULL. + */ + FaultSensor(TARGETING::Target* i_pTarget); + + /** + * @brief Constructor for a fault sensor, used to differentiate + * multiple sensors of similar type on same target + * + * @param[in] i_pTarget + * Target associated with the fault sensor. Must not be NULL. + * + * @param[in] i_associatedType + * Type of non-instantiated target linked to the main target + * for which this sensor provides readings. + */ + FaultSensor(TARGETING::Target* i_pTarget, + TARGETING::TYPE i_associatedType = TARGETING::TYPE_NA); + + /** + * @brief Destructor for a fault sensor + * + */ + ~FaultSensor(); + + /** + * @brief Set the fault sensor to faulted or non-faulted + * + * @param[in] i_faultState + * Whether sensor is faulted or not + * + * @return Error log handle + * @retval NULL Status set successfully + * @retval !NULL Failed to set status + */ + errlHndl_t setStatus(FAULT_STATE i_faultState); + + private: + + // Disable the default constructor + FaultSensor(); + + // Disable assignment operator + FaultSensor& operator=(const FaultSensor& i_rhs); + + // Disable copy constructor + FaultSensor(const FaultSensor& i_rhs); + }; + + /** + * @brief Updates initial state of Hostboot relevant fault sensors on the + * BMC + * + * @par Detailed Description: + * Updates initial state of Hostboot relevant fault sensors on the + * BMC to "not faulted" for all applicable fault sensors detected in + * the system. All errors will be internally committed. + */ + void updateBMCFaultSensorStatus(void); + + /** * @brief Update DIMM/CORE/Processor status sensors on the BMC. * Update the present/functional status on the BMC for status sensors * monitored by Hostboot. The sensor will be updated based on the diff --git a/src/include/usr/targeting/common/predicates/predicateattrval.H b/src/include/usr/targeting/common/predicates/predicateattrval.H index 304b0f296..20585763e 100644 --- a/src/include/usr/targeting/common/predicates/predicateattrval.H +++ b/src/include/usr/targeting/common/predicates/predicateattrval.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] 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. */ @@ -37,6 +39,7 @@ //****************************************************************************** // STD +#include <string.h> // Other Host Boot Components @@ -88,8 +91,9 @@ class PredicateAttrVal : public PredicateBase PredicateAttrVal( const typename AttributeTraits<A>::Type& i_value, const bool i_invertSearch = false) - : iv_value(i_value), iv_invertSearch(i_invertSearch) + : iv_invertSearch(i_invertSearch) { + memcpy(&iv_value,&i_value,sizeof(iv_value)); } /** |

