diff options
-rw-r--r-- | arch/powerpc/platforms/83xx/misc.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c index f0c6df61faa9..f01806c940e1 100644 --- a/arch/powerpc/platforms/83xx/misc.c +++ b/arch/powerpc/platforms/83xx/misc.c | |||
@@ -18,23 +18,36 @@ | |||
18 | 18 | ||
19 | #include "mpc83xx.h" | 19 | #include "mpc83xx.h" |
20 | 20 | ||
21 | static __be32 __iomem *restart_reg_base; | ||
22 | |||
23 | static int __init mpc83xx_restart_init(void) | ||
24 | { | ||
25 | /* map reset restart_reg_baseister space */ | ||
26 | restart_reg_base = ioremap(get_immrbase() + 0x900, 0xff); | ||
27 | |||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | arch_initcall(mpc83xx_restart_init); | ||
32 | |||
21 | void mpc83xx_restart(char *cmd) | 33 | void mpc83xx_restart(char *cmd) |
22 | { | 34 | { |
23 | #define RST_OFFSET 0x00000900 | 35 | #define RST_OFFSET 0x00000900 |
24 | #define RST_PROT_REG 0x00000018 | 36 | #define RST_PROT_REG 0x00000018 |
25 | #define RST_CTRL_REG 0x0000001c | 37 | #define RST_CTRL_REG 0x0000001c |
26 | __be32 __iomem *reg; | ||
27 | |||
28 | /* map reset register space */ | ||
29 | reg = ioremap(get_immrbase() + 0x900, 0xff); | ||
30 | 38 | ||
31 | local_irq_disable(); | 39 | local_irq_disable(); |
32 | 40 | ||
33 | /* enable software reset "RSTE" */ | 41 | if (restart_reg_base) { |
34 | out_be32(reg + (RST_PROT_REG >> 2), 0x52535445); | 42 | /* enable software reset "RSTE" */ |
43 | out_be32(restart_reg_base + (RST_PROT_REG >> 2), 0x52535445); | ||
44 | |||
45 | /* set software hard reset */ | ||
46 | out_be32(restart_reg_base + (RST_CTRL_REG >> 2), 0x2); | ||
47 | } else { | ||
48 | printk (KERN_EMERG "Error: Restart registers not mapped, spinning!\n"); | ||
49 | } | ||
35 | 50 | ||
36 | /* set software hard reset */ | ||
37 | out_be32(reg + (RST_CTRL_REG >> 2), 0x2); | ||
38 | for (;;) ; | 51 | for (;;) ; |
39 | } | 52 | } |
40 | 53 | ||