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
44 #ifdef CONFIG_ARCH_OMAP730
49 # define OMAP_NAME omap730
52 #ifdef CONFIG_ARCH_OMAP1510
57 # define OMAP_NAME omap1510
60 #ifdef CONFIG_ARCH_OMAP16XX
65 # define OMAP_NAME omap1610
68 #ifdef CONFIG_ARCH_OMAP16XX
73 # define OMAP_NAME omap1710
78 * Generate various OMAP cpu specific macros, and cpu class
81 #define GET_OMAP_TYPE ((system_rev >> 24) & 0xff)
82 #define GET_OMAP_CLASS (system_rev & 0xff)
84 #define IS_OMAP_TYPE(type, id) \
85 static inline int is_omap ##type (void) \
87 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
90 #define IS_OMAP_CLASS(class, id) \
91 static inline int is_omap ##class (void) \
93 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
96 IS_OMAP_TYPE(730, 0x07)
97 IS_OMAP_TYPE(1510, 0x15)
98 IS_OMAP_TYPE(1610, 0x16)
99 IS_OMAP_TYPE(5912, 0x16)
100 IS_OMAP_TYPE(1710, 0x17)
101 IS_OMAP_TYPE(2420, 0x24)
103 IS_OMAP_CLASS(7xx
, 0x07)
104 IS_OMAP_CLASS(15xx
, 0x15)
105 IS_OMAP_CLASS(16xx
, 0x16)
106 IS_OMAP_CLASS(24xx
, 0x24)
109 * Macros to group OMAP types into cpu classes.
110 * These can be used in most places.
111 * cpu_is_omap15xx(): True for 1510 and 5910
112 * cpu_is_omap16xx(): True for 1610, 5912 and 1710
114 #if defined(MULTI_OMAP)
115 # define cpu_is_omap7xx() is_omap7xx()
116 # define cpu_is_omap15xx() is_omap15xx()
117 # if !(defined(CONFIG_ARCH_OMAP1510) || defined(CONFIG_ARCH_OMAP730))
118 # define cpu_is_omap16xx() 1
120 # define cpu_is_omap16xx() is_omap16xx()
123 # if defined(CONFIG_ARCH_OMAP730)
124 # define cpu_is_omap7xx() 1
126 # define cpu_is_omap7xx() 0
128 # if defined(CONFIG_ARCH_OMAP1510)
129 # define cpu_is_omap15xx() 1
131 # define cpu_is_omap15xx() 0
133 # if defined(CONFIG_ARCH_OMAP16XX)
134 # define cpu_is_omap16xx() 1
136 # define cpu_is_omap16xx() 0
140 #if defined(MULTI_OMAP)
141 # define cpu_is_omap730() is_omap730()
142 # define cpu_is_omap1510() is_omap1510()
143 # define cpu_is_omap1610() is_omap1610()
144 # define cpu_is_omap5912() is_omap5912()
145 # define cpu_is_omap1710() is_omap1710()
147 # if defined(CONFIG_ARCH_OMAP730)
148 # define cpu_is_omap730() 1
150 # define cpu_is_omap730() 0
152 # if defined(CONFIG_ARCH_OMAP1510)
153 # define cpu_is_omap1510() 1
155 # define cpu_is_omap1510() 0
157 # if defined(CONFIG_ARCH_OMAP16XX)
158 # define cpu_is_omap1610() 1
160 # define cpu_is_omap1610() 0
162 # if defined(CONFIG_ARCH_OMAP16XX)
163 # define cpu_is_omap5912() 1
165 # define cpu_is_omap5912() 0
167 # if defined(CONFIG_ARCH_OMAP16XX)
168 # define cpu_is_omap1610() is_omap1610()
169 # define cpu_is_omap5912() is_omap5912()
170 # define cpu_is_omap1710() is_omap1710()
172 # define cpu_is_omap1610() 0
173 # define cpu_is_omap5912() 0
174 # define cpu_is_omap1710() 0
176 # if defined(CONFIG_ARCH_OMAP2420)
177 # define cpu_is_omap2420() 1
179 # define cpu_is_omap2420() 0