summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/process_32.c
diff options
context:
space:
mode:
authorJon Frosdick <jon.frosdick@st.com>2009-08-24 09:20:44 +0200
committerPaul Mundt <lethal@linux-sh.org>2009-08-24 09:20:44 +0200
commitb46373e0d4b9f714ab757aae0c19c41fbcc73ef5 (patch)
tree9c2c39193b94dc247b66832267b7e105dd1cda25 /arch/sh/kernel/process_32.c
parentsh: kgdb: do not reload VBR while handling debugger breackpoint (diff)
downloadlinux-b46373e0d4b9f714ab757aae0c19c41fbcc73ef5.tar.xz
linux-b46373e0d4b9f714ab757aae0c19c41fbcc73ef5.zip
sh: Use internal watchdog timer to perform reset
This patches will trigger a reboot using the watchdog timer instead of double fault. Unlike the previous method, this one actually works in 32 bit mode. Reset should also be cleaner. Signed-off-by: Jon Frosdick <jon.frosdick@st.com> Signed-off-by: Carl Shaw <carl.shaw@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/process_32.c')
-rw-r--r--arch/sh/kernel/process_32.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 9fee977f176b..0673c4746be3 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -32,15 +32,35 @@
#include <asm/ubc.h>
#include <asm/fpu.h>
#include <asm/syscalls.h>
+#include <asm/watchdog.h>
int ubc_usercnt = 0;
+#ifdef CONFIG_32BIT
+static void watchdog_trigger_immediate(void)
+{
+ sh_wdt_write_cnt(0xFF);
+ sh_wdt_write_csr(0xC2);
+}
+
+void machine_restart(char * __unused)
+{
+ local_irq_disable();
+
+ /* Use watchdog timer to trigger reset */
+ watchdog_trigger_immediate();
+
+ while (1)
+ cpu_sleep();
+}
+#else
void machine_restart(char * __unused)
{
/* SR.BL=1 and invoke address error to let CPU reset (manual reset) */
asm volatile("ldc %0, sr\n\t"
"mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001));
}
+#endif
void machine_halt(void)
{