From 6141805efc9ca2e9109ca29c837ee3f51d63b141 Mon Sep 17 00:00:00 2001 From: Matt Derksen Date: Thu, 14 Dec 2017 11:52:15 -0600 Subject: Add HB_VOLATILE sensor so OpenBMC can mark volatile sections Set sensor to 1 to tell OpenBMC code to allow hostboot volatile section to be cleared. RTC: 180772 Change-Id: Id63e3ae8a24facd5e01e8bf94688a60f066ba838 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51101 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Martin Gloff Reviewed-by: Christian R. Geddes Reviewed-by: William G. Hoffa --- src/include/usr/ipmi/ipmi_reasoncodes.H | 1 + src/include/usr/ipmi/ipmisensor.H | 68 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) (limited to 'src/include/usr/ipmi') diff --git a/src/include/usr/ipmi/ipmi_reasoncodes.H b/src/include/usr/ipmi/ipmi_reasoncodes.H index 972391675..65d8e64d3 100644 --- a/src/include/usr/ipmi/ipmi_reasoncodes.H +++ b/src/include/usr/ipmi/ipmi_reasoncodes.H @@ -43,6 +43,7 @@ namespace IPMI MOD_IPMISENSOR_ENTITY_ID = 0x09, // IPMI::getSensorEntityId MOD_IPMISENSOR_NAME = 0x0A, // IPMI::getSensorName MOD_IPMISENSOR_REBOOTCNTRL = 0x0B, // IPMI::SENSOR getRebootControl + MOD_IPMISENSOR_HBVOLATILE = 0x0C, // IPMI::SENSOR getHbVolatile }; enum IPMIReasonCode diff --git a/src/include/usr/ipmi/ipmisensor.H b/src/include/usr/ipmi/ipmisensor.H index 15499ce13..676833309 100644 --- a/src/include/usr/ipmi/ipmisensor.H +++ b/src/include/usr/ipmi/ipmisensor.H @@ -908,6 +908,74 @@ namespace SENSOR GpuSensor(); }; + + /** + * @class HbVolatileSensor + * + * @brief Specialized class for the hostboot volatile memory setup + * + * @par Detailed Description: + * Provides the functionality needed by OpenBMC to set hostboot + * section as volatile or not + * + * Usage: + * HbVolatileSensor l_hbVolatileCtl; + * l_hbVolatileCtl.setHbVolatile( HbVolatileSensor::ENABLE_VOLATILE ); + * l_hbVolatileCtl.setHbVolatile( HbVolatileSensor::DISABLE_VOLATILE ); + * + */ + class HbVolatileSensor : public SensorBase + { + + public: + + /** + * @enum hbVolatileSetting + * enum to define the contr + */ + enum hbVolatileSetting + { + DISABLE_VOLATILE = 0x00, // (default) + ENABLE_VOLATILE = 0x01, // allow volatile memory to be cleared + }; + + /** + * @brief Constructor for the HbVolatileSensor + * + * The system target holds the IPMI sensor number for this sensor. + * + */ + HbVolatileSensor(); + + /** + * @brief Destructor for the HbVolatileSensor + * + */ + ~HbVolatileSensor(); + + /** + * @brief Set hostboot volatile section to volatile or not + * + * @param[in] i_setting - enable/disable volatility of section + * + * @return Errorlog handle + * + */ + errlHndl_t setHbVolatile( hbVolatileSetting i_setting ); + + /** + * @brief get the value of the hostboot volatile + * section from the BMC. + * + * @param[o] i_setting - value = volatile or not + * + * @return Errorlog handle + * + */ + errlHndl_t getHbVolatile( hbVolatileSetting & o_setting ); + + }; + /** * @brief Updates initial state of Hostboot relevant fault sensors on the * BMC -- cgit v1.2.3