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>
12 #include <asm/tlbflush.h>
14 void (*pm_power_off
)(void);
15 EXPORT_SYMBOL(pm_power_off
);
17 #ifdef CONFIG_SUPERH32
18 static void watchdog_trigger_immediate(void)
20 sh_wdt_write_cnt(0xFF);
21 sh_wdt_write_csr(0xC2);
25 static void native_machine_restart(char * __unused
)
29 /* Destroy all of the TLBs in preparation for reset by MMU */
32 /* Address error with SR.BL=1 first. */
33 trigger_address_error();
35 #ifdef CONFIG_SUPERH32
36 /* If that fails or is unsupported, go for the watchdog next. */
37 watchdog_trigger_immediate();
47 static void native_machine_shutdown(void)
52 static void native_machine_power_off(void)
58 static void native_machine_halt(void)
67 struct machine_ops machine_ops
= {
68 .power_off
= native_machine_power_off
,
69 .shutdown
= native_machine_shutdown
,
70 .restart
= native_machine_restart
,
71 .halt
= native_machine_halt
,
73 .crash_shutdown
= native_machine_crash_shutdown
,
77 void machine_power_off(void)
79 machine_ops
.power_off();
82 void machine_shutdown(void)
84 machine_ops
.shutdown();
87 void machine_restart(char *cmd
)
89 machine_ops
.restart(cmd
);
92 void machine_halt(void)
98 void machine_crash_shutdown(struct pt_regs
*regs
)
100 machine_ops
.crash_shutdown(regs
);