• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * 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/kernel.h>
21 #include <linux/pm.h>
22 
23 #include <asm/reboot.h>
24 #include <asm/lasat/lasat.h>
25 
26 #include "picvue.h"
27 #include "prom.h"
28 
29 static void lasat_machine_restart(char *command);
30 static void lasat_machine_halt(void);
31 
32 /* Used to set machine to boot in service mode via /proc interface */
33 int lasat_boot_to_service;
34 
lasat_machine_restart(char * command)35 static void lasat_machine_restart(char *command)
36 {
37 	local_irq_disable();
38 
39 	if (lasat_boot_to_service) {
40 		*(volatile unsigned int *)0xa0000024 = 0xdeadbeef;
41 		*(volatile unsigned int *)0xa00000fc = 0xfedeabba;
42 	}
43 	*lasat_misc->reset_reg = 0xbedead;
44 	for (;;) ;
45 }
46 
lasat_machine_halt(void)47 static void lasat_machine_halt(void)
48 {
49 	local_irq_disable();
50 
51 	prom_monitor();
52 	for (;;) ;
53 }
54 
lasat_reboot_setup(void)55 void lasat_reboot_setup(void)
56 {
57 	_machine_restart = lasat_machine_restart;
58 	_machine_halt = lasat_machine_halt;
59 	pm_power_off = lasat_machine_halt;
60 }
61