diff options
author | Wu Zhangjin <wuzj@lemote.com> | 2009-07-02 23:21:27 +0800 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-09-17 20:07:45 +0200 |
commit | f256a5775a357e2527c7bbfb59c125c4c4c356ad (patch) | |
tree | 790bb5222fb96601716eb4f3c3b2e2caf8507dce /arch | |
parent | 8f0de87fa97667fa05c7bc938396ec759f021a21 (diff) |
MIPS: Loongson: pm: clean up the reboot support
Several magic numbers have been replaced by relative macros, which will be
more readable and understandable.
Signed-off-by: Wu Zhangjin <wuzj@lemote.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/lemote/lm2e/reset.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/mips/lemote/lm2e/reset.c b/arch/mips/lemote/lm2e/reset.c index a6499a200788..0faa140f4036 100644 --- a/arch/mips/lemote/lm2e/reset.c +++ b/arch/mips/lemote/lm2e/reset.c @@ -6,22 +6,24 @@ * * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology * Author: Fuxin Zhang, zhangfx@lemote.com + * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology + * Author: Zhangjin Wu, wuzj@lemote.com */ #include <linux/init.h> #include <linux/pm.h> +#include <linux/io.h> #include <asm/reboot.h> +#include <asm/mips-boards/bonito64.h> static void loongson2e_restart(char *command) { -#ifdef CONFIG_32BIT - *(unsigned long *)0xbfe00104 &= ~(1 << 2); - *(unsigned long *)0xbfe00104 |= (1 << 2); -#else - *(unsigned long *)0xffffffffbfe00104 &= ~(1 << 2); - *(unsigned long *)0xffffffffbfe00104 |= (1 << 2); -#endif - __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000)); + /* do preparation for reboot */ + BONITO_BONGENCFG &= ~(1 << 2); + BONITO_BONGENCFG |= (1 << 2); + + /* reboot via jumping to boot base address */ + ((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) (); } static void loongson2e_halt(void) |