aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2014-08-12 17:59:41 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-13 16:15:42 +1000
commit50d2e37faf5bb2fd154d4a1eeac465f8016e1f65 (patch)
tree1a275d39c8b74e6f0ec397942763e68e9e29c8f0 /platforms
parent7f43755ba160e160554c8eb537efc5f691e99bc6 (diff)
downloadskiboot-50d2e37faf5bb2fd154d4a1eeac465f8016e1f65.zip
skiboot-50d2e37faf5bb2fd154d4a1eeac465f8016e1f65.tar.gz
skiboot-50d2e37faf5bb2fd154d4a1eeac465f8016e1f65.tar.bz2
plat/palmetto: Add shutdown and reboot
Rebooting and power down for the Palmetto is done by the BMC, which we speak to over the BT interface using IPMI. Implement the IPMI chassis commands which are used for power control, and hook them up to the palmetto platform callbacks for shutdown and reboot. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/bmc/palmetto.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/platforms/bmc/palmetto.c b/platforms/bmc/palmetto.c
index 50e2050..f0a0c86 100644
--- a/platforms/bmc/palmetto.c
+++ b/platforms/bmc/palmetto.c
@@ -209,10 +209,29 @@ static bool palmetto_probe(void)
return true;
}
+static int64_t palmetto_ipmi_power_down(uint64_t request __unused)
+{
+ /* Request is:
+ * 0 = normal
+ * 1 = immediate
+ * When doing "shutdown -h now" from linux, we get a 0.
+ * However, I believe at that point we are ready to shut down,
+ * so unconditionally tell the BMC to immediately power us down.
+ */
+ return ipmi_opal_chassis_request(IPMI_SET_CHASSIS_PWR_DOWN_CMD);
+}
+
+static int64_t palmetto_ipmi_reboot(void)
+{
+ return ipmi_opal_chassis_request(IPMI_SET_CHASSIS_PWR_CYCLE_CMD);
+}
+
DECLARE_PLATFORM(palmetto) = {
.name = "Palmetto",
.probe = palmetto_probe,
.init = palmetto_init,
.external_irq = palmetto_ext_irq,
+ .cec_power_down = palmetto_ipmi_power_down,
+ .cec_reboot = palmetto_ipmi_reboot,
};