From: Wu Zhangjin Date: Thu, 2 Jul 2009 15:21:27 +0000 (+0800) Subject: MIPS: Loongson: pm: clean up the reboot support X-Git-Tag: v2.6.32-rc1~658^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f256a5775a357e2527c7bbfb59c125c4c4c356ad;p=profile%2Fcommon%2Fkernel-common.git 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 Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/lemote/lm2e/reset.c b/arch/mips/lemote/lm2e/reset.c index a6499a2..0faa140 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 #include +#include #include +#include 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)