blob: 176d9d6c258e0497163d21bf5636bc7ddfd86125 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
Russell Kingf8ce2542006-01-07 16:15:52 +00007#include <linux/clk.h>
8
Tony Lindgrenaf973d22005-07-10 19:58:06 +01009#include <asm/mach-types.h>
Russell Kingbe509722008-08-04 10:41:28 +010010#include <asm/arch/hardware.h>
Tony Lindgren9ad58972005-11-10 14:26:53 +000011
12#ifndef CONFIG_MACH_VOICEBLUE
13#define voiceblue_reset() do {} while (0)
14#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Tony Lindgrenb824efa2006-04-02 17:46:20 +010016extern void omap_prcm_arch_reset(char mode);
17
Linus Torvalds1da177e2005-04-16 15:20:36 -070018static inline void arch_idle(void)
19{
20 cpu_do_idle();
21}
22
Tony Lindgren9ad58972005-11-10 14:26:53 +000023static inline void omap1_arch_reset(char mode)
Linus Torvalds1da177e2005-04-16 15:20:36 -070024{
Tony Lindgrenaf973d22005-07-10 19:58:06 +010025 /*
26 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
27 * "Global Software Reset Affects Traffic Controller Frequency".
28 */
29 if (cpu_is_omap5912()) {
30 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4),
31 DPLL_CTL);
32 omap_writew(0x8, ARM_RSTCT1);
33 }
Tony Lindgren9ad58972005-11-10 14:26:53 +000034
Tony Lindgrenaf973d22005-07-10 19:58:06 +010035 if (machine_is_voiceblue())
36 voiceblue_reset();
37 else
Tony Lindgrenaf973d22005-07-10 19:58:06 +010038 omap_writew(1, ARM_RSTCT1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070039}
40
Tony Lindgren9ad58972005-11-10 14:26:53 +000041static inline void arch_reset(char mode)
42{
43 if (!cpu_is_omap24xx())
44 omap1_arch_reset(mode);
45 else
Tony Lindgrenb824efa2006-04-02 17:46:20 +010046 omap_prcm_arch_reset(mode);
Tony Lindgren9ad58972005-11-10 14:26:53 +000047}
48
Linus Torvalds1da177e2005-04-16 15:20:36 -070049#endif