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.
10 * Author: Zhangjin Wu, wuzhangjin@gmail.com
12 #include <linux/init.h>
15 #include <asm/reboot.h>
19 static inline void loongson_reboot(void)
21 #ifndef CONFIG_CPU_JUMP_WORKAROUNDS
22 ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE
, 4)) ();
26 func
= (void *)ioremap_nocache(LOONGSON_BOOT_BASE
, 4);
37 static void loongson_restart(char *command
)
39 /* do preparation for reboot */
40 mach_prepare_reboot();
42 /* reboot via jumping to boot base address */
46 static void loongson_poweroff(void)
48 mach_prepare_shutdown();
52 static void loongson_halt(void)
54 pr_notice("\n\n** You can safely turn off the power now **\n\n");
61 static int __init
mips_reboot_setup(void)
63 _machine_restart
= loongson_restart
;
64 _machine_halt
= loongson_halt
;
65 pm_power_off
= loongson_poweroff
;
70 arch_initcall(mips_reboot_setup
);