diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-09-19 14:28:03 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-09-20 02:09:55 -0400 |
commit | ec27329ffb3b4f619be9f0065c473fcb36ea52ce (patch) | |
tree | 417c97efc83929dfd17320b1e4a7b7f8130d5994 | |
parent | daea1175a9f0f70eab5b33e2827d57ba8c686816 (diff) |
powerpc/powernv: Hookup reboot and poweroff functions
This calls the respective HAL functions, and spin on hal_poll_event()
to ensure the HAL has a chance to communicate with the FSP to trigger
the reboot or shutdown operation
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/powernv/setup.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 07ba1ecd1807..0fac0a6c951e 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c | |||
@@ -83,19 +83,39 @@ static void pnv_show_cpuinfo(struct seq_file *m) | |||
83 | of_node_put(root); | 83 | of_node_put(root); |
84 | } | 84 | } |
85 | 85 | ||
86 | static void pnv_restart(char *cmd) | 86 | static void __noreturn pnv_restart(char *cmd) |
87 | { | 87 | { |
88 | for (;;); | 88 | long rc = OPAL_BUSY; |
89 | |||
90 | while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) { | ||
91 | rc = opal_cec_reboot(); | ||
92 | if (rc == OPAL_BUSY_EVENT) | ||
93 | opal_poll_events(NULL); | ||
94 | else | ||
95 | mdelay(10); | ||
96 | } | ||
97 | for (;;) | ||
98 | opal_poll_events(NULL); | ||
89 | } | 99 | } |
90 | 100 | ||
91 | static void pnv_power_off(void) | 101 | static void __noreturn pnv_power_off(void) |
92 | { | 102 | { |
93 | for (;;); | 103 | long rc = OPAL_BUSY; |
104 | |||
105 | while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) { | ||
106 | rc = opal_cec_power_down(0); | ||
107 | if (rc == OPAL_BUSY_EVENT) | ||
108 | opal_poll_events(NULL); | ||
109 | else | ||
110 | mdelay(10); | ||
111 | } | ||
112 | for (;;) | ||
113 | opal_poll_events(NULL); | ||
94 | } | 114 | } |
95 | 115 | ||
96 | static void pnv_halt(void) | 116 | static void __noreturn pnv_halt(void) |
97 | { | 117 | { |
98 | for (;;); | 118 | pnv_power_off(); |
99 | } | 119 | } |
100 | 120 | ||
101 | static unsigned long __init pnv_get_boot_time(void) | 121 | static unsigned long __init pnv_get_boot_time(void) |