Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Cobalt Reset operations
0003  *
0004  * This file is subject to the terms and conditions of the GNU General Public
0005  * License.  See the file "COPYING" in the main directory of this archive
0006  * for more details.
0007  *
0008  * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
0009  * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
0010  */
0011 #include <linux/init.h>
0012 #include <linux/io.h>
0013 #include <linux/leds.h>
0014 
0015 #include <asm/idle.h>
0016 #include <asm/processor.h>
0017 
0018 #include <cobalt.h>
0019 
0020 #define RESET_PORT  ((void __iomem *)CKSEG1ADDR(0x1c000000))
0021 #define RESET       0x0f
0022 
0023 DEFINE_LED_TRIGGER(power_off_led_trigger);
0024 
0025 static int __init ledtrig_power_off_init(void)
0026 {
0027     led_trigger_register_simple("power-off", &power_off_led_trigger);
0028     return 0;
0029 }
0030 device_initcall(ledtrig_power_off_init);
0031 
0032 void cobalt_machine_halt(void)
0033 {
0034     /*
0035      * turn on power off LED on RaQ
0036      */
0037     led_trigger_event(power_off_led_trigger, LED_FULL);
0038 
0039     local_irq_disable();
0040     while (1) {
0041         if (cpu_wait)
0042             cpu_wait();
0043     }
0044 }
0045 
0046 void cobalt_machine_restart(char *command)
0047 {
0048     writeb(RESET, RESET_PORT);
0049 
0050     /* we should never get here */
0051     cobalt_machine_halt();
0052 }