Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sead3-reset.c
Go to the documentation of this file.
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License. See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
7  */
8 #include <linux/io.h>
9 #include <linux/pm.h>
10 
11 #include <asm/reboot.h>
13 
14 static void mips_machine_restart(char *command)
15 {
16  unsigned int __iomem *softres_reg =
17  ioremap(SOFTRES_REG, sizeof(unsigned int));
18 
19  __raw_writel(GORESET, softres_reg);
20 }
21 
22 static void mips_machine_halt(void)
23 {
24  unsigned int __iomem *softres_reg =
25  ioremap(SOFTRES_REG, sizeof(unsigned int));
26 
27  __raw_writel(GORESET, softres_reg);
28 }
29 
30 static int __init mips_reboot_setup(void)
31 {
32  _machine_restart = mips_machine_restart;
33  _machine_halt = mips_machine_halt;
34  pm_power_off = mips_machine_halt;
35 
36  return 0;
37 }
38 
39 arch_initcall(mips_reboot_setup);