1#define DEBUG 2/* 3 * Carsten Langgaard, carstenl@mips.com 4 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. 5 * 6 * ######################################################################## 7 * 8 * This program is free software; you can distribute it and/or modify it 9 * under the terms of the GNU General Public License (Version 2) as 10 * published by the Free Software Foundation. 11 * 12 * This program is distributed in the hope it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 * for more details. 16 * 17 * You should have received a copy of the GNU General Public License along 18 * with this program; if not, write to the Free Software Foundation, Inc., 19 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 20 * 21 * ######################################################################## 22 * 23 * Reset the MIPS boards. 24 * 25 */ 26#include <linux/init.h> 27#include <linux/pm.h> 28 29#include <asm/io.h> 30#include <asm/reboot.h> 31 32#define SOFTRES_REG 0x1F000050 33#define GORESET 0x4D 34 35static void mips_machine_restart(char *command); 36static void mips_machine_halt(void); 37 38static void mips_machine_restart(char *command) 39{ 40 unsigned int __iomem *softres_reg = 41 ioremap(SOFTRES_REG, sizeof(unsigned int)); 42 43 __raw_writel(GORESET, softres_reg); 44} 45 46static void mips_machine_halt(void) 47{ 48 unsigned int __iomem *softres_reg = 49 ioremap(SOFTRES_REG, sizeof(unsigned int)); 50 51 __raw_writel(GORESET, softres_reg); 52} 53 54 55static int __init mips_reboot_setup(void) 56{ 57 _machine_restart = mips_machine_restart; 58 _machine_halt = mips_machine_halt; 59 pm_power_off = mips_machine_halt; 60 61 return 0; 62} 63 64arch_initcall(mips_reboot_setup); 65