lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu,  2 Jul 2009 23:21:27 +0800
From:	Wu Zhangjin <wuzhangjin@...il.com>
To:	linux-kernel@...r.kernel.org, linux-mips@...ux-mips.org,
	ralf@...ux-mips.org
Cc:	Wu Zhangjin <wuzj@...ote.com>, Yan Hua <yanh@...ote.com>,
	Philippe Vachon <philippe@...pig.ca>,
	Zhang Le <r0bertz@...too.org>,
	Zhang Fuxin <zhangfx@...ote.com>,
	loongson-dev <loongson-dev@...glegroups.com>,
	Liu Junliang <liujl@...ote.com>,
	Erwan Lerale <erwan@...scow.com>,
	Arnaud Patard <apatard@...driva.com>
Subject: [PATCH v4 05/16] [loongson] pm: clean up the reboot support

From: Wu Zhangjin <wuzj@...ote.com>

several magic numbers have been replaced by relative macros, which will
be more readable and understandable.

Signed-off-by: Wu Zhangjin <wuzj@...ote.com>
---
 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 47ff506..7758093 100644
--- a/arch/mips/lemote/lm2e/reset.c
+++ b/arch/mips/lemote/lm2e/reset.c
@@ -6,21 +6,23 @@
  *
  * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
  * Author: Fuxin Zhang, zhangfx@...ote.com
+ * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology
+ * Author: Zhangjin Wu, wuzj@...ote.com
  */
 #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)
-- 
1.6.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ