2 #include <linux/kexec.h>
3 #include <linux/kernel.h>
4 #include <linux/reboot.h>
5 #include <linux/module.h>
7 #include <asm/watchdog.h>
9 #include <asm/addrspace.h>
10 #include <asm/reboot.h>
11 #include <asm/system.h>
13 void (*pm_power_off
)(void);
14 EXPORT_SYMBOL(pm_power_off
);
16 #ifdef CONFIG_SUPERH32
17 static void watchdog_trigger_immediate(void)
19 sh_wdt_write_cnt(0xFF);
20 sh_wdt_write_csr(0xC2);
24 static void native_machine_restart(char * __unused
)
28 /* Address error with SR.BL=1 first. */
29 trigger_address_error();
31 #ifdef CONFIG_SUPERH32
32 /* If that fails or is unsupported, go for the watchdog next. */
33 watchdog_trigger_immediate();
43 static void native_machine_shutdown(void)
48 static void native_machine_power_off(void)
54 static void native_machine_halt(void)
63 struct machine_ops machine_ops
= {
64 .power_off
= native_machine_power_off
,
65 .shutdown
= native_machine_shutdown
,
66 .restart
= native_machine_restart
,
67 .halt
= native_machine_halt
,
69 .crash_shutdown
= native_machine_crash_shutdown
,
73 void machine_power_off(void)
75 machine_ops
.power_off();
78 void machine_shutdown(void)
80 machine_ops
.shutdown();
83 void machine_restart(char *cmd
)
85 machine_ops
.restart(cmd
);
88 void machine_halt(void)
94 void machine_crash_shutdown(struct pt_regs
*regs
)
96 machine_ops
.crash_shutdown(regs
);