aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/id.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/id.c')
-rw-r--r--arch/arm/mach-omap2/id.c115
1 files changed, 82 insertions, 33 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 9a879f959509..5f9086c65e48 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -22,11 +22,12 @@
22#include <asm/cputype.h> 22#include <asm/cputype.h>
23 23
24#include <plat/common.h> 24#include <plat/common.h>
25#include <plat/control.h>
26#include <plat/cpu.h> 25#include <plat/cpu.h>
27 26
28#include <mach/id.h> 27#include <mach/id.h>
29 28
29#include "control.h"
30
30static struct omap_chip_id omap_chip; 31static struct omap_chip_id omap_chip;
31static unsigned int omap_revision; 32static unsigned int omap_revision;
32 33
@@ -60,7 +61,7 @@ int omap_type(void)
60 } else if (cpu_is_omap34xx()) { 61 } else if (cpu_is_omap34xx()) {
61 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); 62 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
62 } else if (cpu_is_omap44xx()) { 63 } else if (cpu_is_omap44xx()) {
63 val = omap_ctrl_readl(OMAP44XX_CONTROL_STATUS); 64 val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
64 } else { 65 } else {
65 pr_err("Cannot detect omap type!\n"); 66 pr_err("Cannot detect omap type!\n");
66 goto out; 67 goto out;
@@ -298,7 +299,6 @@ static void __init omap4_check_revision(void)
298 u32 idcode; 299 u32 idcode;
299 u16 hawkeye; 300 u16 hawkeye;
300 u8 rev; 301 u8 rev;
301 char *rev_name = "ES1.0";
302 302
303 /* 303 /*
304 * The IC rev detection is done with hawkeye and rev. 304 * The IC rev detection is done with hawkeye and rev.
@@ -309,14 +309,39 @@ static void __init omap4_check_revision(void)
309 hawkeye = (idcode >> 12) & 0xffff; 309 hawkeye = (idcode >> 12) & 0xffff;
310 rev = (idcode >> 28) & 0xff; 310 rev = (idcode >> 28) & 0xff;
311 311
312 if ((hawkeye == 0xb852) && (rev == 0x0)) { 312 /*
313 omap_revision = OMAP4430_REV_ES1_0; 313 * Few initial ES2.0 samples IDCODE is same as ES1.0
314 omap_chip.oc |= CHIP_IS_OMAP4430ES1; 314 * Use ARM register to detect the correct ES version
315 pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name); 315 */
316 return; 316 if (!rev) {
317 idcode = read_cpuid(CPUID_ID);
318 rev = (idcode & 0xf) - 1;
319 }
320
321 switch (hawkeye) {
322 case 0xb852:
323 switch (rev) {
324 case 0:
325 omap_revision = OMAP4430_REV_ES1_0;
326 omap_chip.oc |= CHIP_IS_OMAP4430ES1;
327 break;
328 case 1:
329 omap_revision = OMAP4430_REV_ES2_0;
330 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
331 break;
332 default:
333 omap_revision = OMAP4430_REV_ES2_0;
334 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
335 }
336 break;
337 default:
338 /* Unknown default to latest silicon rev as default*/
339 omap_revision = OMAP4430_REV_ES2_0;
340 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
317 } 341 }
318 342
319 pr_err("Unknown OMAP4 CPU id\n"); 343 pr_info("OMAP%04x ES%d.0\n",
344 omap_rev() >> 16, ((omap_rev() >> 12) & 0xf) + 1);
320} 345}
321 346
322#define OMAP3_SHOW_FEATURE(feat) \ 347#define OMAP3_SHOW_FEATURE(feat) \
@@ -361,30 +386,54 @@ static void __init omap3_cpuinfo(void)
361 strcpy(cpu_name, "OMAP3503"); 386 strcpy(cpu_name, "OMAP3503");
362 } 387 }
363 388
364 switch (rev) { 389 if (cpu_is_omap3630()) {
365 case OMAP_REVBITS_00: 390 switch (rev) {
366 strcpy(cpu_rev, "1.0"); 391 case OMAP_REVBITS_00:
367 break; 392 strcpy(cpu_rev, "1.0");
368 case OMAP_REVBITS_01: 393 break;
369 strcpy(cpu_rev, "1.1"); 394 case OMAP_REVBITS_01:
370 break; 395 strcpy(cpu_rev, "1.1");
371 case OMAP_REVBITS_02: 396 break;
372 strcpy(cpu_rev, "1.2"); 397 case OMAP_REVBITS_02:
373 break; 398 /* FALLTHROUGH */
374 case OMAP_REVBITS_10: 399 default:
375 strcpy(cpu_rev, "2.0"); 400 /* Use the latest known revision as default */
376 break; 401 strcpy(cpu_rev, "1.2");
377 case OMAP_REVBITS_20: 402 }
378 strcpy(cpu_rev, "2.1"); 403 } else if (cpu_is_omap3505() || cpu_is_omap3517()) {
379 break; 404 switch (rev) {
380 case OMAP_REVBITS_30: 405 case OMAP_REVBITS_00:
381 strcpy(cpu_rev, "3.0"); 406 strcpy(cpu_rev, "1.0");
382 break; 407 break;
383 case OMAP_REVBITS_40: 408 case OMAP_REVBITS_01:
384 /* FALLTHROUGH */ 409 /* FALLTHROUGH */
385 default: 410 default:
386 /* Use the latest known revision as default */ 411 /* Use the latest known revision as default */
387 strcpy(cpu_rev, "3.1"); 412 strcpy(cpu_rev, "1.1");
413 }
414 } else {
415 switch (rev) {
416 case OMAP_REVBITS_00:
417 strcpy(cpu_rev, "1.0");
418 break;
419 case OMAP_REVBITS_01:
420 strcpy(cpu_rev, "2.0");
421 break;
422 case OMAP_REVBITS_02:
423 strcpy(cpu_rev, "2.1");
424 break;
425 case OMAP_REVBITS_03:
426 strcpy(cpu_rev, "3.0");
427 break;
428 case OMAP_REVBITS_04:
429 strcpy(cpu_rev, "3.1");
430 break;
431 case OMAP_REVBITS_05:
432 /* FALLTHROUGH */
433 default:
434 /* Use the latest known revision as default */
435 strcpy(cpu_rev, "3.1.2");
436 }
388 } 437 }
389 438
390 /* Print verbose information */ 439 /* Print verbose information */