diff options
| -rw-r--r-- | arch/mips/loongson/common/reset.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/mips/loongson/common/reset.c b/arch/mips/loongson/common/reset.c index 4bd9c18b07a5..9e10d6225d9b 100644 --- a/arch/mips/loongson/common/reset.c +++ b/arch/mips/loongson/common/reset.c | |||
| @@ -16,13 +16,31 @@ | |||
| 16 | 16 | ||
| 17 | #include <loongson.h> | 17 | #include <loongson.h> |
| 18 | 18 | ||
| 19 | static inline void loongson_reboot(void) | ||
| 20 | { | ||
| 21 | #ifndef CONFIG_CPU_JUMP_WORKAROUNDS | ||
| 22 | ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) (); | ||
| 23 | #else | ||
| 24 | void (*func)(void); | ||
| 25 | |||
| 26 | func = (void *)ioremap_nocache(LOONGSON_BOOT_BASE, 4); | ||
| 27 | |||
| 28 | __asm__ __volatile__( | ||
| 29 | " .set noat \n" | ||
| 30 | " jr %[func] \n" | ||
| 31 | " .set at \n" | ||
| 32 | : /* No outputs */ | ||
| 33 | : [func] "r" (func)); | ||
| 34 | #endif | ||
| 35 | } | ||
| 36 | |||
| 19 | static void loongson_restart(char *command) | 37 | static void loongson_restart(char *command) |
| 20 | { | 38 | { |
| 21 | /* do preparation for reboot */ | 39 | /* do preparation for reboot */ |
| 22 | mach_prepare_reboot(); | 40 | mach_prepare_reboot(); |
| 23 | 41 | ||
| 24 | /* reboot via jumping to boot base address */ | 42 | /* reboot via jumping to boot base address */ |
| 25 | ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) (); | 43 | loongson_reboot(); |
| 26 | } | 44 | } |
| 27 | 45 | ||
| 28 | static void loongson_poweroff(void) | 46 | static void loongson_poweroff(void) |
