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> |
Tony Lindgren | af973d2 | 2005-07-10 19:58:06 +0100 | [diff] [blame] | 8 | #include <asm/mach-types.h> |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame^] | 9 | #include <asm/hardware/clock.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <asm/arch/hardware.h> |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame^] | 11 | #include <asm/arch/prcm.h> |
| 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 | |
| 17 | static inline void arch_idle(void) |
| 18 | { |
| 19 | cpu_do_idle(); |
| 20 | } |
| 21 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame^] | 22 | static inline void omap1_arch_reset(char mode) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | { |
Tony Lindgren | af973d2 | 2005-07-10 19:58:06 +0100 | [diff] [blame] | 24 | /* |
| 25 | * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 |
| 26 | * "Global Software Reset Affects Traffic Controller Frequency". |
| 27 | */ |
| 28 | if (cpu_is_omap5912()) { |
| 29 | omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), |
| 30 | DPLL_CTL); |
| 31 | omap_writew(0x8, ARM_RSTCT1); |
| 32 | } |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame^] | 33 | |
Tony Lindgren | af973d2 | 2005-07-10 19:58:06 +0100 | [diff] [blame] | 34 | if (machine_is_voiceblue()) |
| 35 | voiceblue_reset(); |
| 36 | else |
Tony Lindgren | af973d2 | 2005-07-10 19:58:06 +0100 | [diff] [blame] | 37 | omap_writew(1, ARM_RSTCT1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | } |
| 39 | |
Tony Lindgren | 9ad5897 | 2005-11-10 14:26:53 +0000 | [diff] [blame^] | 40 | static inline void omap2_arch_reset(char mode) |
| 41 | { |
| 42 | u32 rate; |
| 43 | struct clk *vclk, *sclk; |
| 44 | |
| 45 | vclk = clk_get(NULL, "virt_prcm_set"); |
| 46 | sclk = clk_get(NULL, "sys_ck"); |
| 47 | rate = clk_get_rate(sclk); |
| 48 | clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */ |
| 49 | RM_RSTCTRL_WKUP |= 2; |
| 50 | } |
| 51 | |
| 52 | static inline void arch_reset(char mode) |
| 53 | { |
| 54 | if (!cpu_is_omap24xx()) |
| 55 | omap1_arch_reset(mode); |
| 56 | else |
| 57 | omap2_arch_reset(mode); |
| 58 | } |
| 59 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | #endif |