Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * ip30-power.c: Software powerdown and reset handling for IP30 architecture.
0004  *
0005  * Copyright (C) 2004-2007 Stanislaw Skowronek <skylark@unaligned.org>
0006  *               2014 Joshua Kinard <kumba@gentoo.org>
0007  *               2009 Johannes Dickgreber <tanzy@gmx.de>
0008  */
0009 
0010 #include <linux/init.h>
0011 #include <linux/kernel.h>
0012 #include <linux/module.h>
0013 #include <linux/sched.h>
0014 #include <linux/notifier.h>
0015 #include <linux/delay.h>
0016 #include <linux/rtc/ds1685.h>
0017 #include <linux/interrupt.h>
0018 #include <linux/pm.h>
0019 
0020 #include <asm/reboot.h>
0021 #include <asm/sgi/heart.h>
0022 
0023 static void __noreturn ip30_machine_restart(char *cmd)
0024 {
0025     /*
0026      * Execute HEART cold reset
0027      *   Yes, it's cold-HEARTed!
0028      */
0029     heart_write((heart_read(&heart_regs->mode) | HM_COLD_RST),
0030             &heart_regs->mode);
0031     unreachable();
0032 }
0033 
0034 static int __init ip30_reboot_setup(void)
0035 {
0036     _machine_restart = ip30_machine_restart;
0037 
0038     return 0;
0039 }
0040 
0041 subsys_initcall(ip30_reboot_setup);