[adm5120] don't use mips_machgroup
[openwrt.git] / target / linux / adm5120 / files / arch / mips / adm5120 / reset.c
1 /*
2  *  $Id$
3  *
4  *  ADM5120 specific reset routines
5  *
6  *  Copyright (C) 2007 OpenWrt.org
7  *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
8  *
9  *  This code was based on the ADM5120 specific port of the Linux 2.6.10 kernel
10  *  done by Jeroen Vreeken
11  *      Copyright (C) 2005 Jeroen Vreeken (pe1rxq@amsat.org)
12  *
13  *  Jeroen's code was based on the Linux 2.4.xx source codes found in various
14  *  tarballs released by Edimax for it's ADM5120 based devices.
15  *      Copyright (C) ADMtek Incorporated
16  *
17  *  This program is free software; you can redistribute it and/or modify it
18  *  under the terms of the GNU General Public License version 2 as published
19  *  by the Free Software Foundation.
20  *
21  */
22
23 #include <linux/types.h>
24 #include <linux/kernel.h>
25 #include <linux/init.h>
26
27 #include <linux/irq.h>
28 #include <linux/io.h>
29
30 #include <asm/bootinfo.h>
31 #include <asm/addrspace.h>
32
33 #include <adm5120_info.h>
34 #include <adm5120_defs.h>
35 #include <adm5120_switch.h>
36
37 void (*adm5120_board_reset)(void);
38
39 void adm5120_restart(char *command)
40 {
41         /* TODO: stop switch before reset */
42
43         if (adm5120_board_reset)
44                 adm5120_board_reset();
45
46         SW_WRITE_REG(SWITCH_REG_SOFT_RESET, 1);
47 }
48
49 void adm5120_halt(void)
50 {
51         local_irq_disable();
52
53         printk(KERN_NOTICE "\n** You can safely turn off the power\n");
54         while (1) {
55                 if (cpu_wait)
56                         cpu_wait();
57         };
58 }