aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>2014-07-24 17:14:15 +0530
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-30 10:55:58 +1000
commita02875504d6c182ec27fd29638f0451bfa13b969 (patch)
treec1ac7a7fa3c1b7b6da0259911128d8e11bb2b747 /include
parent7d20aac37062d93e15a96008158e51b9bbb34684 (diff)
downloadskiboot-a02875504d6c182ec27fd29638f0451bfa13b969.zip
skiboot-a02875504d6c182ec27fd29638f0451bfa13b969.tar.gz
skiboot-a02875504d6c182ec27fd29638f0451bfa13b969.tar.bz2
epow: Enable Environment and Power Warning support in FSP machines
EPOW informs about the environmental and power situation regarding the system, so thet corrective action can be taken if required. Sapphire interacts in two distinct ways with respect to EPOW events with FSP. FSP sends notification regarding changes in system-panel status (classified as normal ,extended_1, extended_2 depending on information contained). These intimations carry details regarding the prevailing EPOW situation which triggered the notification in the first place. Sapphire can also query about these system-panel status synchronously with FSP, independent of these explicit notifications. This patch enables processing of these explicit FSP notifications related to EPOW events and map them to generic OPAL EPOW events which in turn get communicated to the host above. Host communication has been implemented with OPAL message event interface with OPAL_MSG_EPOW class messages. Host gets notified about the presence of valid EPOW status in the system and subsequently calls for the complete EPOW system status through an exclussive OPAL calls with the token OPAL_GET_EPOW_STATUS. This delivers the entire array of system EPOW status which can then be processed in the host kernel to be forwarded up the stack. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include')
-rw-r--r--include/fsp-epow.h33
-rw-r--r--include/fsp.h6
-rw-r--r--include/opal.h40
3 files changed, 79 insertions, 0 deletions
diff --git a/include/fsp-epow.h b/include/fsp-epow.h
new file mode 100644
index 0000000..9184803
--- /dev/null
+++ b/include/fsp-epow.h
@@ -0,0 +1,33 @@
+/*
+ * (C) Copyright IBM Corp., 2013 and provided pursuant to the Technology
+ * Licensing Agreement between Google Inc. and International Business
+ * Machines Corporation, IBM License Reference Number AA130103030256 and
+ * confidentiality governed by the Parties’ Mutual Nondisclosure Agreement
+ * number V032404DR, executed by the parties on November 6, 2007, and
+ * Supplement V032404DR-3 dated August 16, 2012 (the “NDA”).
+ */
+
+/*
+ * Handle FSP EPOW event notifications
+ */
+
+#ifndef __FSP_EPOW_H
+#define __FSP_EPOW_H
+
+/* FSP based EPOW event notifications */
+#define EPOW_NORMAL 0x00 /* panel status normal */
+#define EPOW_EX1 0x01 /* panel status extended 1 */
+#define EPOW_EX2 0x02 /* Panel status extended 2 */
+
+/* SPCN notifications */
+#define SPCN_CNF_CHNG 0x08 /* SPCN configuration change */
+#define SPCN_FAULT_LOG 0x04 /* SPCN fault to log */
+#define SPCN_POWR_FAIL 0x02 /* SPCN impending power failure */
+#define SPCN_INCL_POWR 0x01 /* SPCN incomplete power */
+
+/* EPOW reason code notifications */
+#define EPOW_ON_UPS 1 /* System on UPS */
+#define EPOW_TMP_AMB 2 /* Over ambient temperature */
+#define EPOW_TMP_INT 3 /* Over internal temperature */
+
+#endif
diff --git a/include/fsp.h b/include/fsp.h
index 583d1ac..de9ae9e 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -358,6 +358,9 @@
#define FSP_CMD_GET_IPL_SIDE 0x1ce0600 /* HV->FSP: Get IPL side and speed */
#define FSP_CMD_SET_IPL_SIDE 0x1ce0780 /* HV->FSP: Set next IPL side */
#define FSP_CMD_PCI_POWER_CONF 0x1ce1b00 /* HV->FSP: Send PCIe list to FSP */
+#define FSP_CMD_STATUS_REQ 0x0ce4800 /* HV->FSP: Request normal panel status */
+#define FSP_CMD_STATUS_EX1_REQ 0x0ce4802 /* HV->FSP: Request extended 1 panel status */
+#define FSP_CMD_STATUS_EX2_REQ 0x0ce4803 /* HV->FSP: Request extended 2 panel status */
/*
* Class 0xD2
@@ -748,4 +751,7 @@ extern void fsp_free_led_list_buf(struct fsp_msg *msg);
extern void fsp_get_led_state(struct fsp_msg *msg);
extern void fsp_set_led_state(struct fsp_msg *msg);
+/* EPOW */
+extern void fsp_epow_init(void);
+
#endif /* __FSP_H */
diff --git a/include/opal.h b/include/opal.h
index a82a2ce..c8a3b5f 100644
--- a/include/opal.h
+++ b/include/opal.h
@@ -448,6 +448,46 @@ enum OpalSysparamPerm {
OPAL_SYSPARAM_RW = (OPAL_SYSPARAM_READ | OPAL_SYSPARAM_WRITE),
};
+/*
+ * EPOW status sharing (OPAL and the host)
+ *
+ * The host will pass on OPAL, a buffer of length OPAL_SYSEPOW_MAX
+ * with individual elements being 16 bits wide to fetch the system
+ * wide EPOW status. Each element in the buffer will contain the
+ * EPOW status in it's bit representation for a particular EPOW sub
+ * class as defiend here. So multiple detailed EPOW status bits
+ * specific for any sub class can be represented in a single buffer
+ * element as it's bit representation.
+ */
+
+/* System EPOW type */
+enum OpalSysEpow {
+ OPAL_SYSEPOW_POWER = 0, /* Power EPOW */
+ OPAL_SYSEPOW_TEMP = 1, /* Temperature EPOW */
+ OPAL_SYSEPOW_COOLING = 2, /* Cooling EPOW */
+ OPAL_SYSEPOW_MAX = 3, /* Max EPOW categories */
+};
+
+/* Power EPOW */
+enum OpalSysPower {
+ OPAL_SYSPOWER_UPS = 0x0001, /* System on UPS power */
+ OPAL_SYSPOWER_CHNG = 0x0002, /* System power configuration change */
+ OPAL_SYSPOWER_FAIL = 0x0004, /* System impending power failure */
+ OPAL_SYSPOWER_INCL = 0x0008, /* System incomplete power */
+};
+
+/* Temperature EPOW */
+enum OpalSysTemp {
+ OPAL_SYSTEMP_AMB = 0x0001, /* System over ambient temperature */
+ OPAL_SYSTEMP_INT = 0x0002, /* System over internal temperature */
+ OPAL_SYSTEMP_HMD = 0x0004, /* System over ambient humidity */
+};
+
+/* Cooling EPOW */
+enum OpalSysCooling {
+ OPAL_SYSCOOL_INSF = 0x0001, /* System insufficient cooling */
+};
+
struct opal_machine_check_event {
enum OpalMCE_Version version:8; /* 0x00 */
uint8_t in_use; /* 0x01 */