1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#ifndef __ASM_ARCH_OMAP_CPU_H
29#define __ASM_ARCH_OMAP_CPU_H
30
31#include <asm/irq.h>
32#include <mach/hardware.h>
33#include <mach/irqs.h>
34
35#ifndef __ASSEMBLY__
36
37#include <linux/bitops.h>
38
39
40
41
42#undef MULTI_OMAP1
43#undef OMAP_NAME
44
45#ifdef CONFIG_ARCH_OMAP730
46# ifdef OMAP_NAME
47# undef MULTI_OMAP1
48# define MULTI_OMAP1
49# else
50# define OMAP_NAME omap730
51# endif
52#endif
53#ifdef CONFIG_ARCH_OMAP850
54# ifdef OMAP_NAME
55# undef MULTI_OMAP1
56# define MULTI_OMAP1
57# else
58# define OMAP_NAME omap850
59# endif
60#endif
61#ifdef CONFIG_ARCH_OMAP15XX
62# ifdef OMAP_NAME
63# undef MULTI_OMAP1
64# define MULTI_OMAP1
65# else
66# define OMAP_NAME omap1510
67# endif
68#endif
69#ifdef CONFIG_ARCH_OMAP16XX
70# ifdef OMAP_NAME
71# undef MULTI_OMAP1
72# define MULTI_OMAP1
73# else
74# define OMAP_NAME omap16xx
75# endif
76#endif
77
78
79
80
81
82
83
84unsigned int omap_rev(void);
85
86
87
88
89#define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
90
91
92
93
94
95
96
97
98#define GET_OMAP_CLASS (omap_rev() & 0xff)
99
100#define IS_OMAP_CLASS(class, id) \
101static inline int is_omap ##class (void) \
102{ \
103 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
104}
105
106#define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
107
108#define IS_OMAP_SUBCLASS(subclass, id) \
109static inline int is_omap ##subclass (void) \
110{ \
111 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
112}
113
114IS_OMAP_CLASS(7xx, 0x07)
115IS_OMAP_CLASS(15xx, 0x15)
116IS_OMAP_CLASS(16xx, 0x16)
117
118#define cpu_is_omap7xx() 0
119#define cpu_is_omap15xx() 0
120#define cpu_is_omap16xx() 0
121
122#if defined(MULTI_OMAP1)
123# if defined(CONFIG_ARCH_OMAP730)
124# undef cpu_is_omap7xx
125# define cpu_is_omap7xx() is_omap7xx()
126# endif
127# if defined(CONFIG_ARCH_OMAP850)
128# undef cpu_is_omap7xx
129# define cpu_is_omap7xx() is_omap7xx()
130# endif
131# if defined(CONFIG_ARCH_OMAP15XX)
132# undef cpu_is_omap15xx
133# define cpu_is_omap15xx() is_omap15xx()
134# endif
135# if defined(CONFIG_ARCH_OMAP16XX)
136# undef cpu_is_omap16xx
137# define cpu_is_omap16xx() is_omap16xx()
138# endif
139#else
140# if defined(CONFIG_ARCH_OMAP730)
141# undef cpu_is_omap7xx
142# define cpu_is_omap7xx() 1
143# endif
144# if defined(CONFIG_ARCH_OMAP850)
145# undef cpu_is_omap7xx
146# define cpu_is_omap7xx() 1
147# endif
148# if defined(CONFIG_ARCH_OMAP15XX)
149# undef cpu_is_omap15xx
150# define cpu_is_omap15xx() 1
151# endif
152# if defined(CONFIG_ARCH_OMAP16XX)
153# undef cpu_is_omap16xx
154# define cpu_is_omap16xx() 1
155# endif
156#endif
157
158
159
160
161
162
163
164
165
166
167
168
169#define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
170
171#define IS_OMAP_TYPE(type, id) \
172static inline int is_omap ##type (void) \
173{ \
174 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
175}
176
177IS_OMAP_TYPE(310, 0x0310)
178IS_OMAP_TYPE(1510, 0x1510)
179IS_OMAP_TYPE(1610, 0x1610)
180IS_OMAP_TYPE(1611, 0x1611)
181IS_OMAP_TYPE(5912, 0x1611)
182IS_OMAP_TYPE(1621, 0x1621)
183IS_OMAP_TYPE(1710, 0x1710)
184
185#define cpu_is_omap310() 0
186#define cpu_is_omap1510() 0
187#define cpu_is_omap1610() 0
188#define cpu_is_omap5912() 0
189#define cpu_is_omap1611() 0
190#define cpu_is_omap1621() 0
191#define cpu_is_omap1710() 0
192
193
194#ifdef CONFIG_ARCH_OMAP1
195#define cpu_is_omap242x() 0
196#define cpu_is_omap2430() 0
197#define cpu_is_omap243x() 0
198#define cpu_is_omap24xx() 0
199#define cpu_is_omap34xx() 0
200#define cpu_is_omap44xx() 0
201#define soc_is_omap54xx() 0
202#define soc_is_dra7xx() 0
203#define soc_is_am33xx() 0
204#define cpu_class_is_omap1() 1
205#define cpu_class_is_omap2() 0
206#endif
207
208
209
210
211
212
213#if defined(CONFIG_ARCH_OMAP15XX)
214# undef cpu_is_omap310
215# undef cpu_is_omap1510
216# define cpu_is_omap310() is_omap310()
217# define cpu_is_omap1510() is_omap1510()
218#endif
219
220#if defined(CONFIG_ARCH_OMAP16XX)
221# undef cpu_is_omap1610
222# undef cpu_is_omap1611
223# undef cpu_is_omap5912
224# undef cpu_is_omap1621
225# undef cpu_is_omap1710
226# define cpu_is_omap1610() is_omap1610()
227# define cpu_is_omap1611() is_omap1611()
228# define cpu_is_omap5912() is_omap5912()
229# define cpu_is_omap1621() is_omap1621()
230# define cpu_is_omap1710() is_omap1710()
231#endif
232
233#endif
234#endif
235