Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/include/asm-arm/arch-ixp2000/system.h |
| 3 | * |
| 4 | * Copyright (C) 2002 Intel Corp. |
| 5 | * Copyricht (C) 2003-2005 MontaVista Software, Inc. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | */ |
| 11 | |
| 12 | #include <asm/hardware.h> |
| 13 | #include <asm/mach-types.h> |
| 14 | |
| 15 | static inline void arch_idle(void) |
| 16 | { |
| 17 | cpu_do_idle(); |
| 18 | } |
| 19 | |
| 20 | static inline void arch_reset(char mode) |
| 21 | { |
| 22 | local_irq_disable(); |
| 23 | |
| 24 | /* |
| 25 | * Reset flash banking register so that we are pointing at |
| 26 | * RedBoot bank. |
| 27 | */ |
| 28 | if (machine_is_ixdp2401()) { |
Lennert Buytenhek | e9b72e4 | 2005-11-01 19:44:26 +0000 | [diff] [blame] | 29 | ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG, |
| 30 | ((0 >> IXDP2X01_FLASH_WINDOW_BITS) |
| 31 | | IXDP2X01_CPLD_FLASH_INTERN)); |
| 32 | ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | /* |
| 36 | * On IXDP2801 we need to write this magic sequence to the CPLD |
| 37 | * to cause a complete reset of the CPU and all external devices |
Lennert Buytenhek | e9b72e4 | 2005-11-01 19:44:26 +0000 | [diff] [blame] | 38 | * and move the flash bank register back to 0. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | */ |
Deepak Saxena | 0328ad2 | 2006-03-20 17:10:08 +0000 | [diff] [blame] | 40 | if (machine_is_ixdp2801() || machine_is_ixdp28x5()) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG; |
Lennert Buytenhek | e9b72e4 | 2005-11-01 19:44:26 +0000 | [diff] [blame] | 42 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF); |
Lennert Buytenhek | e9b72e4 | 2005-11-01 19:44:26 +0000 | [diff] [blame] | 44 | ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg); |
| 45 | ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | } |
| 47 | |
Lennert Buytenhek | e9b72e4 | 2005-11-01 19:44:26 +0000 | [diff] [blame] | 48 | ixp2000_reg_wrb(IXP2000_RESET0, RSTALL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | } |