aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorWu Zhangjin <wuzj@lemote.com>2009-07-02 11:21:27 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-09-17 14:07:45 -0400
commitf256a5775a357e2527c7bbfb59c125c4c4c356ad (patch)
tree790bb5222fb96601716eb4f3c3b2e2caf8507dce /arch/mips
parent8f0de87fa97667fa05c7bc938396ec759f021a21 (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/mips')
-rw-r--r--arch/mips/lemote/lm2e/reset.c18
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 @@
6 * 6 *
7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology 7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
8 * Author: Fuxin Zhang, zhangfx@lemote.com 8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
10 * Author: Zhangjin Wu, wuzj@lemote.com
9 */ 11 */
10#include <linux/init.h> 12#include <linux/init.h>
11#include <linux/pm.h> 13#include <linux/pm.h>
14#include <linux/io.h>
12 15
13#include <asm/reboot.h> 16#include <asm/reboot.h>
17#include <asm/mips-boards/bonito64.h>
14 18
15static void loongson2e_restart(char *command) 19static void loongson2e_restart(char *command)
16{ 20{
17#ifdef CONFIG_32BIT 21 /* do preparation for reboot */
18 *(unsigned long *)0xbfe00104 &= ~(1 << 2); 22 BONITO_BONGENCFG &= ~(1 << 2);
19 *(unsigned long *)0xbfe00104 |= (1 << 2); 23 BONITO_BONGENCFG |= (1 << 2);
20#else 24
21 *(unsigned long *)0xffffffffbfe00104 &= ~(1 << 2); 25 /* reboot via jumping to boot base address */
22 *(unsigned long *)0xffffffffbfe00104 |= (1 << 2); 26 ((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) ();
23#endif
24 __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
25} 27}
26 28
27static void loongson2e_halt(void) 29static void loongson2e_halt(void)