xref: /linux/arch/mips/sgi-ip30/ip30-power.c (revision e65e175b07bef5974045cc42238de99057669ca7)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * ip30-power.c: Software powerdown and reset handling for IP30 architecture.
4  *
5  * Copyright (C) 2004-2007 Stanislaw Skowronek <skylark@unaligned.org>
6  *               2014 Joshua Kinard <kumba@gentoo.org>
7  *               2009 Johannes Dickgreber <tanzy@gmx.de>
8  */
9 
10 #include <linux/init.h>
11 #include <linux/kernel.h>
12 #include <linux/module.h>
13 #include <linux/sched.h>
14 #include <linux/notifier.h>
15 #include <linux/delay.h>
16 #include <linux/rtc/ds1685.h>
17 #include <linux/interrupt.h>
18 #include <linux/pm.h>
19 
20 #include <asm/reboot.h>
21 #include <asm/sgi/heart.h>
22 
23 static void __noreturn ip30_machine_restart(char *cmd)
24 {
25 	/*
26 	 * Execute HEART cold reset
27 	 *   Yes, it's cold-HEARTed!
28 	 */
29 	heart_write((heart_read(&heart_regs->mode) | HM_COLD_RST),
30 		    &heart_regs->mode);
31 	unreachable();
32 }
33 
34 static int __init ip30_reboot_setup(void)
35 {
36 	_machine_restart = ip30_machine_restart;
37 
38 	return 0;
39 }
40 
41 subsys_initcall(ip30_reboot_setup);
42