MIPS: Alchemy: Fix up residual devboard poweroff/reboot code.
authorManuel Lauss <manuel.lauss@googlemail.com>
Thu, 25 Mar 2010 21:55:38 +0000 (22:55 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 21 May 2010 20:31:15 +0000 (21:31 +0100)
Clean out stray unused board_reset() calls in pb1x boards, the PB1000 is
different from the rest and gets private methods.

(Cleanup after 32fd6901a6d8d19f94e4de6be4e4b552ab078620)

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: http://patchwork.linux-mips.org/patch/1085/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/alchemy/devboards/pb1000/board_setup.c
arch/mips/alchemy/devboards/pb1100/board_setup.c
arch/mips/alchemy/devboards/pb1200/board_setup.c
arch/mips/alchemy/devboards/pb1500/board_setup.c
arch/mips/alchemy/devboards/pb1550/board_setup.c

index b5311d8a29abfade7a5ae9f77382663a43bbd096..4ef50d86b18127c0dae904127cba9bec5c31520c 100644 (file)
 #include <linux/gpio.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/pm.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-pb1x00/pb1000.h>
+#include <asm/reboot.h>
 #include <prom.h>
 
 #include "../platform.h"
@@ -38,8 +40,16 @@ const char *get_system_type(void)
        return "Alchemy Pb1000";
 }
 
-void board_reset(void)
+static void board_reset(char *c)
 {
+       asm volatile ("jr %0" : : "r" (0xbfc00000));
+}
+
+static void board_power_off(void)
+{
+       printk(KERN_ALERT "It's now safe to remove power\n");
+       while (1)
+               asm volatile (".set mips3 ; wait ; .set mips1");
 }
 
 void __init board_setup(void)
@@ -177,6 +187,10 @@ void __init board_setup(void)
                au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
                break;
        }
+
+       pm_power_off = board_power_off;
+       _machine_halt = board_power_off;
+       _machine_restart = board_reset;
 }
 
 static int __init pb1000_init_irq(void)
index c7b4caa81a356804f72cc70b64d230b6acb8187a..90dda5f3ecc50fad0344b3aadfaa00b2473d037e 100644 (file)
@@ -39,11 +39,6 @@ const char *get_system_type(void)
        return "Alchemy Pb1100";
 }
 
-void board_reset(void)
-{
-       bcsr_write(BCSR_SYSTEM, 0);
-}
-
 void __init board_setup(void)
 {
        volatile void __iomem *base = (volatile void __iomem *)0xac000000UL;
index 3184063f8042916524ab32d7ded779a937cc4b0f..8b4466f2d44a3de00a28e19a87158d3d9b5974f4 100644 (file)
@@ -48,12 +48,6 @@ const char *get_system_type(void)
        return "Alchemy Pb1200";
 }
 
-void board_reset(void)
-{
-       bcsr_write(BCSR_RESETS, 0);
-       bcsr_write(BCSR_SYSTEM, 0);
-}
-
 void __init board_setup(void)
 {
        printk(KERN_INFO "AMD Alchemy Pb1200 Board\n");
index fa9770ac358a1649ea7a72bef3f6c040fe18dc2f..9cd9dfa698e75a9d89d36074f466483f1d512ae7 100644 (file)
@@ -45,11 +45,6 @@ const char *get_system_type(void)
        return "Alchemy Pb1500";
 }
 
-void board_reset(void)
-{
-       bcsr_write(BCSR_SYSTEM, 0);
-}
-
 void __init board_setup(void)
 {
        u32 pin_func;
index 1e8fb3ddd7269ca677686c1717b6bf13cb6dc008..9d7d6edafa8dc87cf1877e86a7348790c7312ad0 100644 (file)
@@ -48,11 +48,6 @@ const char *get_system_type(void)
        return "Alchemy Pb1550";
 }
 
-void board_reset(void)
-{
-       bcsr_write(BCSR_SYSTEM, 0);
-}
-
 void __init board_setup(void)
 {
        u32 pin_func;