Merge tag 'sirf-iobrg2regmap-for-4.2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / arch / mips / cobalt / reset.c
CommitLineData
1da177e4
LT
1/*
2 * Cobalt Reset operations
3 *
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.
7 *
8 * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
9 * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
10 */
e86169ff 11#include <linux/init.h>
3282bd3c 12#include <linux/io.h>
e86169ff 13#include <linux/leds.h>
cc50b67d 14
bdc92d74 15#include <asm/idle.h>
167da469
YY
16#include <asm/processor.h>
17
cc50b67d 18#include <cobalt.h>
1da177e4 19
3282bd3c
YY
20#define RESET_PORT ((void __iomem *)CKSEG1ADDR(0x1c000000))
21#define RESET 0x0f
22
e86169ff
YY
23DEFINE_LED_TRIGGER(power_off_led_trigger);
24
25static int __init ledtrig_power_off_init(void)
26{
27 led_trigger_register_simple("power-off", &power_off_led_trigger);
28 return 0;
29}
30device_initcall(ledtrig_power_off_init);
31
c4ed38a0 32void cobalt_machine_halt(void)
1da177e4 33{
1da177e4 34 /*
e86169ff 35 * turn on power off LED on RaQ
1da177e4 36 */
e86169ff 37 led_trigger_event(power_off_led_trigger, LED_FULL);
c4ed38a0 38
71466dd4 39 local_irq_disable();
167da469
YY
40 while (1) {
41 if (cpu_wait)
42 cpu_wait();
43 }
1da177e4
LT
44}
45
c4ed38a0
RB
46void cobalt_machine_restart(char *command)
47{
3282bd3c 48 writeb(RESET, RESET_PORT);
c4ed38a0
RB
49
50 /* we should never get here */
51 cobalt_machine_halt();
52}