aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/cobalt/reset.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/cobalt/reset.c')
-rw-r--r--arch/mips/cobalt/reset.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/arch/mips/cobalt/reset.c b/arch/mips/cobalt/reset.c
index 71eb4ccc4bc1..516b4428df4e 100644
--- a/arch/mips/cobalt/reset.c
+++ b/arch/mips/cobalt/reset.c
@@ -10,9 +10,10 @@
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/jiffies.h>
14#include <linux/leds.h> 13#include <linux/leds.h>
15 14
15#include <asm/processor.h>
16
16#include <cobalt.h> 17#include <cobalt.h>
17 18
18#define RESET_PORT ((void __iomem *)CKSEG1ADDR(0x1c000000)) 19#define RESET_PORT ((void __iomem *)CKSEG1ADDR(0x1c000000))
@@ -29,28 +30,15 @@ device_initcall(ledtrig_power_off_init);
29 30
30void cobalt_machine_halt(void) 31void cobalt_machine_halt(void)
31{ 32{
32 int state, last, diff;
33 unsigned long mark;
34
35 /* 33 /*
36 * turn on power off LED on RaQ 34 * turn on power off LED on RaQ
37 *
38 * restart if ENTER and SELECT are pressed
39 */ 35 */
40
41 last = COBALT_KEY_PORT;
42
43 led_trigger_event(power_off_led_trigger, LED_FULL); 36 led_trigger_event(power_off_led_trigger, LED_FULL);
44 37
45 for (state = 0;;) { 38 local_irq_disable();
46 diff = COBALT_KEY_PORT ^ last; 39 while (1) {
47 last ^= diff; 40 if (cpu_wait)
48 41 cpu_wait();
49 if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)))
50 writeb(RESET, RESET_PORT);
51
52 for (mark = jiffies; jiffies - mark < HZ;)
53 ;
54 } 42 }
55} 43}
56 44