OMAP4/5: Make the silicon revision variable common.
authorSRICHARAN R <r.sricharan@ti.com>
Mon, 12 Mar 2012 02:25:40 +0000 (02:25 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 15 May 2012 06:31:24 +0000 (08:31 +0200)
The different silicon revision variable names was defined for OMAP4 and
OMAP5 socs. Making the variable common so that some code can be
made generic.

Signed-off-by: R Sricharan <r.sricharan@ti.com>
arch/arm/cpu/armv7/omap4/hwinit.c
arch/arm/cpu/armv7/omap5/hwinit.c
arch/arm/include/asm/arch-omap4/sys_proto.h
arch/arm/include/asm/arch-omap5/sys_proto.h
arch/arm/include/asm/omap_common.h

index 91f83205edf161de242b680c2f24bfcefb440111..afa54841208f72639f23d5d61897c8b711f80e2a 100644 (file)
@@ -37,7 +37,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-u32 *const omap4_revision = (u32 *)OMAP4_SRAM_SCRATCH_OMAP4_REV;
+u32 *const omap_si_rev = (u32 *)OMAP4_SRAM_SCRATCH_OMAP4_REV;
 
 static const struct gpio_bank gpio_bank_44xx[6] = {
        { (void *)OMAP44XX_GPIO1_BASE, METHOD_GPIO_24XX },
@@ -129,40 +129,40 @@ void init_omap_revision(void)
 
        switch (arm_rev) {
        case MIDR_CORTEX_A9_R0P1:
-               *omap4_revision = OMAP4430_ES1_0;
+               *omap_si_rev = OMAP4430_ES1_0;
                break;
        case MIDR_CORTEX_A9_R1P2:
                switch (readl(CONTROL_ID_CODE)) {
                case OMAP4_CONTROL_ID_CODE_ES2_0:
-                       *omap4_revision = OMAP4430_ES2_0;
+                       *omap_si_rev = OMAP4430_ES2_0;
                        break;
                case OMAP4_CONTROL_ID_CODE_ES2_1:
-                       *omap4_revision = OMAP4430_ES2_1;
+                       *omap_si_rev = OMAP4430_ES2_1;
                        break;
                case OMAP4_CONTROL_ID_CODE_ES2_2:
-                       *omap4_revision = OMAP4430_ES2_2;
+                       *omap_si_rev = OMAP4430_ES2_2;
                        break;
                default:
-                       *omap4_revision = OMAP4430_ES2_0;
+                       *omap_si_rev = OMAP4430_ES2_0;
                        break;
                }
                break;
        case MIDR_CORTEX_A9_R1P3:
-               *omap4_revision = OMAP4430_ES2_3;
+               *omap_si_rev = OMAP4430_ES2_3;
                break;
        case MIDR_CORTEX_A9_R2P10:
                switch (readl(CONTROL_ID_CODE)) {
                case OMAP4460_CONTROL_ID_CODE_ES1_1:
-                       *omap4_revision = OMAP4460_ES1_1;
+                       *omap_si_rev = OMAP4460_ES1_1;
                        break;
                case OMAP4460_CONTROL_ID_CODE_ES1_0:
                default:
-                       *omap4_revision = OMAP4460_ES1_0;
+                       *omap_si_rev = OMAP4460_ES1_0;
                        break;
                }
                break;
        default:
-               *omap4_revision = OMAP4430_SILICON_ID_INVALID;
+               *omap_si_rev = OMAP4430_SILICON_ID_INVALID;
                break;
        }
 }
index 68cf558f2d9cd7079bf3606f3d7e96f3d247cca5..84b3830b7a446e01e2c4aa9940b9d4b6806f82e6 100644 (file)
@@ -38,7 +38,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-u32 *const omap5_revision = (u32 *)OMAP5_SRAM_SCRATCH_OMAP5_REV;
+u32 *const omap_si_rev = (u32 *)OMAP5_SRAM_SCRATCH_OMAP5_REV;
 
 static struct gpio_bank gpio_bank_54xx[6] = {
        { (void *)OMAP54XX_GPIO1_BASE, METHOD_GPIO_24XX },
@@ -154,9 +154,9 @@ void init_omap_revision(void)
 
        switch (rev) {
        case MIDR_CORTEX_A15_R0P0:
-               *omap5_revision = OMAP5430_ES1_0;
+               *omap_si_rev = OMAP5430_ES1_0;
                break;
        default:
-               *omap5_revision = OMAP5430_SILICON_ID_INVALID;
+               *omap_si_rev = OMAP5430_SILICON_ID_INVALID;
        }
 }
index 101eb464cb31bad0cd65eeb435cbd964e0b75b89..c6e3ad26ff29124fd507a5a28d472855e0aad5b9 100644 (file)
@@ -114,10 +114,4 @@ static inline u32 omap_hw_init_context(void)
 #endif
 }
 
-static inline u32 omap_revision(void)
-{
-       extern u32 *const omap4_revision;
-       return *omap4_revision;
-}
-
 #endif
index 3b39dbd769b56d1581bd76e9369376a90cdc5568..8396a2214181750aaa7526b110952b9b00c0010e 100644 (file)
@@ -115,10 +115,4 @@ static inline u32 omap_hw_init_context(void)
 #endif
 }
 
-static inline u32 omap_revision(void)
-{
-       extern u32 *const omap5_revision;
-       return *omap5_revision;
-}
-
 #endif
index 6f25948e20ea04a1e1b727efcd4a1ae9d691704a..2f35c185dae8d36ad9f2e84711354d6d340a466c 100644 (file)
@@ -108,6 +108,12 @@ void spl_ymodem_load_image(void);
 void spl_board_init(void);
 #endif
 
+static inline u32 omap_revision(void)
+{
+       extern u32 *const omap_si_rev;
+       return *omap_si_rev;
+}
+
 /*
  * silicon revisions.
  * Moving this to common, so that most of code can be moved to common,