aboutsummaryrefslogtreecommitdiff
path: root/include/ipmi.h
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2014-09-11 15:43:51 +0930
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-10-01 14:23:06 +1000
commit1e487eb0dd97963298a5b67b0899b36c36eb8747 (patch)
tree2583a8b66ad45d3bd2d63aada85fe78dbb987bae /include/ipmi.h
parentae5fb8512e8ecfc1f1b24f5f89ef373dc4502844 (diff)
downloadskiboot-1e487eb0dd97963298a5b67b0899b36c36eb8747.zip
skiboot-1e487eb0dd97963298a5b67b0899b36c36eb8747.tar.gz
skiboot-1e487eb0dd97963298a5b67b0899b36c36eb8747.tar.bz2
ipmi/power: Add power state IPMI command
This sends command 20.7, Set ACPI Power State. It is to be used to inform a BMC of the runtime state of the system. We drop the ACPI part from the function name to avoid confusion. As soon as IPMI is up, the palmetto platform init code will set the power ptate to S0/working. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include/ipmi.h')
-rw-r--r--include/ipmi.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/ipmi.h b/include/ipmi.h
index 3bf343f..c64e1bd 100644
--- a/include/ipmi.h
+++ b/include/ipmi.h
@@ -61,6 +61,19 @@
#define IPMI_CHASSIS_PULSE_DIAG 0x04
#define IPMI_CHASSIS_SOFT_SHUTDOWN 0x05
+/* 20.7. ACPI Power State Command */
+#define IPMI_PWR_SYS_S0_WORKING 0x00
+#define IPMI_PWR_SYS_S1 0x01
+#define IPMI_PWR_SYS_S2 0x02
+#define IPMI_PWR_SYS_S3_SUSPEND_TO_RAM 0x03
+#define IPMI_PWR_SYS_S4_SUSPEND_TO_DISK 0x04
+#define IPMI_PWR_SYS_S5_SOFT_OFF 0x05
+#define IPMI_PWR_SYS_SUSPEND 0x06
+#define IPMI_PWR_SYS_LEGACY_ON 0x20
+#define IPMI_PWR_SYS_LEGACY_OFF 0x21
+#define IPMI_PWR_SYS_UNKNOWN 0x2a
+#define IPMI_PWR_NOCHANGE 0x7f
+
#define IPMI_CODE(netfn, cmd) ((netfn) << 8 | (cmd))
#define IPMI_CMD(code) ((code) & 0xff)
#define IPMI_NETFN(code) ((code) >> 8 & 0xff)
@@ -73,6 +86,8 @@
#define IPMI_GET_SEL_TIME IPMI_CODE(IPMI_NETFN_STORAGE, 0x48)
#define IPMI_SET_SEL_TIME IPMI_CODE(IPMI_NETFN_STORAGE, 0x49)
#define IPMI_CHASSIS_CONTROL IPMI_CODE(IPMI_NETFN_CHASSIS, 0x02)
+#define IPMI_SET_POWER_STATE IPMI_CODE(IPMI_NETFN_APP, 0x06)
+#define IPMI_GET_POWER_STATE IPMI_CODE(IPMI_NETFN_APP, 0x07)
/*
* IPMI response codes.
@@ -138,6 +153,10 @@ void ipmi_cmd_done(struct ipmi_msg *msg);
/* 28.3 Chassis Control Command. Changes the power state of the P8. */
int ipmi_chassis_control(uint8_t request);
+/* 20.7 ACPI Power State Command (without the ACPI part). Informative only,
+ * use chassis control to perform power off and reboot. */
+int ipmi_set_power_state(uint8_t system, uint8_t device);
+
/* Register a backend with the ipmi core. Currently we only support one. */
void ipmi_register_backend(struct ipmi_backend *backend);