diff options
author | Sanjeev Premi <premi@ti.com> | 2009-11-22 13:10:54 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-11-22 13:24:32 -0500 |
commit | 048f4bd7607eb714d4831f90dea6fd27eac9e494 (patch) | |
tree | 058f1848655c86294181bb76a71894c0d2de1890 /arch/arm/mach-omap2 | |
parent | 8384ce071365244332ea05c81112bfffcf48be87 (diff) |
omap3: Runtime detection of OMAP35x devices
Add runtime check for these OMAP35x variations
based on the detected Si features:
OMAP3503, OMAP3515, OMAP3525 and OMA3530.
Also, delayed the call to pr_info() into actual
variant is detected in omap3_cpuinfo()
Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/id.c | 65 |
1 files changed, 54 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index d7ac8d547141..88999eaf91b6 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -187,7 +187,6 @@ void __init omap3_check_revision(void) | |||
187 | u32 cpuid, idcode; | 187 | u32 cpuid, idcode; |
188 | u16 hawkeye; | 188 | u16 hawkeye; |
189 | u8 rev; | 189 | u8 rev; |
190 | char *rev_name = "ES1.0"; | ||
191 | 190 | ||
192 | /* | 191 | /* |
193 | * We cannot access revision registers on ES1.0. | 192 | * We cannot access revision registers on ES1.0. |
@@ -197,7 +196,7 @@ void __init omap3_check_revision(void) | |||
197 | cpuid = read_cpuid(CPUID_ID); | 196 | cpuid = read_cpuid(CPUID_ID); |
198 | if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { | 197 | if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { |
199 | omap_revision = OMAP3430_REV_ES1_0; | 198 | omap_revision = OMAP3430_REV_ES1_0; |
200 | goto out; | 199 | return; |
201 | } | 200 | } |
202 | 201 | ||
203 | /* | 202 | /* |
@@ -212,31 +211,24 @@ void __init omap3_check_revision(void) | |||
212 | 211 | ||
213 | if (hawkeye == 0xb7ae) { | 212 | if (hawkeye == 0xb7ae) { |
214 | switch (rev) { | 213 | switch (rev) { |
215 | case 0: | 214 | case 0: /* Take care of early samples */ |
215 | case 1: | ||
216 | omap_revision = OMAP3430_REV_ES2_0; | 216 | omap_revision = OMAP3430_REV_ES2_0; |
217 | rev_name = "ES2.0"; | ||
218 | break; | 217 | break; |
219 | case 2: | 218 | case 2: |
220 | omap_revision = OMAP3430_REV_ES2_1; | 219 | omap_revision = OMAP3430_REV_ES2_1; |
221 | rev_name = "ES2.1"; | ||
222 | break; | 220 | break; |
223 | case 3: | 221 | case 3: |
224 | omap_revision = OMAP3430_REV_ES3_0; | 222 | omap_revision = OMAP3430_REV_ES3_0; |
225 | rev_name = "ES3.0"; | ||
226 | break; | 223 | break; |
227 | case 4: | 224 | case 4: |
228 | omap_revision = OMAP3430_REV_ES3_1; | 225 | omap_revision = OMAP3430_REV_ES3_1; |
229 | rev_name = "ES3.1"; | ||
230 | break; | 226 | break; |
231 | default: | 227 | default: |
232 | /* Use the latest known revision as default */ | 228 | /* Use the latest known revision as default */ |
233 | omap_revision = OMAP3430_REV_ES3_1; | 229 | omap_revision = OMAP3430_REV_ES3_1; |
234 | rev_name = "Unknown revision\n"; | ||
235 | } | 230 | } |
236 | } | 231 | } |
237 | |||
238 | out: | ||
239 | pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name); | ||
240 | } | 232 | } |
241 | 233 | ||
242 | #define OMAP3_SHOW_FEATURE(feat) \ | 234 | #define OMAP3_SHOW_FEATURE(feat) \ |
@@ -248,6 +240,57 @@ out: | |||
248 | 240 | ||
249 | void __init omap3_cpuinfo(void) | 241 | void __init omap3_cpuinfo(void) |
250 | { | 242 | { |
243 | u8 rev = GET_OMAP_REVISION(); | ||
244 | char cpu_name[16], cpu_rev[16]; | ||
245 | |||
246 | /* OMAP3430 and OMAP3530 are assumed to be same. | ||
247 | * | ||
248 | * OMAP3525, OMAP3515 and OMAP3503 can be detected only based | ||
249 | * on available features. Upon detection, update the CPU id | ||
250 | * and CPU class bits. | ||
251 | */ | ||
252 | if (omap3_has_iva() && omap3_has_sgx()) { | ||
253 | strcpy(cpu_name, "3430/3530"); | ||
254 | } | ||
255 | else if (omap3_has_sgx()) { | ||
256 | omap_revision = OMAP3525_REV(rev); | ||
257 | strcpy(cpu_name, "3525"); | ||
258 | } | ||
259 | else if (omap3_has_iva()) { | ||
260 | omap_revision = OMAP3515_REV(rev); | ||
261 | strcpy(cpu_name, "3515"); | ||
262 | } | ||
263 | else { | ||
264 | omap_revision = OMAP3503_REV(rev); | ||
265 | strcpy(cpu_name, "3503"); | ||
266 | } | ||
267 | |||
268 | switch (rev) { | ||
269 | case OMAP_REVBITS_00: | ||
270 | strcpy(cpu_rev, "1.0"); | ||
271 | break; | ||
272 | case OMAP_REVBITS_10: | ||
273 | strcpy(cpu_rev, "2.0"); | ||
274 | break; | ||
275 | case OMAP_REVBITS_20: | ||
276 | strcpy(cpu_rev, "2.1"); | ||
277 | break; | ||
278 | case OMAP_REVBITS_30: | ||
279 | strcpy(cpu_rev, "3.0"); | ||
280 | break; | ||
281 | case OMAP_REVBITS_40: | ||
282 | strcpy(cpu_rev, "3.1"); | ||
283 | break; | ||
284 | default: | ||
285 | /* Use the latest known revision as default */ | ||
286 | strcpy(cpu_rev, "3.1"); | ||
287 | } | ||
288 | |||
289 | /* | ||
290 | * Print verbose information | ||
291 | */ | ||
292 | pr_info("OMAP%s ES%s\n", cpu_name, cpu_rev); | ||
293 | |||
251 | OMAP3_SHOW_FEATURE(l2cache); | 294 | OMAP3_SHOW_FEATURE(l2cache); |
252 | OMAP3_SHOW_FEATURE(iva); | 295 | OMAP3_SHOW_FEATURE(iva); |
253 | OMAP3_SHOW_FEATURE(sgx); | 296 | OMAP3_SHOW_FEATURE(sgx); |