]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/mips/mti-malta/malta-reset.c
Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[mirror_ubuntu-artful-kernel.git] / arch / mips / mti-malta / malta-reset.c
CommitLineData
1da177e4 1/*
b72d9a4e
SH
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 *
1da177e4
LT
6 * Carsten Langgaard, carstenl@mips.com
7 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
1da177e4 8 */
b72d9a4e 9#include <linux/io.h>
fcdb27ad 10#include <linux/pm.h>
1da177e4 11
1da177e4 12#include <asm/reboot.h>
dadaa1c2 13#include <asm/mach-malta/malta-pm.h>
36a29af4
SH
14
15#define SOFTRES_REG 0x1f000500
16#define GORESET 0x42
1da177e4 17
1da177e4
LT
18static void mips_machine_restart(char *command)
19{
84c21e25
DV
20 unsigned int __iomem *softres_reg =
21 ioremap(SOFTRES_REG, sizeof(unsigned int));
1da177e4 22
84c21e25 23 __raw_writel(GORESET, softres_reg);
1da177e4
LT
24}
25
26static void mips_machine_halt(void)
27{
37e5c835
PB
28 while (true);
29}
1da177e4 30
37e5c835
PB
31static void mips_machine_power_off(void)
32{
dadaa1c2
PB
33 mips_pm_suspend(PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF);
34
35 pr_info("Failed to power down, resetting\n");
37e5c835 36 mips_machine_restart(NULL);
1da177e4
LT
37}
38
1f320d05 39static int __init mips_reboot_setup(void)
1da177e4
LT
40{
41 _machine_restart = mips_machine_restart;
42 _machine_halt = mips_machine_halt;
37e5c835 43 pm_power_off = mips_machine_power_off;
1f320d05
RB
44
45 return 0;
1da177e4 46}
1f320d05 47arch_initcall(mips_reboot_setup);