aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/id.c
diff options
context:
space:
mode:
authorLauri Leukkunen <lauri.leukkunen@nokia.com>2008-12-10 20:36:31 -0500
committerTony Lindgren <tony@atomide.com>2008-12-10 20:36:31 -0500
commit84a34344ea1f2f313d84a9fb4cb685b65a6ec26d (patch)
treedb657e72e0be439f4d0baab660e2d46320f02374 /arch/arm/mach-omap2/id.c
parenta88231430384f49bebf8a6ec607a9eb4f2254e34 (diff)
ARM: OMAP2: Use omap_rev() instead of system_rev
system_rev is meant for board revision, this patch changes all relevant instances to use the new omap_rev() function liberating system_rev to be used with ATAG_REVISION as it has been designed. Signed-off-by: Lauri Leukkunen <lauri.leukkunen@nokia.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.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index d4e3a38e347c..b0f8e7d62798 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -23,6 +23,14 @@
23#include <mach/cpu.h> 23#include <mach/cpu.h>
24 24
25static struct omap_chip_id omap_chip; 25static struct omap_chip_id omap_chip;
26static unsigned int omap_revision;
27
28
29unsigned int omap_rev(void)
30{
31 return omap_revision;
32}
33EXPORT_SYMBOL(omap_rev);
26 34
27/** 35/**
28 * omap_chip_is - test whether currently running OMAP matches a chip type 36 * omap_chip_is - test whether currently running OMAP matches a chip type
@@ -50,7 +58,7 @@ EXPORT_SYMBOL(omap_chip_is);
50struct omap_id { 58struct omap_id {
51 u16 hawkeye; /* Silicon type (Hawkeye id) */ 59 u16 hawkeye; /* Silicon type (Hawkeye id) */
52 u8 dev; /* Device type from production_id reg */ 60 u8 dev; /* Device type from production_id reg */
53 u32 type; /* Combined type id copied to system_rev */ 61 u32 type; /* Combined type id copied to omap_revision */
54}; 62};
55 63
56/* Register values to detect the OMAP version */ 64/* Register values to detect the OMAP version */
@@ -116,9 +124,9 @@ void __init omap24xx_check_revision(void)
116 j = i; 124 j = i;
117 } 125 }
118 126
119 pr_info("OMAP%04x", system_rev >> 16); 127 pr_info("OMAP%04x", omap_rev() >> 16);
120 if ((system_rev >> 8) & 0x0f) 128 if ((omap_rev() >> 8) & 0x0f)
121 pr_info("ES%x", (system_rev >> 12) & 0xf); 129 pr_info("ES%x", (omap_rev() >> 12) & 0xf);
122 pr_info("\n"); 130 pr_info("\n");
123} 131}
124 132
@@ -136,7 +144,7 @@ void __init omap34xx_check_revision(void)
136 */ 144 */
137 cpuid = read_cpuid(CPUID_ID); 145 cpuid = read_cpuid(CPUID_ID);
138 if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { 146 if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) {
139 system_rev = OMAP3430_REV_ES1_0; 147 omap_revision = OMAP3430_REV_ES1_0;
140 goto out; 148 goto out;
141 } 149 }
142 150
@@ -153,26 +161,26 @@ void __init omap34xx_check_revision(void)
153 if (hawkeye == 0xb7ae) { 161 if (hawkeye == 0xb7ae) {
154 switch (rev) { 162 switch (rev) {
155 case 0: 163 case 0:
156 system_rev = OMAP3430_REV_ES2_0; 164 omap_revision = OMAP3430_REV_ES2_0;
157 rev_name = "ES2.0"; 165 rev_name = "ES2.0";
158 break; 166 break;
159 case 2: 167 case 2:
160 system_rev = OMAP3430_REV_ES2_1; 168 omap_revision = OMAP3430_REV_ES2_1;
161 rev_name = "ES2.1"; 169 rev_name = "ES2.1";
162 break; 170 break;
163 case 3: 171 case 3:
164 system_rev = OMAP3430_REV_ES3_0; 172 omap_revision = OMAP3430_REV_ES3_0;
165 rev_name = "ES3.0"; 173 rev_name = "ES3.0";
166 break; 174 break;
167 default: 175 default:
168 /* Use the latest known revision as default */ 176 /* Use the latest known revision as default */
169 system_rev = OMAP3430_REV_ES3_0; 177 omap_revision = OMAP3430_REV_ES3_0;
170 rev_name = "Unknown revision\n"; 178 rev_name = "Unknown revision\n";
171 } 179 }
172 } 180 }
173 181
174out: 182out:
175 pr_info("OMAP%04x %s\n", system_rev >> 16, rev_name); 183 pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name);
176} 184}
177 185
178/* 186/*
@@ -203,9 +211,9 @@ void __init omap2_check_revision(void)
203 omap_chip.oc |= CHIP_IS_OMAP2420; 211 omap_chip.oc |= CHIP_IS_OMAP2420;
204 } else if (cpu_is_omap343x()) { 212 } else if (cpu_is_omap343x()) {
205 omap_chip.oc = CHIP_IS_OMAP3430; 213 omap_chip.oc = CHIP_IS_OMAP3430;
206 if (system_rev == OMAP3430_REV_ES1_0) 214 if (omap_rev() == OMAP3430_REV_ES1_0)
207 omap_chip.oc |= CHIP_IS_OMAP3430ES1; 215 omap_chip.oc |= CHIP_IS_OMAP3430ES1;
208 else if (system_rev > OMAP3430_REV_ES1_0) 216 else if (omap_rev() > OMAP3430_REV_ES1_0)
209 omap_chip.oc |= CHIP_IS_OMAP3430ES2; 217 omap_chip.oc |= CHIP_IS_OMAP3430ES2;
210 } else { 218 } else {
211 pr_err("Uninitialized omap_chip, please fix!\n"); 219 pr_err("Uninitialized omap_chip, please fix!\n");
@@ -221,7 +229,7 @@ void __init omap2_check_revision(void)
221 */ 229 */
222void __init omap2_set_globals_tap(struct omap_globals *omap2_globals) 230void __init omap2_set_globals_tap(struct omap_globals *omap2_globals)
223{ 231{
224 system_rev = omap2_globals->class; 232 omap_revision = omap2_globals->class;
225 tap_base = omap2_globals->tap; 233 tap_base = omap2_globals->tap;
226 234
227 if (cpu_is_omap34xx()) 235 if (cpu_is_omap34xx())