blob: 181bf68175fccf18255c81079928e56d6b8df83f [file] [log] [blame]
Ralf Baechle42a3b4f2005-09-03 15:56:17 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Thomas Horsten <thh@lasat.com>
3 * Copyright (C) 2000 LASAT Networks A/S.
4 *
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.
8 *
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.
13 *
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.
17 *
18 * Reset the LASAT board.
19 */
20#include <linux/config.h>
21#include <linux/kernel.h>
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000022#include <linux/pm.h>
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#include <asm/reboot.h>
25#include <asm/system.h>
26#include <asm/lasat/lasat.h>
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000027
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include "picvue.h"
29#include "prom.h"
30
31static void lasat_machine_restart(char *command);
32static void lasat_machine_halt(void);
33
34/* Used to set machine to boot in service mode via /proc interface */
35int lasat_boot_to_service = 0;
36
37static void lasat_machine_restart(char *command)
38{
39 local_irq_disable();
40
41 if (lasat_boot_to_service) {
42 printk("machine_restart: Rebooting to service mode\n");
43 *(volatile unsigned int *)0xa0000024 = 0xdeadbeef;
44 *(volatile unsigned int *)0xa00000fc = 0xfedeabba;
45 }
46 *lasat_misc->reset_reg = 0xbedead;
47 for (;;) ;
48}
49
50#define MESSAGE "System halted"
51static void lasat_machine_halt(void)
52{
53 local_irq_disable();
54
55 /* Disable interrupts and loop forever */
56 printk(KERN_NOTICE MESSAGE "\n");
57#ifdef CONFIG_PICVUE
58 pvc_clear();
59 pvc_write_string(MESSAGE, 0, 0);
60#endif
61 prom_monitor();
62 for (;;) ;
63}
64
65void lasat_reboot_setup(void)
66{
67 _machine_restart = lasat_machine_restart;
68 _machine_halt = lasat_machine_halt;
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000069 pm_power_off = lasat_machine_halt;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070}