2005-04-17 02:20:36 +04:00
/*
* Carsten Langgaard , carstenl @ mips . com
* Copyright ( C ) 1999 , 2000 MIPS Technologies , Inc . All rights reserved .
*
* # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
*
* This program is free software ; you can distribute it and / or modify it
* under the terms of the GNU General Public License ( Version 2 ) as
* published by the Free Software Foundation .
*
* This program is distributed in the hope it will be useful , but WITHOUT
* ANY WARRANTY ; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE . See the GNU General Public License
* for more details .
*
* You should have received a copy of the GNU General Public License along
* with this program ; if not , write to the Free Software Foundation , Inc . ,
* 59 Temple Place - Suite 330 , Boston MA 02111 - 1307 , USA .
*
* # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
*
* Reset the MIPS boards .
*
*/
2009-09-15 16:50:39 +04:00
# include <linux/init.h>
2006-01-18 20:37:07 +03:00
# include <linux/pm.h>
2005-04-17 02:20:36 +04:00
# include <asm/io.h>
# include <asm/reboot.h>
# include <asm/mips-boards/generic.h>
static void mips_machine_restart ( char * command )
{
2008-01-08 06:44:00 +03:00
unsigned int __iomem * softres_reg =
ioremap ( SOFTRES_REG , sizeof ( unsigned int ) ) ;
2005-04-17 02:20:36 +04:00
2008-01-08 06:44:00 +03:00
__raw_writel ( GORESET , softres_reg ) ;
2005-04-17 02:20:36 +04:00
}
static void mips_machine_halt ( void )
{
2008-01-08 06:44:00 +03:00
unsigned int __iomem * softres_reg =
ioremap ( SOFTRES_REG , sizeof ( unsigned int ) ) ;
2005-04-17 02:20:36 +04:00
2008-01-08 06:44:00 +03:00
__raw_writel ( GORESET , softres_reg ) ;
2005-04-17 02:20:36 +04:00
}
2009-09-15 16:50:39 +04:00
static int __init mips_reboot_setup ( void )
2005-04-17 02:20:36 +04:00
{
_machine_restart = mips_machine_restart ;
_machine_halt = mips_machine_halt ;
2006-01-18 20:37:07 +03:00
pm_power_off = mips_machine_halt ;
2009-09-15 16:50:39 +04:00
return 0 ;
2005-04-17 02:20:36 +04:00
}
2009-09-15 16:50:39 +04:00
arch_initcall ( mips_reboot_setup ) ;