2 * linux/include/asm-arm/arch-omap/cpu.h
4 * OMAP cpu type detection
6 * Copyright (C) 2004 Nokia Corporation
8 * Written by Tony Lindgren <tony.lindgren@nokia.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #ifndef __ASM_ARCH_OMAP_CPU_H
27 #define __ASM_ARCH_OMAP_CPU_H
29 extern unsigned int system_rev;
31 #define OMAP_DIE_ID_0 0xfffe1800
32 #define OMAP_DIE_ID_1 0xfffe1804
33 #define OMAP_PRODUCTION_ID_0 0xfffe2000
34 #define OMAP_PRODUCTION_ID_1 0xfffe2004
35 #define OMAP32_ID_0 0xfffed400
36 #define OMAP32_ID_1 0xfffed404
39 * Test if multicore OMAP support is needed
45 #ifdef CONFIG_ARCH_OMAP730
50 # define OMAP_NAME omap730
53 #ifdef CONFIG_ARCH_OMAP1510
58 # define OMAP_NAME omap1510
61 #ifdef CONFIG_ARCH_OMAP16XX
66 # define OMAP_NAME omap16xx
69 #ifdef CONFIG_ARCH_OMAP24XX
70 # if (defined(OMAP_NAME) || defined(MULTI_OMAP1))
71 # error "OMAP1 and OMAP2 can't be selected at the same time"
74 # define OMAP_NAME omap24xx
79 * Macros to group OMAP into cpu classes.
80 * These can be used in most places.
81 * cpu_is_omap7xx(): True for OMAP730
82 * cpu_is_omap15xx(): True for OMAP1510 and OMAP5910
83 * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710
84 * cpu_is_omap24xx(): True for OMAP2420
86 #define GET_OMAP_CLASS (system_rev & 0xff)
88 #define IS_OMAP_CLASS(class, id) \
89 static inline int is_omap ##class (void) \
91 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
94 IS_OMAP_CLASS(7xx, 0x07)
95 IS_OMAP_CLASS(15xx, 0x15)
96 IS_OMAP_CLASS(16xx, 0x16)
97 IS_OMAP_CLASS(24xx, 0x24)
99 #define cpu_is_omap7xx() 0
100 #define cpu_is_omap15xx() 0
101 #define cpu_is_omap16xx() 0
102 #define cpu_is_omap24xx() 0
104 #if defined(MULTI_OMAP1)
105 # if defined(CONFIG_ARCH_OMAP730)
106 # undef cpu_is_omap7xx
107 # define cpu_is_omap7xx() is_omap7xx()
109 # if defined(CONFIG_ARCH_OMAP1510)
110 # undef cpu_is_omap15xx
111 # define cpu_is_omap15xx() is_omap15xx()
113 # if defined(CONFIG_ARCH_OMAP16XX)
114 # undef cpu_is_omap16xx
115 # define cpu_is_omap16xx() is_omap16xx()
119 # if defined(CONFIG_ARCH_OMAP730)
120 # undef cpu_is_omap7xx
121 # define cpu_is_omap7xx() 1
123 # if defined(CONFIG_ARCH_OMAP1510)
124 # undef cpu_is_omap15xx
125 # define cpu_is_omap15xx() 1
127 # if defined(CONFIG_ARCH_OMAP16XX)
128 # undef cpu_is_omap16xx()
129 # define cpu_is_omap16xx() 1
131 # if defined(CONFIG_ARCH_OMAP24XX)
132 # undef cpu_is_omap24xx
133 # define cpu_is_omap24xx() 1
138 * Macros to detect individual cpu types.
139 * These are only rarely needed.
140 * cpu_is_omap730(): True for OMAP730
141 * cpu_is_omap1510(): True for OMAP1510
142 * cpu_is_omap1610(): True for OMAP1610
143 * cpu_is_omap5912(): True for OMAP5912
144 * cpu_is_omap1710(): True for OMAP1710
145 * cpu_is_omap2420(): True for OMAP2420
147 #define GET_OMAP_TYPE ((system_rev >> 24) & 0xff)
149 #define IS_OMAP_TYPE(type, id) \
150 static inline int is_omap ##type (void) \
152 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
155 IS_OMAP_TYPE(730, 0x07)
156 IS_OMAP_TYPE(1510, 0x15)
157 IS_OMAP_TYPE(1610, 0x16)
158 IS_OMAP_TYPE(5912, 0x16)
159 IS_OMAP_TYPE(1710, 0x17)
160 IS_OMAP_TYPE(2420, 0x24)
162 #define cpu_is_omap730() 0
163 #define cpu_is_omap1510() 0
164 #define cpu_is_omap1610() 0
165 #define cpu_is_omap5912() 0
166 #define cpu_is_omap1710() 0
167 #define cpu_is_omap2420() 0
169 #if defined(MULTI_OMAP1)
170 # if defined(CONFIG_ARCH_OMAP730)
171 # undef cpu_is_omap730
172 # define cpu_is_omap730() is_omap730()
174 # if defined(CONFIG_ARCH_OMAP1510)
175 # undef cpu_is_omap1510
176 # define cpu_is_omap1510() is_omap1510()
179 # if defined(CONFIG_ARCH_OMAP730)
180 # undef cpu_is_omap730
181 # define cpu_is_omap730() 1
183 # if defined(CONFIG_ARCH_OMAP1510)
184 # undef cpu_is_omap1510
185 # define cpu_is_omap1510() 1
190 * Whether we have MULTI_OMAP1 or not, we still need to distinguish
191 * between 1611B/5912 and 1710.
193 #if defined(CONFIG_ARCH_OMAP16XX)
194 # undef cpu_is_omap1610
195 # undef cpu_is_omap5912
196 # undef cpu_is_omap1710
197 # define cpu_is_omap1610() is_omap1610()
198 # define cpu_is_omap5912() is_omap5912()
199 # define cpu_is_omap1710() is_omap1710()
202 # if defined(CONFIG_ARCH_OMAP2420)
203 # undef cpu_is_omap2420
204 # define cpu_is_omap2420() 1