RT-AC66 3.0.0.4.374.130 core
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / arch / mips / lasat / reset.c
blob9e22acf03083217b7687a9997b0e21290797fff3
1 /*
2 * Thomas Horsten <thh@lasat.com>
3 * Copyright (C) 2000 LASAT Networks A/S.
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
18 * Reset the LASAT board.
20 #include <linux/kernel.h>
21 #include <linux/pm.h>
23 #include <asm/reboot.h>
24 #include <asm/system.h>
25 #include <asm/lasat/lasat.h>
27 #include "picvue.h"
28 #include "prom.h"
30 static void lasat_machine_restart(char *command);
31 static void lasat_machine_halt(void);
33 /* Used to set machine to boot in service mode via /proc interface */
34 int lasat_boot_to_service = 0;
36 static void lasat_machine_restart(char *command)
38 local_irq_disable();
40 if (lasat_boot_to_service) {
41 printk("machine_restart: Rebooting to service mode\n");
42 *(volatile unsigned int *)0xa0000024 = 0xdeadbeef;
43 *(volatile unsigned int *)0xa00000fc = 0xfedeabba;
45 *lasat_misc->reset_reg = 0xbedead;
46 for (;;) ;
49 #define MESSAGE "System halted"
50 static void lasat_machine_halt(void)
52 local_irq_disable();
54 /* Disable interrupts and loop forever */
55 printk(KERN_NOTICE MESSAGE "\n");
56 #ifdef CONFIG_PICVUE
57 pvc_clear();
58 pvc_write_string(MESSAGE, 0, 0);
59 #endif
60 prom_monitor();
61 for (;;) ;
64 void lasat_reboot_setup(void)
66 _machine_restart = lasat_machine_restart;
67 _machine_halt = lasat_machine_halt;
68 pm_power_off = lasat_machine_halt;