aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@ti.com>2010-09-16 09:14:46 -0400
committerSantosh Shilimkar <santosh.shilimkar@ti.com>2010-09-24 02:00:17 -0400
commited6be0bafc7781634a197ddd85b575ffcd7736b6 (patch)
tree5061c75b425900b1c891a9a09bd96723c12a53f9
parentf47d8c694e666843653f06c257d8cfb87e376f5d (diff)
omap4: Update id.c and cpu.h for es2.0
This patch updates the id.c and cpu.h files to support omap4 ES2.0 silicon detection. Few initial omap4 es2 samples IDCODE is same as es1. So the patch uses ARM cpuid register to detect the ES version for such samples Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-rw-r--r--arch/arm/mach-omap2/id.c38
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h5
2 files changed, 35 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 9a879f959509..91d7df402b35 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -298,7 +298,6 @@ static void __init omap4_check_revision(void)
298 u32 idcode; 298 u32 idcode;
299 u16 hawkeye; 299 u16 hawkeye;
300 u8 rev; 300 u8 rev;
301 char *rev_name = "ES1.0";
302 301
303 /* 302 /*
304 * The IC rev detection is done with hawkeye and rev. 303 * The IC rev detection is done with hawkeye and rev.
@@ -309,14 +308,39 @@ static void __init omap4_check_revision(void)
309 hawkeye = (idcode >> 12) & 0xffff; 308 hawkeye = (idcode >> 12) & 0xffff;
310 rev = (idcode >> 28) & 0xff; 309 rev = (idcode >> 28) & 0xff;
311 310
312 if ((hawkeye == 0xb852) && (rev == 0x0)) { 311 /*
313 omap_revision = OMAP4430_REV_ES1_0; 312 * Few initial ES2.0 samples IDCODE is same as ES1.0
314 omap_chip.oc |= CHIP_IS_OMAP4430ES1; 313 * Use ARM register to detect the correct ES version
315 pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name); 314 */
316 return; 315 if (!rev) {
316 idcode = read_cpuid(CPUID_ID);
317 rev = (idcode & 0xf) - 1;
318 }
319
320 switch (hawkeye) {
321 case 0xb852:
322 switch (rev) {
323 case 0:
324 omap_revision = OMAP4430_REV_ES1_0;
325 omap_chip.oc |= CHIP_IS_OMAP4430ES1;
326 break;
327 case 1:
328 omap_revision = OMAP4430_REV_ES2_0;
329 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
330 break;
331 default:
332 omap_revision = OMAP4430_REV_ES2_0;
333 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
334 }
335 break;
336 default:
337 /* Unknown default to latest silicon rev as default*/
338 omap_revision = OMAP4430_REV_ES2_0;
339 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
317 } 340 }
318 341
319 pr_err("Unknown OMAP4 CPU id\n"); 342 pr_info("OMAP%04x ES%d.0\n",
343 omap_rev() >> 16, ((omap_rev() >> 12) & 0xf) + 1);
320} 344}
321 345
322#define OMAP3_SHOW_FEATURE(feat) \ 346#define OMAP3_SHOW_FEATURE(feat) \
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 2e2ae530fced..9b38e4bddf57 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -391,6 +391,7 @@ IS_OMAP_TYPE(3517, 0x3517)
391 391
392#define OMAP443X_CLASS 0x44300044 392#define OMAP443X_CLASS 0x44300044
393#define OMAP4430_REV_ES1_0 0x44300044 393#define OMAP4430_REV_ES1_0 0x44300044
394#define OMAP4430_REV_ES2_0 0x44301044
394 395
395/* 396/*
396 * omap_chip bits 397 * omap_chip bits
@@ -417,10 +418,12 @@ IS_OMAP_TYPE(3517, 0x3517)
417#define CHIP_IS_OMAP4430ES1 (1 << 8) 418#define CHIP_IS_OMAP4430ES1 (1 << 8)
418#define CHIP_IS_OMAP3630ES1_1 (1 << 9) 419#define CHIP_IS_OMAP3630ES1_1 (1 << 9)
419#define CHIP_IS_OMAP3630ES1_2 (1 << 10) 420#define CHIP_IS_OMAP3630ES1_2 (1 << 10)
421#define CHIP_IS_OMAP4430ES2 (1 << 11)
420 422
421#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) 423#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
422 424
423#define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1) 425#define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \
426 CHIP_IS_OMAP4430ES2)
424 427
425/* 428/*
426 * "GE" here represents "greater than or equal to" in terms of ES 429 * "GE" here represents "greater than or equal to" in terms of ES