summaryrefslogtreecommitdiffstats
path: root/src/include/usr/ipmi
diff options
context:
space:
mode:
authorAni Bagepalli <abagepa@us.ibm.com>2014-10-29 09:37:39 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-03 08:20:09 -0600
commit6917afadcdea9e5761319c6f5d4d259563c4a6ef (patch)
tree53436ce9e0887f824a2d22d91043fbec7379fe89 /src/include/usr/ipmi
parentfab5b85fe78df6588102fa3e46bd6de556a2c6ed (diff)
downloadtalos-hostboot-6917afadcdea9e5761319c6f5d4d259563c4a6ef.tar.gz
talos-hostboot-6917afadcdea9e5761319c6f5d4d259563c4a6ef.zip
add IPMI Watchdog Timer
Change-Id: I4617f5b545a3fc193e62fb7cfdf0292b394871c2 RTC: 108832 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14232 Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Tested-by: Jenkins Server
Diffstat (limited to 'src/include/usr/ipmi')
-rw-r--r--src/include/usr/ipmi/ipmiif.H3
-rw-r--r--src/include/usr/ipmi/ipmiwatchdog.H141
2 files changed, 144 insertions, 0 deletions
diff --git a/src/include/usr/ipmi/ipmiif.H b/src/include/usr/ipmi/ipmiif.H
index 0226eb2dd..ae03f8394 100644
--- a/src/include/usr/ipmi/ipmiif.H
+++ b/src/include/usr/ipmi/ipmiif.H
@@ -120,6 +120,9 @@ namespace IPMI
inline const command_t set_watchdog(void)
{ return std::make_pair(NETFUN_APP, 0x24); }
+ inline const command_t reset_watchdog(void)
+ { return std::make_pair(NETFUN_APP, 0x22); }
+
inline const command_t get_capabilities(void)
{ return std::make_pair(NETFUN_APP, 0x36); }
diff --git a/src/include/usr/ipmi/ipmiwatchdog.H b/src/include/usr/ipmi/ipmiwatchdog.H
new file mode 100644
index 000000000..7c39ac5da
--- /dev/null
+++ b/src/include/usr/ipmi/ipmiwatchdog.H
@@ -0,0 +1,141 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/ipmi/ipmiwatchdog.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+#ifndef __IPMIWATCHDOG_IPMIWATCHDOG_H
+#define __IPMIWATCHDOG_IPMIWATCHDOG_H
+/**
+ * @file ipmiwatchdog.H
+ *
+ * IPMI watchdog interface launched from the IStep Dispatcher
+ *
+ */
+
+/******************************************************************************/
+// Includes
+/******************************************************************************/
+#include <stdint.h>
+#include <errl/errlentry.H>
+
+namespace IPMIWATCHDOG
+{
+/******************************************************************************/
+// Globals/Constants
+/******************************************************************************/
+/**
+ * @brief the default watchdog countdown setting it to 15 secs since progress
+ * have to be sent every 15 secs.
+ */
+const uint16_t DEFAULT_WATCHDOG_COUNTDOWN = 15;
+
+/**
+ * @brief the default watchdog countdown for transition between hostboot
+ * and OPAL (value is in seconds)
+ */
+const uint16_t DEFAULT_HB_OPAL_TRANSITION_COUNTDOWN = 30;
+
+/******************************************************************************/
+// Typedef/Enumerations
+/******************************************************************************/
+/**
+ * @brief Used in Byte 1 field of the set watchdog command
+ */
+enum TIMER_USE
+{
+ DO_NOT_LOG = 0x80, // bit 7
+ DO_NOT_STOP = 0x40, // bit 6
+ BIOS_FRB2 = 0x01, // bit 0
+ BIOS_POST = 0x02, // bit 1
+ OS_LOAD = 0x03, // bits 0 & 1
+ SMS_OS = 0x04, // bit 2
+ OEM = 0x05, // bits 2 & 0
+
+};
+
+/**
+ * @brief Used in Byte 2 field of the set watchdog command
+ */
+enum TIMER_ACTIONS
+{
+ PRE_TIMEOUT_INT_SMI = 0x10, // bit 4
+ PRE_TIMEOUT_INT_NMI = 0x20, // bit 5
+ PRE_TIMEOUT_INT_MSG = 0x30, // bits 4 & 5
+ TIMEOUT_HARD_RESET = 0x01, // bit 0
+ TIMEOUT_PWR_DOWN = 0x02, // bit 1
+ TIMEOUT_PWR_CYCLE = 0x03, // bits 0 & 1
+
+};
+
+/**
+ * @brief Used in Byte 4 field of the set watchdog command
+ * set to 1 to clear the flag set to 0 to leave alone
+ */
+enum TIMER_USE_CLR_FLAGS
+{
+ OEM_FLAG = 0x20, // bit 5
+ SMS_OS_FLAG = 0x10, // bit 4
+ OS_LOAD_FLAG = 0x08, // bit 3
+ BIOS_POST_FLAG = 0x04, // bit 2
+ BIOS_FRB2_FLAG = 0x02, // bit 1
+
+};
+
+
+/******************************************************************************/
+// Functions
+/******************************************************************************/
+
+/**
+ * @brief Sets the ipmi watchdog timer on the BMC
+ *
+ * Called by hostboot to set a watchdog timer on the BMC
+ * @param[in] i_countdown_secs, initial countdown in seconds
+ * @param[in] i_timer_use, Sets watchdog timer use bits.
+ * @param[in] i_timer_action, Sets watchdog timer experation action.
+ * @param[in] i_timer_clr_flag, Sets the Watchdog interrupt flag to clear.
+ * @return none
+ */
+
+errlHndl_t setWatchDogTimer( const uint16_t i_countdown_secs,
+ const uint8_t i_timer_use
+ = static_cast<uint8_t>(DO_NOT_STOP | BIOS_FRB2),
+ const TIMER_ACTIONS i_timer_action
+ = TIMEOUT_PWR_CYCLE,
+ const TIMER_USE_CLR_FLAGS i_timer_clr_flag
+ = BIOS_FRB2_FLAG);
+
+/**
+ * @brief Resets the ipmi watchdog timer on the BMC
+ *
+ * Called by hostboot to reset a watchdog timer countdown on the BMC.
+ * If the BMC returns an error code indicating the watchdog timer
+ * has not been started, this function will start the watchdog timer.
+ *
+ * @return error
+ */
+errlHndl_t resetWatchDogTimer();
+
+
+} // namespace
+
+#endif
OpenPOWER on IntegriCloud