strip the kernel version suffix from target directories, except for brcm-2.4 (the...
[15.05/openwrt.git] / target / linux / adm5120 / files / arch / mips / adm5120 / reset.c
1 /*
2  *  $Id$
3  *
4  *  ADM5120 specific reset routines
5  *
6  *  Copyright (C) ADMtek Incorporated.
7  *  Copyright (C) 2005 Jeroen Vreeken (pe1rxq@amsat.org)
8  *  Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
9  *  Copyright (C) 2007 OpenWrt.org
10  *
11  *  This program is free software; you can redistribute it and/or
12  *  modify it under the terms of the GNU General Public License
13  *  as published by the Free Software Foundation; either version 2
14  *  of the License, or (at your option) any later version.
15  *
16  *  This program is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *  GNU General Public License for more details.
20  *
21  *  You should have received a copy of the GNU General Public License
22  *  along with this program; if not, write to the
23  *  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24  *  Boston, MA  02110-1301, USA.
25  *
26  */
27
28 #include <linux/types.h>
29 #include <linux/kernel.h>
30 #include <linux/init.h>
31
32 #include <asm/bootinfo.h>
33 #include <asm/addrspace.h>
34
35 #include <asm/mach-adm5120/adm5120_info.h>
36 #include <asm/mach-adm5120/adm5120_defs.h>
37 #include <asm/mach-adm5120/adm5120_switch.h>
38
39 #define ADM5120_SOFTRESET       0x12000004
40
41 void (*adm5120_board_reset)(void);
42
43 void adm5120_restart(char *command)
44 {
45         /* TODO: stop switch before reset */
46
47         if (adm5120_board_reset)
48                 adm5120_board_reset();
49
50         *(u32*)KSEG1ADDR(ADM5120_SOFTRESET)=1;
51 }
52
53 void adm5120_halt(void)
54 {
55         printk(KERN_NOTICE "\n** You can safely turn off the power\n");
56         while (1);
57 }
58
59 void adm5120_power_off(void)
60 {
61         adm5120_halt();
62 }