aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/loongson/fuloong-2e/reset.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/loongson/fuloong-2e/reset.c')
-rw-r--r--arch/mips/loongson/fuloong-2e/reset.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/arch/mips/loongson/fuloong-2e/reset.c b/arch/mips/loongson/fuloong-2e/reset.c
index c21299af7f64..677fe186db95 100644
--- a/arch/mips/loongson/fuloong-2e/reset.c
+++ b/arch/mips/loongson/fuloong-2e/reset.c
@@ -1,44 +1,23 @@
1/* 1/* Board-specific reboot/shutdown routines
2 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
3 *
4 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
5 * Author: Wu Zhangjin, wuzj@lemote.com
6 *
2 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License as published by the 8 * under the terms of the GNU General Public License as published by the
4 * Free Software Foundation; either version 2 of the License, or (at your 9 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version. 10 * option) any later version.
6 *
7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
10 * Author: Zhangjin Wu, wuzj@lemote.com
11 */ 11 */
12#include <linux/init.h>
13#include <linux/pm.h>
14
15#include <asm/reboot.h>
16 12
17#include <loongson.h> 13#include <loongson.h>
18 14
19static void loongson2e_restart(char *command) 15void mach_prepare_reboot(void)
20{ 16{
21 /* do preparation for reboot */
22 BONITO_BONGENCFG &= ~(1 << 2); 17 BONITO_BONGENCFG &= ~(1 << 2);
23 BONITO_BONGENCFG |= (1 << 2); 18 BONITO_BONGENCFG |= (1 << 2);
24
25 /* reboot via jumping to boot base address */
26 ((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) ();
27} 19}
28 20
29static void loongson2e_halt(void) 21void mach_prepare_shutdown(void)
30{ 22{
31 while (1)
32 ;
33} 23}
34
35static int __init mips_reboot_setup(void)
36{
37 _machine_restart = loongson2e_restart;
38 _machine_halt = loongson2e_halt;
39 pm_power_off = loongson2e_halt;
40
41 return 0;
42}
43
44arch_initcall(mips_reboot_setup);