]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/mips/mti-malta/malta-reset.c
MIPS: Malta: hang on halt
[karo-tx-linux.git] / arch / mips / mti-malta / malta-reset.c
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  * Carsten Langgaard, carstenl@mips.com
7  * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
8  */
9 #include <linux/io.h>
10 #include <linux/pm.h>
11
12 #include <asm/reboot.h>
13
14 #define SOFTRES_REG     0x1f000500
15 #define GORESET         0x42
16
17 static void mips_machine_restart(char *command)
18 {
19         unsigned int __iomem *softres_reg =
20                 ioremap(SOFTRES_REG, sizeof(unsigned int));
21
22         __raw_writel(GORESET, softres_reg);
23 }
24
25 static void mips_machine_halt(void)
26 {
27         while (true);
28 }
29
30 static void mips_machine_power_off(void)
31 {
32         mips_machine_restart(NULL);
33 }
34
35 static int __init mips_reboot_setup(void)
36 {
37         _machine_restart = mips_machine_restart;
38         _machine_halt = mips_machine_halt;
39         pm_power_off = mips_machine_power_off;
40
41         return 0;
42 }
43 arch_initcall(mips_reboot_setup);