aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-04-19 03:27:47 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-04-19 03:27:47 -0400
commitd9c944463d8f3f7cafaaba8f3e44df62ce817484 (patch)
treecb2cfbd038d305af790fe5ee3aa416418cc1b32c /arch/sh/boards
parentdc825b17904a06bbd2f79d720b23156e4c01a22f (diff)
sh: mach-sdk7786: pm_power_off support.
This wires up power-off support for the SDK7786 board. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/mach-sdk7786/setup.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c
index f094ea2ee783..0c057a93fe29 100644
--- a/arch/sh/boards/mach-sdk7786/setup.c
+++ b/arch/sh/boards/mach-sdk7786/setup.c
@@ -165,6 +165,19 @@ static void sdk7786_restart(char *cmd)
165 fpga_write_reg(0xa5a5, SRSTR); 165 fpga_write_reg(0xa5a5, SRSTR);
166} 166}
167 167
168static void sdk7786_power_off(void)
169{
170 fpga_write_reg(fpga_read_reg(PWRCR) | PWRCR_PDWNREQ, PWRCR);
171
172 /*
173 * It can take up to 20us for the R8C to do its job, back off and
174 * wait a bit until we've been shut off. Even though newer FPGA
175 * versions don't set the ACK bit, the latency issue remains.
176 */
177 while ((fpga_read_reg(PWRCR) & PWRCR_PDWNACK) == 0)
178 cpu_sleep();
179}
180
168/* Initialize the board */ 181/* Initialize the board */
169static void __init sdk7786_setup(char **cmdline_p) 182static void __init sdk7786_setup(char **cmdline_p)
170{ 183{
@@ -175,6 +188,7 @@ static void __init sdk7786_setup(char **cmdline_p)
175 pr_info("\tPCB revision:\t%d\n", fpga_read_reg(PCBRR) & 0xf); 188 pr_info("\tPCB revision:\t%d\n", fpga_read_reg(PCBRR) & 0xf);
176 189
177 machine_ops.restart = sdk7786_restart; 190 machine_ops.restart = sdk7786_restart;
191 pm_power_off = sdk7786_power_off;
178} 192}
179 193
180/* 194/*