Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copied from linux/include/asm-arm/arch-sa1100/system.h |
| 3 | * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> |
| 4 | */ |
| 5 | #ifndef __ASM_ARCH_SYSTEM_H |
| 6 | #define __ASM_ARCH_SYSTEM_H |
| 7 | #include <linux/config.h> |
Russell King | f8ce254 | 2006-01-07 16:15:52 +0000 | [diff] [blame] | 8 | #include <linux/clk.h> |
| 9 | |
Tony Lindgren | af973d2 | 2005-07-10 19:58:06 +0100 | [diff] [blame] | 10 | #include <asm/mach-types.h> |
Russell King | 0a5709b | 2005-11-16 14:51:20 +0000 | [diff] [blame] | 11 | #include <asm/hardware.h> |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 12 | |
| 13 | #ifndef CONFIG_MACH_VOICEBLUE |
| 14 | #define voiceblue_reset() do {} while (0) |
| 15 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Tony Lindgren | b824efa | 2006-04-02 17:46:20 +0100 | [diff] [blame] | 17 | extern void omap_prcm_arch_reset(char mode); |
| 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | static inline void arch_idle(void) |
| 20 | { |
| 21 | cpu_do_idle(); |
| 22 | } |
| 23 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 24 | static inline void omap1_arch_reset(char mode) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | { |
Tony Lindgren | af973d2 | 2005-07-10 19:58:06 +0100 | [diff] [blame] | 26 | /* |
| 27 | * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 |
| 28 | * "Global Software Reset Affects Traffic Controller Frequency". |
| 29 | */ |
| 30 | if (cpu_is_omap5912()) { |
| 31 | omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), |
| 32 | DPLL_CTL); |
| 33 | omap_writew(0x8, ARM_RSTCT1); |
| 34 | } |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 35 | |
Tony Lindgren | af973d2 | 2005-07-10 19:58:06 +0100 | [diff] [blame] | 36 | if (machine_is_voiceblue()) |
| 37 | voiceblue_reset(); |
| 38 | else |
Tony Lindgren | af973d2 | 2005-07-10 19:58:06 +0100 | [diff] [blame] | 39 | omap_writew(1, ARM_RSTCT1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | } |
| 41 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 42 | static inline void arch_reset(char mode) |
| 43 | { |
| 44 | if (!cpu_is_omap24xx()) |
| 45 | omap1_arch_reset(mode); |
| 46 | else |
Tony Lindgren | b824efa | 2006-04-02 17:46:20 +0100 | [diff] [blame] | 47 | omap_prcm_arch_reset(mode); |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame] | 48 | } |
| 49 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | #endif |