]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/mips/alchemy/xxs1500/board_setup.c
MIPS: Alchemy: get rid of common/reset.c
[mv-sheeva.git] / arch / mips / alchemy / xxs1500 / board_setup.c
index 21bef8dc0883ae7a0228a5ee58a205e10e433334..7956afa78c4bf8ce8e36486d199ec46257f7f57e 100644 (file)
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
+#include <linux/pm.h>
 
+#include <asm/reboot.h>
 #include <asm/mach-au1x00/au1000.h>
 
 #include <prom.h>
 
-void board_reset(void)
+static void xxs1500_reset(char *c)
 {
        /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
        au_writel(0x00000000, 0xAE00001C);
 }
 
+static void xxs1500_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)
 {
        u32 pin_func;
@@ -52,6 +61,10 @@ void __init board_setup(void)
        }
 #endif
 
+       pm_power_off = xxs1500_power_off;
+       _machine_halt = xxs1500_power_off;
+       _machine_restart = xxs1500_reset;
+
        alchemy_gpio1_input_enable();
        alchemy_gpio2_enable();