aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-01-20 02:42:52 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-01-20 02:42:52 -0500
commitfbb82b03653cdb7fd1863b911e7540011259d2ce (patch)
treed5920f46068bb184a5322bc1505fb030adb6bfb6 /arch/sh/include/asm
parent2efa53b269ec1e9289a108e1506f53f6f1de440b (diff)
sh: machine_ops based reboot support.
This provides a machine_ops-based reboot interface loosely cloned from x86, and converts the native sh32 and sh64 cases over to it. Necessary both for tying in SMP support and also enabling platforms like SDK7786 to add support for their microcontroller-based power managers. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm')
-rw-r--r--arch/sh/include/asm/reboot.h21
-rw-r--r--arch/sh/include/asm/system.h1
-rw-r--r--arch/sh/include/asm/system_32.h12
-rw-r--r--arch/sh/include/asm/system_64.h7
4 files changed, 41 insertions, 0 deletions
diff --git a/arch/sh/include/asm/reboot.h b/arch/sh/include/asm/reboot.h
new file mode 100644
index 000000000000..b3da0c63fc3d
--- /dev/null
+++ b/arch/sh/include/asm/reboot.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_SH_REBOOT_H
2#define __ASM_SH_REBOOT_H
3
4#include <linux/kdebug.h>
5
6struct pt_regs;
7
8struct machine_ops {
9 void (*restart)(char *cmd);
10 void (*halt)(void);
11 void (*power_off)(void);
12 void (*shutdown)(void);
13 void (*crash_shutdown)(struct pt_regs *);
14};
15
16extern struct machine_ops machine_ops;
17
18/* arch/sh/kernel/machine_kexec.c */
19void native_machine_crash_shutdown(struct pt_regs *regs);
20
21#endif /* __ASM_SH_REBOOT_H */
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
index 62e4fc1e4409..de2fc3963c12 100644
--- a/arch/sh/include/asm/system.h
+++ b/arch/sh/include/asm/system.h
@@ -143,6 +143,7 @@ extern struct dentry *sh_debugfs_root;
143void per_cpu_trap_init(void); 143void per_cpu_trap_init(void);
144void default_idle(void); 144void default_idle(void);
145void cpu_idle_wait(void); 145void cpu_idle_wait(void);
146void stop_this_cpu(void *);
146 147
147#ifdef CONFIG_SUPERH32 148#ifdef CONFIG_SUPERH32
148#define BUILD_TRAP_HANDLER(name) \ 149#define BUILD_TRAP_HANDLER(name) \
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/system_32.h
index 06814f5b59c7..34bd2bac9a5f 100644
--- a/arch/sh/include/asm/system_32.h
+++ b/arch/sh/include/asm/system_32.h
@@ -2,6 +2,7 @@
2#define __ASM_SH_SYSTEM_32_H 2#define __ASM_SH_SYSTEM_32_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/mmu.h>
5 6
6#ifdef CONFIG_SH_DSP 7#ifdef CONFIG_SH_DSP
7 8
@@ -216,6 +217,17 @@ static inline reg_size_t register_align(void *val)
216int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, 217int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
217 struct mem_access *ma, int); 218 struct mem_access *ma, int);
218 219
220static inline void trigger_address_error(void)
221{
222 if (__in_29bit_mode())
223 __asm__ __volatile__ (
224 "ldc %0, sr\n\t"
225 "mov.l @%1, %0"
226 :
227 : "r" (0x10000000), "r" (0x80000001)
228 );
229}
230
219asmlinkage void do_address_error(struct pt_regs *regs, 231asmlinkage void do_address_error(struct pt_regs *regs,
220 unsigned long writeaccess, 232 unsigned long writeaccess,
221 unsigned long address); 233 unsigned long address);
diff --git a/arch/sh/include/asm/system_64.h b/arch/sh/include/asm/system_64.h
index ab1dd917ea87..604ba7802cc2 100644
--- a/arch/sh/include/asm/system_64.h
+++ b/arch/sh/include/asm/system_64.h
@@ -48,6 +48,13 @@ static inline reg_size_t register_align(void *val)
48 return (unsigned long long)(signed long long)(signed long)val; 48 return (unsigned long long)(signed long long)(signed long)val;
49} 49}
50 50
51extern void phys_stext(void);
52
53static inline void trigger_address_error(void)
54{
55 phys_stext();
56}
57
51#define SR_BL_LL 0x0000000010000000LL 58#define SR_BL_LL 0x0000000010000000LL
52 59
53static inline void set_bl_bit(void) 60static inline void set_bl_bit(void)