diff options
Diffstat (limited to 'arch/sh/boards/mach-sdk7786/setup.c')
-rw-r--r-- | arch/sh/boards/mach-sdk7786/setup.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c index f094ea2ee78..2ec1ea5cf8e 100644 --- a/arch/sh/boards/mach-sdk7786/setup.c +++ b/arch/sh/boards/mach-sdk7786/setup.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/heartbeat.h> | 21 | #include <asm/heartbeat.h> |
22 | #include <asm/sizes.h> | 22 | #include <asm/sizes.h> |
23 | #include <asm/reboot.h> | 23 | #include <asm/reboot.h> |
24 | #include <asm/smp-ops.h> | ||
24 | 25 | ||
25 | static struct resource heartbeat_resource = { | 26 | static struct resource heartbeat_resource = { |
26 | .start = 0x07fff8b0, | 27 | .start = 0x07fff8b0, |
@@ -165,6 +166,19 @@ static void sdk7786_restart(char *cmd) | |||
165 | fpga_write_reg(0xa5a5, SRSTR); | 166 | fpga_write_reg(0xa5a5, SRSTR); |
166 | } | 167 | } |
167 | 168 | ||
169 | static void sdk7786_power_off(void) | ||
170 | { | ||
171 | fpga_write_reg(fpga_read_reg(PWRCR) | PWRCR_PDWNREQ, PWRCR); | ||
172 | |||
173 | /* | ||
174 | * It can take up to 20us for the R8C to do its job, back off and | ||
175 | * wait a bit until we've been shut off. Even though newer FPGA | ||
176 | * versions don't set the ACK bit, the latency issue remains. | ||
177 | */ | ||
178 | while ((fpga_read_reg(PWRCR) & PWRCR_PDWNACK) == 0) | ||
179 | cpu_sleep(); | ||
180 | } | ||
181 | |||
168 | /* Initialize the board */ | 182 | /* Initialize the board */ |
169 | static void __init sdk7786_setup(char **cmdline_p) | 183 | static void __init sdk7786_setup(char **cmdline_p) |
170 | { | 184 | { |
@@ -175,6 +189,9 @@ static void __init sdk7786_setup(char **cmdline_p) | |||
175 | pr_info("\tPCB revision:\t%d\n", fpga_read_reg(PCBRR) & 0xf); | 189 | pr_info("\tPCB revision:\t%d\n", fpga_read_reg(PCBRR) & 0xf); |
176 | 190 | ||
177 | machine_ops.restart = sdk7786_restart; | 191 | machine_ops.restart = sdk7786_restart; |
192 | pm_power_off = sdk7786_power_off; | ||
193 | |||
194 | register_smp_ops(&shx3_smp_ops); | ||
178 | } | 195 | } |
179 | 196 | ||
180 | /* | 197 | /* |