blob: dd6f62ad4417225cf92b63bd6ff7a886c5f01c97 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Steven J. Hillb72d9a42013-06-13 19:55:06 +00002 * 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 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 * Carsten Langgaard, carstenl@mips.com
7 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 */
Steven J. Hillb72d9a42013-06-13 19:55:06 +00009#include <linux/io.h>
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000010#include <linux/pm.h>
Paul Burton10b6ea02016-09-19 22:21:28 +010011#include <linux/reboot.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <asm/reboot.h>
Paul Burtondadaa1c2014-05-07 12:22:12 +010014#include <asm/mach-malta/malta-pm.h>
Steven J. Hill36a29af2013-06-13 19:55:05 +000015
Paul Burton37e5c832014-05-07 12:20:59 +010016static void mips_machine_power_off(void)
17{
Paul Burtondadaa1c2014-05-07 12:22:12 +010018 mips_pm_suspend(PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_SOFF);
19
20 pr_info("Failed to power down, resetting\n");
Paul Burton10b6ea02016-09-19 22:21:28 +010021 machine_restart(NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -070022}
23
Ralf Baechle1f320d02009-09-15 14:50:39 +020024static int __init mips_reboot_setup(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070025{
Paul Burton37e5c832014-05-07 12:20:59 +010026 pm_power_off = mips_machine_power_off;
Ralf Baechle1f320d02009-09-15 14:50:39 +020027
28 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070029}
Ralf Baechle1f320d02009-09-15 14:50:39 +020030arch_initcall(mips_reboot_setup);