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