diff options
author | R Sricharan <r.sricharan@ti.com> | 2012-04-19 08:12:19 -0400 |
---|---|---|
committer | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2012-07-09 09:44:39 -0400 |
commit | b13e80a8bfe442406495a2fc9e7cbb79d33df48a (patch) | |
tree | 96158952517112c0fc77470af9e049a57453878d /arch/arm | |
parent | b009366f285d03e69aeea5f8cc466782dd6f0004 (diff) |
ARM: OMAP5: id: Add cpu id for ES versions
Adding the OMAP5 ES1.0, 2.0 and OMAP5432 cpu revision
detection support.
Signed-off-by: R Sricharan <r.sricharan@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/control.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/id.c | 42 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/cpu.h | 22 |
3 files changed, 65 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index 295b39047a7..b8cdc8531b6 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h | |||
@@ -253,6 +253,10 @@ | |||
253 | /* TI81XX CONTROL_DEVCONF register offsets */ | 253 | /* TI81XX CONTROL_DEVCONF register offsets */ |
254 | #define TI81XX_CONTROL_DEVICE_ID (TI81XX_CONTROL_DEVCONF + 0x000) | 254 | #define TI81XX_CONTROL_DEVICE_ID (TI81XX_CONTROL_DEVCONF + 0x000) |
255 | 255 | ||
256 | /* OMAP54XX CONTROL STATUS register */ | ||
257 | #define OMAP5XXX_CONTROL_STATUS 0x134 | ||
258 | #define OMAP5_DEVICETYPE_MASK (0x7 << 6) | ||
259 | |||
256 | /* | 260 | /* |
257 | * REVISIT: This list of registers is not comprehensive - there are more | 261 | * REVISIT: This list of registers is not comprehensive - there are more |
258 | * that should be added. | 262 | * that should be added. |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 37eb95aaf2f..40373db649a 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -50,6 +50,11 @@ int omap_type(void) | |||
50 | val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); | 50 | val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); |
51 | } else if (cpu_is_omap44xx()) { | 51 | } else if (cpu_is_omap44xx()) { |
52 | val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS); | 52 | val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS); |
53 | } else if (soc_is_omap54xx()) { | ||
54 | val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS); | ||
55 | val &= OMAP5_DEVICETYPE_MASK; | ||
56 | val >>= 6; | ||
57 | goto out; | ||
53 | } else { | 58 | } else { |
54 | pr_err("Cannot detect omap type!\n"); | 59 | pr_err("Cannot detect omap type!\n"); |
55 | goto out; | 60 | goto out; |
@@ -100,7 +105,7 @@ static u16 tap_prod_id; | |||
100 | 105 | ||
101 | void omap_get_die_id(struct omap_die_id *odi) | 106 | void omap_get_die_id(struct omap_die_id *odi) |
102 | { | 107 | { |
103 | if (cpu_is_omap44xx()) { | 108 | if (cpu_is_omap44xx() || soc_is_omap54xx()) { |
104 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0); | 109 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0); |
105 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1); | 110 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1); |
106 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2); | 111 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2); |
@@ -513,6 +518,41 @@ void __init omap4xxx_check_revision(void) | |||
513 | ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf)); | 518 | ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf)); |
514 | } | 519 | } |
515 | 520 | ||
521 | void __init omap5xxx_check_revision(void) | ||
522 | { | ||
523 | u32 idcode; | ||
524 | u16 hawkeye; | ||
525 | u8 rev; | ||
526 | |||
527 | idcode = read_tap_reg(OMAP_TAP_IDCODE); | ||
528 | hawkeye = (idcode >> 12) & 0xffff; | ||
529 | rev = (idcode >> 28) & 0xff; | ||
530 | switch (hawkeye) { | ||
531 | case 0xb942: | ||
532 | switch (rev) { | ||
533 | case 0: | ||
534 | default: | ||
535 | omap_revision = OMAP5430_REV_ES1_0; | ||
536 | } | ||
537 | break; | ||
538 | |||
539 | case 0xb998: | ||
540 | switch (rev) { | ||
541 | case 0: | ||
542 | default: | ||
543 | omap_revision = OMAP5432_REV_ES1_0; | ||
544 | } | ||
545 | break; | ||
546 | |||
547 | default: | ||
548 | /* Unknown default to latest silicon rev as default*/ | ||
549 | omap_revision = OMAP5430_REV_ES1_0; | ||
550 | } | ||
551 | |||
552 | pr_info("OMAP%04x ES%d.0\n", | ||
553 | omap_rev() >> 16, ((omap_rev() >> 12) & 0xf)); | ||
554 | } | ||
555 | |||
516 | /* | 556 | /* |
517 | * Set up things for map_io and processor detection later on. Gets called | 557 | * Set up things for map_io and processor detection later on. Gets called |
518 | * pretty much first thing from board init. For multi-omap, this gets | 558 | * pretty much first thing from board init. For multi-omap, this gets |
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index 14f050f7a89..e2d911d16fb 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h | |||
@@ -9,7 +9,7 @@ | |||
9 | * | 9 | * |
10 | * Written by Tony Lindgren <tony.lindgren@nokia.com> | 10 | * Written by Tony Lindgren <tony.lindgren@nokia.com> |
11 | * | 11 | * |
12 | * Added OMAP4 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com> | 12 | * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com> |
13 | * | 13 | * |
14 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
15 | * it under the terms of the GNU General Public License as published by | 15 | * it under the terms of the GNU General Public License as published by |
@@ -70,6 +70,7 @@ unsigned int omap_rev(void); | |||
70 | * cpu_is_omap443x(): True for OMAP4430 | 70 | * cpu_is_omap443x(): True for OMAP4430 |
71 | * cpu_is_omap446x(): True for OMAP4460 | 71 | * cpu_is_omap446x(): True for OMAP4460 |
72 | * cpu_is_omap447x(): True for OMAP4470 | 72 | * cpu_is_omap447x(): True for OMAP4470 |
73 | * soc_is_omap543x(): True for OMAP5430, OMAP5432 | ||
73 | */ | 74 | */ |
74 | #define GET_OMAP_CLASS (omap_rev() & 0xff) | 75 | #define GET_OMAP_CLASS (omap_rev() & 0xff) |
75 | 76 | ||
@@ -122,6 +123,7 @@ IS_OMAP_CLASS(24xx, 0x24) | |||
122 | IS_OMAP_CLASS(34xx, 0x34) | 123 | IS_OMAP_CLASS(34xx, 0x34) |
123 | IS_OMAP_CLASS(44xx, 0x44) | 124 | IS_OMAP_CLASS(44xx, 0x44) |
124 | IS_AM_CLASS(35xx, 0x35) | 125 | IS_AM_CLASS(35xx, 0x35) |
126 | IS_OMAP_CLASS(54xx, 0x54) | ||
125 | IS_AM_CLASS(33xx, 0x33) | 127 | IS_AM_CLASS(33xx, 0x33) |
126 | 128 | ||
127 | IS_TI_CLASS(81xx, 0x81) | 129 | IS_TI_CLASS(81xx, 0x81) |
@@ -133,6 +135,7 @@ IS_OMAP_SUBCLASS(363x, 0x363) | |||
133 | IS_OMAP_SUBCLASS(443x, 0x443) | 135 | IS_OMAP_SUBCLASS(443x, 0x443) |
134 | IS_OMAP_SUBCLASS(446x, 0x446) | 136 | IS_OMAP_SUBCLASS(446x, 0x446) |
135 | IS_OMAP_SUBCLASS(447x, 0x447) | 137 | IS_OMAP_SUBCLASS(447x, 0x447) |
138 | IS_OMAP_SUBCLASS(543x, 0x543) | ||
136 | 139 | ||
137 | IS_TI_SUBCLASS(816x, 0x816) | 140 | IS_TI_SUBCLASS(816x, 0x816) |
138 | IS_TI_SUBCLASS(814x, 0x814) | 141 | IS_TI_SUBCLASS(814x, 0x814) |
@@ -156,6 +159,8 @@ IS_AM_SUBCLASS(335x, 0x335) | |||
156 | #define cpu_is_omap443x() 0 | 159 | #define cpu_is_omap443x() 0 |
157 | #define cpu_is_omap446x() 0 | 160 | #define cpu_is_omap446x() 0 |
158 | #define cpu_is_omap447x() 0 | 161 | #define cpu_is_omap447x() 0 |
162 | #define soc_is_omap54xx() 0 | ||
163 | #define soc_is_omap543x() 0 | ||
159 | 164 | ||
160 | #if defined(MULTI_OMAP1) | 165 | #if defined(MULTI_OMAP1) |
161 | # if defined(CONFIG_ARCH_OMAP730) | 166 | # if defined(CONFIG_ARCH_OMAP730) |
@@ -291,6 +296,7 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
291 | #define cpu_is_omap2430() 0 | 296 | #define cpu_is_omap2430() 0 |
292 | #define cpu_is_omap3430() 0 | 297 | #define cpu_is_omap3430() 0 |
293 | #define cpu_is_omap3630() 0 | 298 | #define cpu_is_omap3630() 0 |
299 | #define soc_is_omap5430() 0 | ||
294 | 300 | ||
295 | /* | 301 | /* |
296 | * Whether we have MULTI_OMAP1 or not, we still need to distinguish | 302 | * Whether we have MULTI_OMAP1 or not, we still need to distinguish |
@@ -371,11 +377,18 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
371 | # define cpu_is_omap447x() is_omap447x() | 377 | # define cpu_is_omap447x() is_omap447x() |
372 | # endif | 378 | # endif |
373 | 379 | ||
380 | # if defined(CONFIG_SOC_OMAP5) | ||
381 | # undef soc_is_omap54xx | ||
382 | # undef soc_is_omap543x | ||
383 | # define soc_is_omap54xx() is_omap54xx() | ||
384 | # define soc_is_omap543x() is_omap543x() | ||
385 | #endif | ||
386 | |||
374 | /* Macros to detect if we have OMAP1 or OMAP2 */ | 387 | /* Macros to detect if we have OMAP1 or OMAP2 */ |
375 | #define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \ | 388 | #define cpu_class_is_omap1() (cpu_is_omap7xx() || cpu_is_omap15xx() || \ |
376 | cpu_is_omap16xx()) | 389 | cpu_is_omap16xx()) |
377 | #define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \ | 390 | #define cpu_class_is_omap2() (cpu_is_omap24xx() || cpu_is_omap34xx() || \ |
378 | cpu_is_omap44xx()) | 391 | cpu_is_omap44xx() || soc_is_omap54xx()) |
379 | 392 | ||
380 | /* Various silicon revisions for omap2 */ | 393 | /* Various silicon revisions for omap2 */ |
381 | #define OMAP242X_CLASS 0x24200024 | 394 | #define OMAP242X_CLASS 0x24200024 |
@@ -428,9 +441,14 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
428 | #define OMAP447X_CLASS 0x44700044 | 441 | #define OMAP447X_CLASS 0x44700044 |
429 | #define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8)) | 442 | #define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8)) |
430 | 443 | ||
444 | #define OMAP54XX_CLASS 0x54000054 | ||
445 | #define OMAP5430_REV_ES1_0 (OMAP54XX_CLASS | (0x30 << 16) | (0x10 << 8)) | ||
446 | #define OMAP5432_REV_ES1_0 (OMAP54XX_CLASS | (0x32 << 16) | (0x10 << 8)) | ||
447 | |||
431 | void omap2xxx_check_revision(void); | 448 | void omap2xxx_check_revision(void); |
432 | void omap3xxx_check_revision(void); | 449 | void omap3xxx_check_revision(void); |
433 | void omap4xxx_check_revision(void); | 450 | void omap4xxx_check_revision(void); |
451 | void omap5xxx_check_revision(void); | ||
434 | void omap3xxx_check_features(void); | 452 | void omap3xxx_check_features(void); |
435 | void ti81xx_check_features(void); | 453 | void ti81xx_check_features(void); |
436 | void omap4xxx_check_features(void); | 454 | void omap4xxx_check_features(void); |