2005-04-16 15:20:36 -07:00
/*
2008-08-05 16:14:15 +01:00
* arch / arm / mach - ixp2000 / include / mach / system . h
2005-04-16 15:20:36 -07:00
*
* Copyright ( C ) 2002 Intel Corp .
* Copyricht ( C ) 2003 - 2005 MontaVista Software , Inc .
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation .
*/
2008-08-05 16:14:15 +01:00
# include <mach/hardware.h>
2005-04-16 15:20:36 -07:00
# include <asm/mach-types.h>
static inline void arch_idle ( void )
{
cpu_do_idle ( ) ;
}
2009-03-19 16:20:24 +00:00
static inline void arch_reset ( char mode , const char * cmd )
2005-04-16 15:20:36 -07:00
{
local_irq_disable ( ) ;
/*
* Reset flash banking register so that we are pointing at
* RedBoot bank .
*/
if ( machine_is_ixdp2401 ( ) ) {
2005-11-01 19:44:26 +00:00
ixp2000_reg_write ( IXDP2X01_CPLD_FLASH_REG ,
( ( 0 > > IXDP2X01_FLASH_WINDOW_BITS )
| IXDP2X01_CPLD_FLASH_INTERN ) ) ;
ixp2000_reg_wrb ( IXDP2X01_CPLD_RESET_REG , 0xffffffff ) ;
2005-04-16 15:20:36 -07:00
}
/*
* On IXDP2801 we need to write this magic sequence to the CPLD
* to cause a complete reset of the CPU and all external devices
2005-11-01 19:44:26 +00:00
* and move the flash bank register back to 0.
2005-04-16 15:20:36 -07:00
*/
2006-03-20 17:10:08 +00:00
if ( machine_is_ixdp2801 ( ) | | machine_is_ixdp28x5 ( ) ) {
2005-04-16 15:20:36 -07:00
unsigned long reset_reg = * IXDP2X01_CPLD_RESET_REG ;
2005-11-01 19:44:26 +00:00
2005-04-16 15:20:36 -07:00
reset_reg = 0x55AA0000 | ( reset_reg & 0x0000FFFF ) ;
2005-11-01 19:44:26 +00:00
ixp2000_reg_write ( IXDP2X01_CPLD_RESET_REG , reset_reg ) ;
ixp2000_reg_wrb ( IXDP2X01_CPLD_RESET_REG , 0x80000000 ) ;
2005-04-16 15:20:36 -07:00
}
2005-11-01 19:44:26 +00:00
ixp2000_reg_wrb ( IXP2000_RESET0 , RSTALL ) ;
2005-04-16 15:20:36 -07:00
}