2 * 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
4 * Free Software Foundation; either version 2 of the License, or (at your
5 * option) any later version.
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
12 #include <linux/init.h>
16 #include <asm/reboot.h>
17 #include <asm/mips-boards/bonito64.h>
19 static void loongson2e_restart(char *command)
21 /* do preparation for reboot */
22 BONITO_BONGENCFG &= ~(1 << 2);
23 BONITO_BONGENCFG |= (1 << 2);
25 /* reboot via jumping to boot base address */
26 ((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) ();
29 static void loongson2e_halt(void)
34 static int __init mips_reboot_setup(void)
36 _machine_restart = loongson2e_restart;
37 _machine_halt = loongson2e_halt;
38 pm_power_off = loongson2e_halt;
43 arch_initcall(mips_reboot_setup);