blob: 67970d1a2020b213a32d6b9c36f7bdc9ccb42014 [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
7#include <linux/config.h>
Russell Kingf8ce2542006-01-07 16:15:52 +00008#include <linux/clk.h>
9
Tony Lindgrenaf973d22005-07-10 19:58:06 +010010#include <asm/mach-types.h>
Russell King0a5709b2005-11-16 14:51:20 +000011#include <asm/hardware.h>
Tony Lindgren9ad58972005-11-10 14:26:53 +000012
13#ifndef CONFIG_MACH_VOICEBLUE
14#define voiceblue_reset() do {} while (0)
15#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Tony Lindgrenb824efa2006-04-02 17:46:20 +010017extern void omap_prcm_arch_reset(char mode);
18
Linus Torvalds1da177e2005-04-16 15:20:36 -070019static inline void arch_idle(void)
20{
21 cpu_do_idle();
22}
23
Tony Lindgren9ad58972005-11-10 14:26:53 +000024static inline void omap1_arch_reset(char mode)
Linus Torvalds1da177e2005-04-16 15:20:36 -070025{
Tony Lindgrenaf973d22005-07-10 19:58:06 +010026 /*
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 Lindgren9ad58972005-11-10 14:26:53 +000035
Tony Lindgrenaf973d22005-07-10 19:58:06 +010036 if (machine_is_voiceblue())
37 voiceblue_reset();
38 else
Tony Lindgrenaf973d22005-07-10 19:58:06 +010039 omap_writew(1, ARM_RSTCT1);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040}
41
Tony Lindgren9ad58972005-11-10 14:26:53 +000042static inline void arch_reset(char mode)
43{
44 if (!cpu_is_omap24xx())
45 omap1_arch_reset(mode);
46 else
Tony Lindgrenb824efa2006-04-02 17:46:20 +010047 omap_prcm_arch_reset(mode);
Tony Lindgren9ad58972005-11-10 14:26:53 +000048}
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#endif