summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2017-10-09 06:20:29 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2017-11-06 11:20:30 -0500
commit97f6525326d7ad9fa099be2b503a971c9325f503 (patch)
treeca00507985ae3805e22b672c82c6f94bbca183c1 /src/usr/ipmi
parentcb260675de9f4f9025e0fc99687f6776e5f1bbac (diff)
downloadtalos-hostboot-97f6525326d7ad9fa099be2b503a971c9325f503.tar.gz
talos-hostboot-97f6525326d7ad9fa099be2b503a971c9325f503.zip
Control Host reboots for manufacturing
In a manufacturing environment it is desired to reboot once (and only once) to get the FIRDATA analysis on checkstop. This commit adds functionality to control the auto reboot policy on the BMC. It then "remembers" the state using the HB VOLATILE PNOR partition to enable reboots when in MFG mode. Note that when in this mode, any reboot (even from host) will terminate the boot. Change-Id: If5ce133b59e10c659d7024d1ae08a40988e35190 RTC:180772 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48116 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi')
-rw-r--r--src/usr/ipmi/ipmisensor.C82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/usr/ipmi/ipmisensor.C b/src/usr/ipmi/ipmisensor.C
index c5d8ef345..6cd03acb0 100644
--- a/src/usr/ipmi/ipmisensor.C
+++ b/src/usr/ipmi/ipmisensor.C
@@ -623,6 +623,88 @@ namespace SENSOR
}
//
+ // RebootControlSensor constructor - uses system target
+ //
+ RebootControlSensor::RebootControlSensor()
+ :SensorBase(TARGETING::SENSOR_NAME_HOST_AUTO_REBOOT_CONTROL, NULL)
+ {
+ // message buffer created and initialized in base object.
+
+ }
+
+ //
+ // RebootCountSensor destructor
+ //
+ RebootControlSensor::~RebootControlSensor(){};
+
+ //
+ // setRebootControl - turn reboots on or off to the BMC
+ //
+ errlHndl_t RebootControlSensor::setRebootControl(
+ autoRebootSetting i_setting )
+ {
+ // adjust the operation to overwrite the sensor reading
+ // to the value we send.
+ iv_msg->iv_operation = SET_SENSOR_VALUE_OPERATION;
+
+ // the Reboot Control Sensor is defined as a discrete sensor
+ // but the assertion bytes are being used to transfer the state
+ iv_msg->iv_assertion_mask = le16toh(i_setting);
+
+ TRACFCOMP(g_trac_ipmi,"RebootControlSensor::setRebootControl(%d)",
+ i_setting);
+
+ return writeSensorData();
+ }
+
+ //
+ // getRebootCount - get the reboot setting from the BMC
+ //
+ errlHndl_t RebootControlSensor::getRebootControl(
+ autoRebootSetting &o_setting )
+ {
+ // the Reboot control sensor is defined as a discrete sensor
+ // DISABLE_REBOOT - keep current state (no reboot)
+ // ENABLE_REBOOT - Allow analysis of FIRDATA on XSTOP
+ getSensorReadingData l_data;
+
+ errlHndl_t l_err = readSensorData( l_data );
+
+ if( l_err == NULL )
+ {
+ // this value is already byteswapped
+ if (l_data.event_status <= ENABLE_REBOOTS)
+ {
+ o_setting = static_cast<autoRebootSetting>(l_data.event_status);
+ }
+ else
+ {
+ TRACFCOMP(g_trac_ipmi,"Unknown reboot control setting: %d",
+ l_data.event_status);
+
+ /*@
+ * @errortype ERRL_SEV_UNRECOVERABLE
+ * @moduleid IPMI::MOD_IPMISENSOR_REBOOTCNTRL
+ * @reasoncode IPMI::RC_INVALID_SENSOR_SETTING
+ * @userdata1 Invalid reboot control setting
+ * @userdata2 <unused>
+ * @devdesc The sensor returned an invalid setting
+ * @custdesc Unable to find a valid sensor setting.
+ */
+ l_err = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ IPMI::MOD_IPMISENSOR_REBOOTCNTRL,
+ IPMI::RC_INVALID_SENSOR_SETTING,
+ l_data.event_status,
+ 0,
+ false);
+ }
+ }
+ return l_err;
+ }
+
+
+ //
// StatusSensor constructor - uses system DIMM/CORE/PROC target
//
StatusSensor::StatusSensor( TARGETING::ConstTargetHandle_t i_target )
OpenPOWER on IntegriCloud