aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/id.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@nokia.com>2009-11-22 13:11:24 -0500
committerTony Lindgren <tony@atomide.com>2009-11-22 13:24:33 -0500
commitedeae658b282f2d076efb3b3f39ccd8eb0c384fa (patch)
treed3c8addddca40ba65125f03570b4b33dd68aaadd /arch/arm/mach-omap2/id.c
parent5ed8d32ea39d34dbfea50ada1bee0a33513fc6f3 (diff)
omap: Cleanup the coding style in id.c
Cleanup the coding style in id.c while avoiding unneeded switch() statements. Signed-off-by: Felipe Balbi <felipe.balbi@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.c61
1 files changed, 21 insertions, 40 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 49846601fe77..f48a4b2654dd 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -53,11 +53,11 @@ int omap_type(void)
53{ 53{
54 u32 val = 0; 54 u32 val = 0;
55 55
56 if (cpu_is_omap24xx()) 56 if (cpu_is_omap24xx()) {
57 val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); 57 val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
58 else if (cpu_is_omap34xx()) 58 } else if (cpu_is_omap34xx()) {
59 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); 59 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
60 else { 60 } else {
61 pr_err("Cannot detect omap type!\n"); 61 pr_err("Cannot detect omap type!\n");
62 goto out; 62 goto out;
63 } 63 }
@@ -224,24 +224,12 @@ void __init omap3_check_revision(void)
224 omap_revision = OMAP3430_REV_ES3_0; 224 omap_revision = OMAP3430_REV_ES3_0;
225 break; 225 break;
226 case 4: 226 case 4:
227 omap_revision = OMAP3430_REV_ES3_1; 227 /* FALLTHROUGH */
228 break;
229 default: 228 default:
230 /* Use the latest known revision as default */ 229 /* Use the latest known revision as default */
231 omap_revision = OMAP3430_REV_ES3_1; 230 omap_revision = OMAP3430_REV_ES3_1;
232 } 231 }
233 break; 232 break;
234 case 0xb891:
235 /* Handle 36xx devices */
236 switch (rev) {
237 case 0:
238 omap_revision = OMAP3630_REV_ES1_0;
239 break;
240 default:
241 /* Use the latest known revision as default */
242 omap_revision = OMAP3630_REV_ES1_0;
243 }
244 break;
245 case 0xb868: 233 case 0xb868:
246 /* Handle OMAP35xx/AM35xx devices 234 /* Handle OMAP35xx/AM35xx devices
247 * 235 *
@@ -250,6 +238,8 @@ void __init omap3_check_revision(void)
250 */ 238 */
251 omap_revision = OMAP3505_REV(rev); 239 omap_revision = OMAP3505_REV(rev);
252 break; 240 break;
241 case 0xb891:
242 /* FALLTHROUGH */
253 default: 243 default:
254 /* Unknown default to latest silicon rev as default*/ 244 /* Unknown default to latest silicon rev as default*/
255 omap_revision = OMAP3630_REV_ES1_0; 245 omap_revision = OMAP3630_REV_ES1_0;
@@ -271,35 +261,29 @@ void __init omap3_cpuinfo(void)
271 * on available features. Upon detection, update the CPU id 261 * on available features. Upon detection, update the CPU id
272 * and CPU class bits. 262 * and CPU class bits.
273 */ 263 */
274 if (cpu_is_omap3630()) 264 if (cpu_is_omap3630()) {
275 strcpy(cpu_name, "OMAP3630"); 265 strcpy(cpu_name, "OMAP3630");
276 else if (cpu_is_omap3505()) { 266 } else if (cpu_is_omap3505()) {
277 /* 267 /*
278 * AM35xx devices 268 * AM35xx devices
279 */ 269 */
280 if (omap3_has_sgx()) { 270 if (omap3_has_sgx()) {
281 omap_revision = OMAP3517_REV(rev); 271 omap_revision = OMAP3517_REV(rev);
282 strcpy(cpu_name, "AM3517"); 272 strcpy(cpu_name, "AM3517");
283 } 273 } else {
284 else {
285 /* Already set in omap3_check_revision() */ 274 /* Already set in omap3_check_revision() */
286 strcpy(cpu_name, "AM3505"); 275 strcpy(cpu_name, "AM3505");
287 } 276 }
288 } 277 } else if (omap3_has_iva() && omap3_has_sgx()) {
289 /* 278 /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
290 * OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices
291 */
292 else if (omap3_has_iva() && omap3_has_sgx())
293 strcpy(cpu_name, "OMAP3430/3530"); 279 strcpy(cpu_name, "OMAP3430/3530");
294 else if (omap3_has_sgx()) { 280 } else if (omap3_has_sgx()) {
295 omap_revision = OMAP3525_REV(rev); 281 omap_revision = OMAP3525_REV(rev);
296 strcpy(cpu_name, "OMAP3525"); 282 strcpy(cpu_name, "OMAP3525");
297 } 283 } else if (omap3_has_iva()) {
298 else if (omap3_has_iva()) {
299 omap_revision = OMAP3515_REV(rev); 284 omap_revision = OMAP3515_REV(rev);
300 strcpy(cpu_name, "OMAP3515"); 285 strcpy(cpu_name, "OMAP3515");
301 } 286 } else {
302 else {
303 omap_revision = OMAP3503_REV(rev); 287 omap_revision = OMAP3503_REV(rev);
304 strcpy(cpu_name, "OMAP3503"); 288 strcpy(cpu_name, "OMAP3503");
305 } 289 }
@@ -318,16 +302,13 @@ void __init omap3_cpuinfo(void)
318 strcpy(cpu_rev, "3.0"); 302 strcpy(cpu_rev, "3.0");
319 break; 303 break;
320 case OMAP_REVBITS_40: 304 case OMAP_REVBITS_40:
321 strcpy(cpu_rev, "3.1"); 305 /* FALLTHROUGH */
322 break;
323 default: 306 default:
324 /* Use the latest known revision as default */ 307 /* Use the latest known revision as default */
325 strcpy(cpu_rev, "3.1"); 308 strcpy(cpu_rev, "3.1");
326 } 309 }
327 310
328 /* 311 /* Print verbose information */
329 * Print verbose information
330 */
331 pr_info("%s ES%s (", cpu_name, cpu_rev); 312 pr_info("%s ES%s (", cpu_name, cpu_rev);
332 313
333 OMAP3_SHOW_FEATURE(l2cache); 314 OMAP3_SHOW_FEATURE(l2cache);
@@ -348,18 +329,18 @@ void __init omap2_check_revision(void)
348 * At this point we have an idea about the processor revision set 329 * At this point we have an idea about the processor revision set
349 * earlier with omap2_set_globals_tap(). 330 * earlier with omap2_set_globals_tap().
350 */ 331 */
351 if (cpu_is_omap24xx()) 332 if (cpu_is_omap24xx()) {
352 omap24xx_check_revision(); 333 omap24xx_check_revision();
353 else if (cpu_is_omap34xx()) { 334 } else if (cpu_is_omap34xx()) {
354 omap3_check_revision(); 335 omap3_check_revision();
355 omap3_check_features(); 336 omap3_check_features();
356 omap3_cpuinfo(); 337 omap3_cpuinfo();
357 } 338 } else if (cpu_is_omap44xx()) {
358 else if (cpu_is_omap44xx()) {
359 printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n"); 339 printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n");
360 return; 340 return;
361 } else 341 } else {
362 pr_err("OMAP revision unknown, please fix!\n"); 342 pr_err("OMAP revision unknown, please fix!\n");
343 }
363 344
364 /* 345 /*
365 * OK, now we know the exact revision. Initialize omap_chip bits 346 * OK, now we know the exact revision. Initialize omap_chip bits