diff options
author | Anshuman Khandual <khandual@linux.vnet.ibm.com> | 2014-07-24 17:14:15 +0530 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-07-30 10:55:58 +1000 |
commit | a02875504d6c182ec27fd29638f0451bfa13b969 (patch) | |
tree | c1ac7a7fa3c1b7b6da0259911128d8e11bb2b747 /include/opal.h | |
parent | 7d20aac37062d93e15a96008158e51b9bbb34684 (diff) | |
download | skiboot-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/opal.h')
-rw-r--r-- | include/opal.h | 40 |
1 files changed, 40 insertions, 0 deletions
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 */ |