[SCSI] qla1280: convert to use the data buffer accessors
[linux-2.6/verdex.git] / arch / mips / cobalt / reset.c
blob71eb4ccc4bc15e2a369b26d129526dd1a39e290d
1 /*
2 * Cobalt Reset operations
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
8 * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
9 * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
11 #include <linux/init.h>
12 #include <linux/io.h>
13 #include <linux/jiffies.h>
14 #include <linux/leds.h>
16 #include <cobalt.h>
18 #define RESET_PORT ((void __iomem *)CKSEG1ADDR(0x1c000000))
19 #define RESET 0x0f
21 DEFINE_LED_TRIGGER(power_off_led_trigger);
23 static int __init ledtrig_power_off_init(void)
25 led_trigger_register_simple("power-off", &power_off_led_trigger);
26 return 0;
28 device_initcall(ledtrig_power_off_init);
30 void cobalt_machine_halt(void)
32 int state, last, diff;
33 unsigned long mark;
36 * turn on power off LED on RaQ
38 * restart if ENTER and SELECT are pressed
41 last = COBALT_KEY_PORT;
43 led_trigger_event(power_off_led_trigger, LED_FULL);
45 for (state = 0;;) {
46 diff = COBALT_KEY_PORT ^ last;
47 last ^= diff;
49 if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)))
50 writeb(RESET, RESET_PORT);
52 for (mark = jiffies; jiffies - mark < HZ;)
57 void cobalt_machine_restart(char *command)
59 writeb(RESET, RESET_PORT);
61 /* we should never get here */
62 cobalt_machine_halt();