Commit f256a577 authored by Wu Zhangjin's avatar Wu Zhangjin Committed by Ralf Baechle

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: default avatarWu Zhangjin <wuzj@lemote.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 8f0de87f
...@@ -6,22 +6,24 @@ ...@@ -6,22 +6,24 @@
* *
* Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
* Author: Fuxin Zhang, zhangfx@lemote.com * 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/init.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/io.h>
#include <asm/reboot.h> #include <asm/reboot.h>
#include <asm/mips-boards/bonito64.h>
static void loongson2e_restart(char *command) static void loongson2e_restart(char *command)
{ {
#ifdef CONFIG_32BIT /* do preparation for reboot */
*(unsigned long *)0xbfe00104 &= ~(1 << 2); BONITO_BONGENCFG &= ~(1 << 2);
*(unsigned long *)0xbfe00104 |= (1 << 2); BONITO_BONGENCFG |= (1 << 2);
#else
*(unsigned long *)0xffffffffbfe00104 &= ~(1 << 2); /* reboot via jumping to boot base address */
*(unsigned long *)0xffffffffbfe00104 |= (1 << 2); ((void (*)(void))ioremap_nocache(BONITO_BOOT_BASE, 4)) ();
#endif
__asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
} }
static void loongson2e_halt(void) static void loongson2e_halt(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment