ARM: OMAP2+: SoC name and revision unification
[pandora-kernel.git] / arch / arm / mach-omap2 / id.c
index ad316ce..38af794 100644 (file)
 
 #include "control.h"
 
+#define OMAP_SOC_MAX_NAME_LENGTH               16
+
 static unsigned int omap_revision;
-static const char *cpu_rev;
+static char soc_name[OMAP_SOC_MAX_NAME_LENGTH];
+static char soc_rev[OMAP_SOC_MAX_NAME_LENGTH];
 u32 omap_features;
 
 unsigned int omap_rev(void)
@@ -112,7 +115,7 @@ void omap_get_die_id(struct omap_die_id *odi)
        odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3);
 }
 
-static void __init omap24xx_check_revision(void)
+void __init omap2xxx_check_revision(void)
 {
        int i, j;
        u32 idcode, prod_id;
@@ -160,9 +163,12 @@ static void __init omap24xx_check_revision(void)
                j = i;
        }
 
-       pr_info("OMAP%04x", omap_rev() >> 16);
+       sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
+       sprintf(soc_rev, "ES%x", (omap_rev() >> 12) & 0xf);
+
+       pr_info("%s", soc_name);
        if ((omap_rev() >> 8) & 0x0f)
-               pr_info("ES%x", (omap_rev() >> 12) & 0xf);
+               pr_info("%s", soc_rev);
        pr_info("\n");
 }
 
@@ -199,8 +205,10 @@ static void __init omap3_cpuinfo(void)
                cpu_name = "OMAP3503";
        }
 
+       sprintf(soc_name, "%s", cpu_name);
+
        /* Print verbose information */
-       pr_info("%s ES%s (", cpu_name, cpu_rev);
+       pr_info("%s %s (", soc_name, soc_rev);
 
        OMAP3_SHOW_FEATURE(l2cache);
        OMAP3_SHOW_FEATURE(iva);
@@ -218,7 +226,7 @@ static void __init omap3_cpuinfo(void)
                omap_features |= OMAP3_HAS_ ##feat;                     \
        }
 
-static void __init omap3_check_features(void)
+void __init omap3xxx_check_features(void)
 {
        u32 status;
 
@@ -245,9 +253,11 @@ static void __init omap3_check_features(void)
         * TODO: Get additional info (where applicable)
         *       e.g. Size of L2 cache.
         */
+
+       omap3_cpuinfo();
 }
 
-static void __init omap4_check_features(void)
+void __init omap4xxx_check_features(void)
 {
        u32 si_type;
 
@@ -272,13 +282,15 @@ static void __init omap4_check_features(void)
        }
 }
 
-static void __init ti816x_check_features(void)
+void __init ti81xx_check_features(void)
 {
        omap_features = OMAP3_HAS_NEON;
+       omap3_cpuinfo();
 }
 
-static void __init omap3_check_revision(void)
+void __init omap3xxx_check_revision(void)
 {
+       const char *cpu_rev;
        u32 cpuid, idcode;
        u16 hawkeye;
        u8 rev;
@@ -392,9 +404,10 @@ static void __init omap3_check_revision(void)
                cpu_rev = "1.2";
                pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n");
        }
+       sprintf(soc_rev, "ES%s", cpu_rev);
 }
 
-static void __init omap4_check_revision(void)
+void __init omap4xxx_check_revision(void)
 {
        u32 idcode;
        u16 hawkeye;
@@ -452,39 +465,10 @@ static void __init omap4_check_revision(void)
                omap_revision = OMAP4430_REV_ES2_2;
        }
 
-       pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16,
-               ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf));
-}
-
-/*
- * Try to detect the exact revision of the omap we're running on
- */
-void __init omap2_check_revision(void)
-{
-       /*
-        * At this point we have an idea about the processor revision set
-        * earlier with omap2_set_globals_tap().
-        */
-       if (cpu_is_omap24xx()) {
-               omap24xx_check_revision();
-       } else if (cpu_is_omap34xx()) {
-               omap3_check_revision();
-
-               /* TI816X doesn't have feature register */
-               if (!cpu_is_ti816x())
-                       omap3_check_features();
-               else
-                       ti816x_check_features();
-
-               omap3_cpuinfo();
-               return;
-       } else if (cpu_is_omap44xx()) {
-               omap4_check_revision();
-               omap4_check_features();
-               return;
-       } else {
-               pr_err("OMAP revision unknown, please fix!\n");
-       }
+       sprintf(soc_name, "OMAP%04x", omap_rev() >> 16);
+       sprintf(soc_rev, "ES%d.%d", (omap_rev() >> 12) & 0xf,
+                                               (omap_rev() >> 8) & 0xf);
+       pr_info("%s %s\n", soc_name, soc_rev);
 }
 
 /*