aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/id.c
diff options
context:
space:
mode:
authorRuslan Bilovol <ruslan.bilovol@ti.com>2013-02-14 06:55:23 -0500
committerTony Lindgren <tony@atomide.com>2013-04-08 19:02:22 -0400
commitf9d41eefcfbb9168c94ae40f37f76828dcca088c (patch)
tree289d9b3d8e353d550529dda239f43cae05466379 /arch/arm/mach-omap2/id.c
parent4ed12be051af66699d8201548bd6cf03bf122cd4 (diff)
ARM: OMAP2+: SoC name and revision unification
This is a long story where for each new generation of OMAP we used different approaches for creating strings for SoCs names and revisions that this patch fixes. It makes future exporting of this information to SoC infrastructure easier. Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/id.c')
-rw-r--r--arch/arm/mach-omap2/id.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 8a68f1ec66b9..3737700529fe 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -31,8 +31,11 @@
31#define OMAP4_SILICON_TYPE_STANDARD 0x01 31#define OMAP4_SILICON_TYPE_STANDARD 0x01
32#define OMAP4_SILICON_TYPE_PERFORMANCE 0x02 32#define OMAP4_SILICON_TYPE_PERFORMANCE 0x02
33 33
34#define OMAP_SOC_MAX_NAME_LENGTH 16
35
34static unsigned int omap_revision; 36static unsigned int omap_revision;
35static const char *cpu_rev; 37static char soc_name[OMAP_SOC_MAX_NAME_LENGTH];
38static char soc_rev[OMAP_SOC_MAX_NAME_LENGTH];
36u32 omap_features; 39u32 omap_features;
37 40
38unsigned int omap_rev(void) 41unsigned int omap_rev(void)
@@ -169,9 +172,12 @@ void __init omap2xxx_check_revision(void)
169 j = i; 172 j = i;
170 } 173 }
171 174
172 pr_info("OMAP%04x", omap_rev() >> 16); 175 sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
176 sprintf(soc_rev, "ES%x", (omap_rev() >> 12) & 0xf);
177
178 pr_info("%s", soc_name);
173 if ((omap_rev() >> 8) & 0x0f) 179 if ((omap_rev() >> 8) & 0x0f)
174 pr_info("ES%x", (omap_rev() >> 12) & 0xf); 180 pr_info("%s", soc_rev);
175 pr_info("\n"); 181 pr_info("\n");
176} 182}
177 183
@@ -211,8 +217,10 @@ static void __init omap3_cpuinfo(void)
211 cpu_name = "OMAP3503"; 217 cpu_name = "OMAP3503";
212 } 218 }
213 219
220 sprintf(soc_name, "%s", cpu_name);
221
214 /* Print verbose information */ 222 /* Print verbose information */
215 pr_info("%s ES%s (", cpu_name, cpu_rev); 223 pr_info("%s %s (", soc_name, soc_rev);
216 224
217 OMAP3_SHOW_FEATURE(l2cache); 225 OMAP3_SHOW_FEATURE(l2cache);
218 OMAP3_SHOW_FEATURE(iva); 226 OMAP3_SHOW_FEATURE(iva);
@@ -291,6 +299,7 @@ void __init ti81xx_check_features(void)
291 299
292void __init omap3xxx_check_revision(void) 300void __init omap3xxx_check_revision(void)
293{ 301{
302 const char *cpu_rev;
294 u32 cpuid, idcode; 303 u32 cpuid, idcode;
295 u16 hawkeye; 304 u16 hawkeye;
296 u8 rev; 305 u8 rev;
@@ -438,6 +447,7 @@ void __init omap3xxx_check_revision(void)
438 cpu_rev = "1.2"; 447 cpu_rev = "1.2";
439 pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n"); 448 pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n");
440 } 449 }
450 sprintf(soc_rev, "ES%s", cpu_rev);
441} 451}
442 452
443void __init omap4xxx_check_revision(void) 453void __init omap4xxx_check_revision(void)
@@ -512,8 +522,10 @@ void __init omap4xxx_check_revision(void)
512 omap_revision = OMAP4430_REV_ES2_3; 522 omap_revision = OMAP4430_REV_ES2_3;
513 } 523 }
514 524
515 pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16, 525 sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
516 ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf)); 526 sprintf(soc_rev, "ES%d.%d", (omap_rev() >> 12) & 0xf,
527 (omap_rev() >> 8) & 0xf);
528 pr_info("%s %s\n", soc_name, soc_rev);
517} 529}
518 530
519void __init omap5xxx_check_revision(void) 531void __init omap5xxx_check_revision(void)
@@ -547,8 +559,10 @@ void __init omap5xxx_check_revision(void)
547 omap_revision = OMAP5430_REV_ES1_0; 559 omap_revision = OMAP5430_REV_ES1_0;
548 } 560 }
549 561
550 pr_info("OMAP%04x ES%d.0\n", 562 sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
551 omap_rev() >> 16, ((omap_rev() >> 12) & 0xf)); 563 sprintf(soc_rev, "ES%d.0", (omap_rev() >> 12) & 0xf);
564
565 pr_info("%s %s\n", soc_name, soc_rev);
552} 566}
553 567
554/* 568/*