source: trunk/target/linux/rdc/files-2.6.30/arch/x86/mach-rdc321x/reboot.c @ 19977

Last change on this file since 19977 was 19977, checked in by florian, 6 years ago

[rdc] rework reboot mechanism with the new watchdog fixes

The fixing of the watchdog driver makes it generate a NMI so the reboot_fixup
can no longer be called from NMI context, instead, override the machine_retart
callback with our southrbridge reboot mechanism. Patch by Bernhard Loos.

File size: 1.2 KB
Line 
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
22static 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
38static int __init rdc_setup_reset(void)
39{
40        machine_ops.emergency_restart = rdc321x_reset;
41        return 0;
42}
43
44arch_initcall(rdc_setup_reset);
Note: See TracBrowser for help on using the repository browser.