142a2478bSMichal Simek /* 242a2478bSMichal Simek * Copyright (C) 2009 Michal Simek <[email protected]> 342a2478bSMichal Simek * Copyright (C) 2009 PetaLogix 442a2478bSMichal Simek * 542a2478bSMichal Simek * This file is subject to the terms and conditions of the GNU General Public 642a2478bSMichal Simek * License. See the file "COPYING" in the main directory of this archive 742a2478bSMichal Simek * for more details. 842a2478bSMichal Simek */ 942a2478bSMichal Simek 1042a2478bSMichal Simek #include <linux/init.h> 11*7cca9b8bSLinus Walleij #include <linux/delay.h> 1242a2478bSMichal Simek #include <linux/of_platform.h> 13*7cca9b8bSLinus Walleij #include <linux/reboot.h> 1442a2478bSMichal Simek 1542a2478bSMichal Simek void machine_shutdown(void) 1642a2478bSMichal Simek { 17aaa5241eSMichal Simek pr_notice("Machine shutdown...\n"); 1842a2478bSMichal Simek while (1) 1942a2478bSMichal Simek ; 2042a2478bSMichal Simek } 2142a2478bSMichal Simek 2242a2478bSMichal Simek void machine_halt(void) 2342a2478bSMichal Simek { 24aaa5241eSMichal Simek pr_notice("Machine halt...\n"); 2542a2478bSMichal Simek while (1) 2642a2478bSMichal Simek ; 2742a2478bSMichal Simek } 2842a2478bSMichal Simek 2942a2478bSMichal Simek void machine_power_off(void) 3042a2478bSMichal Simek { 31aaa5241eSMichal Simek pr_notice("Machine power off...\n"); 3242a2478bSMichal Simek while (1) 3342a2478bSMichal Simek ; 3442a2478bSMichal Simek } 35*7cca9b8bSLinus Walleij 36*7cca9b8bSLinus Walleij void machine_restart(char *cmd) 37*7cca9b8bSLinus Walleij { 38*7cca9b8bSLinus Walleij do_kernel_restart(cmd); 39*7cca9b8bSLinus Walleij /* Give the restart hook 1 s to take us down */ 40*7cca9b8bSLinus Walleij mdelay(1000); 41*7cca9b8bSLinus Walleij pr_emerg("Reboot failed -- System halted\n"); 42*7cca9b8bSLinus Walleij while (1); 43*7cca9b8bSLinus Walleij } 44