0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef __ASM_ARCH_OMAP_CPU_H
0015 #define __ASM_ARCH_OMAP_CPU_H
0016
0017
0018
0019
0020 #undef MULTI_OMAP1
0021 #undef OMAP_NAME
0022
0023 #ifdef CONFIG_ARCH_OMAP730
0024 # ifdef OMAP_NAME
0025 # undef MULTI_OMAP1
0026 # define MULTI_OMAP1
0027 # else
0028 # define OMAP_NAME omap730
0029 # endif
0030 #endif
0031 #ifdef CONFIG_ARCH_OMAP850
0032 # ifdef OMAP_NAME
0033 # undef MULTI_OMAP1
0034 # define MULTI_OMAP1
0035 # else
0036 # define OMAP_NAME omap850
0037 # endif
0038 #endif
0039 #ifdef CONFIG_ARCH_OMAP15XX
0040 # ifdef OMAP_NAME
0041 # undef MULTI_OMAP1
0042 # define MULTI_OMAP1
0043 # else
0044 # define OMAP_NAME omap1510
0045 # endif
0046 #endif
0047 #ifdef CONFIG_ARCH_OMAP16XX
0048 # ifdef OMAP_NAME
0049 # undef MULTI_OMAP1
0050 # define MULTI_OMAP1
0051 # else
0052 # define OMAP_NAME omap16xx
0053 # endif
0054 #endif
0055
0056
0057
0058
0059
0060
0061
0062 unsigned int omap_rev(void);
0063
0064
0065
0066
0067 #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
0068
0069
0070
0071
0072
0073
0074
0075
0076 #define GET_OMAP_CLASS (omap_rev() & 0xff)
0077
0078 #define IS_OMAP_CLASS(class, id) \
0079 static inline int is_omap ##class (void) \
0080 { \
0081 return (GET_OMAP_CLASS == (id)) ? 1 : 0; \
0082 }
0083
0084 #define GET_OMAP_SUBCLASS ((omap_rev() >> 20) & 0x0fff)
0085
0086 #define IS_OMAP_SUBCLASS(subclass, id) \
0087 static inline int is_omap ##subclass (void) \
0088 { \
0089 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
0090 }
0091
0092 IS_OMAP_CLASS(7xx, 0x07)
0093 IS_OMAP_CLASS(15xx, 0x15)
0094 IS_OMAP_CLASS(16xx, 0x16)
0095
0096 #define cpu_is_omap7xx() 0
0097 #define cpu_is_omap15xx() 0
0098 #define cpu_is_omap16xx() 0
0099
0100 #if defined(MULTI_OMAP1)
0101 # if defined(CONFIG_ARCH_OMAP730)
0102 # undef cpu_is_omap7xx
0103 # define cpu_is_omap7xx() is_omap7xx()
0104 # endif
0105 # if defined(CONFIG_ARCH_OMAP850)
0106 # undef cpu_is_omap7xx
0107 # define cpu_is_omap7xx() is_omap7xx()
0108 # endif
0109 # if defined(CONFIG_ARCH_OMAP15XX)
0110 # undef cpu_is_omap15xx
0111 # define cpu_is_omap15xx() is_omap15xx()
0112 # endif
0113 # if defined(CONFIG_ARCH_OMAP16XX)
0114 # undef cpu_is_omap16xx
0115 # define cpu_is_omap16xx() is_omap16xx()
0116 # endif
0117 #else
0118 # if defined(CONFIG_ARCH_OMAP730)
0119 # undef cpu_is_omap7xx
0120 # define cpu_is_omap7xx() 1
0121 # endif
0122 # if defined(CONFIG_ARCH_OMAP850)
0123 # undef cpu_is_omap7xx
0124 # define cpu_is_omap7xx() 1
0125 # endif
0126 # if defined(CONFIG_ARCH_OMAP15XX)
0127 # undef cpu_is_omap15xx
0128 # define cpu_is_omap15xx() 1
0129 # endif
0130 # if defined(CONFIG_ARCH_OMAP16XX)
0131 # undef cpu_is_omap16xx
0132 # define cpu_is_omap16xx() 1
0133 # endif
0134 #endif
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147 #define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff)
0148
0149 #define IS_OMAP_TYPE(type, id) \
0150 static inline int is_omap ##type (void) \
0151 { \
0152 return (GET_OMAP_TYPE == (id)) ? 1 : 0; \
0153 }
0154
0155 IS_OMAP_TYPE(310, 0x0310)
0156 IS_OMAP_TYPE(1510, 0x1510)
0157 IS_OMAP_TYPE(1610, 0x1610)
0158 IS_OMAP_TYPE(1611, 0x1611)
0159 IS_OMAP_TYPE(5912, 0x1611)
0160 IS_OMAP_TYPE(1621, 0x1621)
0161 IS_OMAP_TYPE(1710, 0x1710)
0162
0163 #define cpu_is_omap310() 0
0164 #define cpu_is_omap1510() 0
0165 #define cpu_is_omap1610() 0
0166 #define cpu_is_omap5912() 0
0167 #define cpu_is_omap1611() 0
0168 #define cpu_is_omap1621() 0
0169 #define cpu_is_omap1710() 0
0170
0171 #define cpu_class_is_omap1() 1
0172
0173
0174
0175
0176
0177
0178 #if defined(CONFIG_ARCH_OMAP15XX)
0179 # undef cpu_is_omap310
0180 # undef cpu_is_omap1510
0181 # define cpu_is_omap310() is_omap310()
0182 # define cpu_is_omap1510() is_omap1510()
0183 #endif
0184
0185 #if defined(CONFIG_ARCH_OMAP16XX)
0186 # undef cpu_is_omap1610
0187 # undef cpu_is_omap1611
0188 # undef cpu_is_omap5912
0189 # undef cpu_is_omap1621
0190 # undef cpu_is_omap1710
0191 # define cpu_is_omap1610() is_omap1610()
0192 # define cpu_is_omap1611() is_omap1611()
0193 # define cpu_is_omap5912() is_omap5912()
0194 # define cpu_is_omap1621() is_omap1621()
0195 # define cpu_is_omap1710() is_omap1710()
0196 #endif
0197
0198 #endif