[backfire] iwinfo: merge r29417
[openwrt/svn-archive/archive.git] / target / linux / rdc / files-2.6.30 / arch / x86 / mach-rdc321x / reboot.c
1 /*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the
14 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
15 * Boston, MA 02110-1301, USA.
16 *
17 */
18
19 #include <asm/reboot.h>
20 #include <asm/io.h>
21
22 static void rdc321x_reset(void)
23 {
24 unsigned i;
25
26 /* write to southbridge config register 0x41
27 enable pci reset on cpu reset, make internal port 0x92 writeable
28 and switch port 0x92 to internal */
29 outl(0x80003840, 0xCF8);
30 i = inl(0xCFC);
31 i |= 0x1600;
32 outl(i, 0xCFC);
33
34 /* soft reset */
35 outb(1, 0x92);
36 }
37
38 static int __init rdc_setup_reset(void)
39 {
40 machine_ops.emergency_restart = rdc321x_reset;
41 return 0;
42 }
43
44 arch_initcall(rdc_setup_reset);