From d7ad913ecd0d5895893e3b6fdf3a147b25b841e0 Mon Sep 17 00:00:00 2001 From: Wu Zhangjin Date: Sat, 10 Apr 2010 20:07:13 +0800 Subject: [PATCH] --- yaml --- r: 190518 b: refs/heads/master c: 64fc74f5f6055e8470208a7d9cfc8d3994fff34d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/mips/loongson/common/reset.c | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 4b340af93899..5f7c1627a34f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b197b6286650feb9c991826519065aac6f4399b1 +refs/heads/master: 64fc74f5f6055e8470208a7d9cfc8d3994fff34d diff --git a/trunk/arch/mips/loongson/common/reset.c b/trunk/arch/mips/loongson/common/reset.c index 4bd9c18b07a5..9e10d6225d9b 100644 --- a/trunk/arch/mips/loongson/common/reset.c +++ b/trunk/arch/mips/loongson/common/reset.c @@ -16,13 +16,31 @@ #include +static inline void loongson_reboot(void) +{ +#ifndef CONFIG_CPU_JUMP_WORKAROUNDS + ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) (); +#else + void (*func)(void); + + func = (void *)ioremap_nocache(LOONGSON_BOOT_BASE, 4); + + __asm__ __volatile__( + " .set noat \n" + " jr %[func] \n" + " .set at \n" + : /* No outputs */ + : [func] "r" (func)); +#endif +} + static void loongson_restart(char *command) { /* do preparation for reboot */ mach_prepare_reboot(); /* reboot via jumping to boot base address */ - ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) (); + loongson_reboot(); } static void loongson_poweroff(void)