diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2006-06-19 14:57:12 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-06-19 14:57:12 -0400 |
commit | 74617fb6b825ea370ae72565f7543306bc08ef6e (patch) | |
tree | ac6032e0b476f1bf61bf03aba44240e448739d57 /arch/arm/kernel/process.c | |
parent | b7408aff2d325581dcafffa5dbcc09c42ae64b5d (diff) |
[ARM] 3593/1: Add reboot and shutdown handlers for Zaurus handhelds
Patch from Richard Purdie
Add functionality to allow machine specific reboot handlers on ARM.
Add machine specific reboot and poweroff handlers for all PXA Zaurus
models.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r-- | arch/arm/kernel/process.c | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 7df6e1aaa323..17c38dbf2f3c 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/cpu.h> | 29 | #include <linux/cpu.h> |
30 | #include <linux/elfcore.h> | 30 | #include <linux/elfcore.h> |
31 | #include <linux/pm.h> | ||
31 | 32 | ||
32 | #include <asm/leds.h> | 33 | #include <asm/leds.h> |
33 | #include <asm/processor.h> | 34 | #include <asm/processor.h> |
@@ -71,8 +72,36 @@ static int __init hlt_setup(char *__unused) | |||
71 | __setup("nohlt", nohlt_setup); | 72 | __setup("nohlt", nohlt_setup); |
72 | __setup("hlt", hlt_setup); | 73 | __setup("hlt", hlt_setup); |
73 | 74 | ||
75 | void arm_machine_restart(char mode) | ||
76 | { | ||
77 | /* | ||
78 | * Clean and disable cache, and turn off interrupts | ||
79 | */ | ||
80 | cpu_proc_fin(); | ||
81 | |||
82 | /* | ||
83 | * Tell the mm system that we are going to reboot - | ||
84 | * we may need it to insert some 1:1 mappings so that | ||
85 | * soft boot works. | ||
86 | */ | ||
87 | setup_mm_for_reboot(mode); | ||
88 | |||
89 | /* | ||
90 | * Now call the architecture specific reboot code. | ||
91 | */ | ||
92 | arch_reset(mode); | ||
93 | |||
94 | /* | ||
95 | * Whoops - the architecture was unable to reboot. | ||
96 | * Tell the user! | ||
97 | */ | ||
98 | mdelay(1000); | ||
99 | printk("Reboot failed -- System halted\n"); | ||
100 | while (1); | ||
101 | } | ||
102 | |||
74 | /* | 103 | /* |
75 | * The following aren't currently used. | 104 | * Function pointers to optional machine specific functions |
76 | */ | 105 | */ |
77 | void (*pm_idle)(void); | 106 | void (*pm_idle)(void); |
78 | EXPORT_SYMBOL(pm_idle); | 107 | EXPORT_SYMBOL(pm_idle); |
@@ -80,6 +109,10 @@ EXPORT_SYMBOL(pm_idle); | |||
80 | void (*pm_power_off)(void); | 109 | void (*pm_power_off)(void); |
81 | EXPORT_SYMBOL(pm_power_off); | 110 | EXPORT_SYMBOL(pm_power_off); |
82 | 111 | ||
112 | void (*arm_pm_restart)(char str) = arm_machine_restart; | ||
113 | EXPORT_SYMBOL_GPL(arm_pm_restart); | ||
114 | |||
115 | |||
83 | /* | 116 | /* |
84 | * This is our default idle handler. We need to disable | 117 | * This is our default idle handler. We need to disable |
85 | * interrupts here to ensure we don't miss a wakeup call. | 118 | * interrupts here to ensure we don't miss a wakeup call. |
@@ -151,33 +184,9 @@ void machine_power_off(void) | |||
151 | pm_power_off(); | 184 | pm_power_off(); |
152 | } | 185 | } |
153 | 186 | ||
154 | |||
155 | void machine_restart(char * __unused) | 187 | void machine_restart(char * __unused) |
156 | { | 188 | { |
157 | /* | 189 | arm_pm_restart(reboot_mode); |
158 | * Clean and disable cache, and turn off interrupts | ||
159 | */ | ||
160 | cpu_proc_fin(); | ||
161 | |||
162 | /* | ||
163 | * Tell the mm system that we are going to reboot - | ||
164 | * we may need it to insert some 1:1 mappings so that | ||
165 | * soft boot works. | ||
166 | */ | ||
167 | setup_mm_for_reboot(reboot_mode); | ||
168 | |||
169 | /* | ||
170 | * Now call the architecture specific reboot code. | ||
171 | */ | ||
172 | arch_reset(reboot_mode); | ||
173 | |||
174 | /* | ||
175 | * Whoops - the architecture was unable to reboot. | ||
176 | * Tell the user! | ||
177 | */ | ||
178 | mdelay(1000); | ||
179 | printk("Reboot failed -- System halted\n"); | ||
180 | while (1); | ||
181 | } | 190 | } |
182 | 191 | ||
183 | void __show_regs(struct pt_regs *regs) | 192 | void __show_regs(struct pt_regs *regs) |