Commit edeae658 authored by Felipe Balbi's avatar Felipe Balbi Committed by Tony Lindgren

omap: Cleanup the coding style in id.c

Cleanup the coding style in id.c while avoiding unneeded switch()
statements.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 5ed8d32e
...@@ -53,11 +53,11 @@ int omap_type(void) ...@@ -53,11 +53,11 @@ int omap_type(void)
{ {
u32 val = 0; u32 val = 0;
if (cpu_is_omap24xx()) if (cpu_is_omap24xx()) {
val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
else if (cpu_is_omap34xx()) } else if (cpu_is_omap34xx()) {
val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
else { } else {
pr_err("Cannot detect omap type!\n"); pr_err("Cannot detect omap type!\n");
goto out; goto out;
} }
...@@ -224,24 +224,12 @@ void __init omap3_check_revision(void) ...@@ -224,24 +224,12 @@ void __init omap3_check_revision(void)
omap_revision = OMAP3430_REV_ES3_0; omap_revision = OMAP3430_REV_ES3_0;
break; break;
case 4: case 4:
omap_revision = OMAP3430_REV_ES3_1; /* FALLTHROUGH */
break;
default: default:
/* Use the latest known revision as default */ /* Use the latest known revision as default */
omap_revision = OMAP3430_REV_ES3_1; omap_revision = OMAP3430_REV_ES3_1;
} }
break; break;
case 0xb891:
/* Handle 36xx devices */
switch (rev) {
case 0:
omap_revision = OMAP3630_REV_ES1_0;
break;
default:
/* Use the latest known revision as default */
omap_revision = OMAP3630_REV_ES1_0;
}
break;
case 0xb868: case 0xb868:
/* Handle OMAP35xx/AM35xx devices /* Handle OMAP35xx/AM35xx devices
* *
...@@ -250,6 +238,8 @@ void __init omap3_check_revision(void) ...@@ -250,6 +238,8 @@ void __init omap3_check_revision(void)
*/ */
omap_revision = OMAP3505_REV(rev); omap_revision = OMAP3505_REV(rev);
break; break;
case 0xb891:
/* FALLTHROUGH */
default: default:
/* Unknown default to latest silicon rev as default*/ /* Unknown default to latest silicon rev as default*/
omap_revision = OMAP3630_REV_ES1_0; omap_revision = OMAP3630_REV_ES1_0;
...@@ -271,35 +261,29 @@ void __init omap3_cpuinfo(void) ...@@ -271,35 +261,29 @@ void __init omap3_cpuinfo(void)
* on available features. Upon detection, update the CPU id * on available features. Upon detection, update the CPU id
* and CPU class bits. * and CPU class bits.
*/ */
if (cpu_is_omap3630()) if (cpu_is_omap3630()) {
strcpy(cpu_name, "OMAP3630"); strcpy(cpu_name, "OMAP3630");
else if (cpu_is_omap3505()) { } else if (cpu_is_omap3505()) {
/* /*
* AM35xx devices * AM35xx devices
*/ */
if (omap3_has_sgx()) { if (omap3_has_sgx()) {
omap_revision = OMAP3517_REV(rev); omap_revision = OMAP3517_REV(rev);
strcpy(cpu_name, "AM3517"); strcpy(cpu_name, "AM3517");
} } else {
else {
/* Already set in omap3_check_revision() */ /* Already set in omap3_check_revision() */
strcpy(cpu_name, "AM3505"); strcpy(cpu_name, "AM3505");
} }
} } else if (omap3_has_iva() && omap3_has_sgx()) {
/* /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices
*/
else if (omap3_has_iva() && omap3_has_sgx())
strcpy(cpu_name, "OMAP3430/3530"); strcpy(cpu_name, "OMAP3430/3530");
else if (omap3_has_sgx()) { } else if (omap3_has_sgx()) {
omap_revision = OMAP3525_REV(rev); omap_revision = OMAP3525_REV(rev);
strcpy(cpu_name, "OMAP3525"); strcpy(cpu_name, "OMAP3525");
} } else if (omap3_has_iva()) {
else if (omap3_has_iva()) {
omap_revision = OMAP3515_REV(rev); omap_revision = OMAP3515_REV(rev);
strcpy(cpu_name, "OMAP3515"); strcpy(cpu_name, "OMAP3515");
} } else {
else {
omap_revision = OMAP3503_REV(rev); omap_revision = OMAP3503_REV(rev);
strcpy(cpu_name, "OMAP3503"); strcpy(cpu_name, "OMAP3503");
} }
...@@ -318,16 +302,13 @@ void __init omap3_cpuinfo(void) ...@@ -318,16 +302,13 @@ void __init omap3_cpuinfo(void)
strcpy(cpu_rev, "3.0"); strcpy(cpu_rev, "3.0");
break; break;
case OMAP_REVBITS_40: case OMAP_REVBITS_40:
strcpy(cpu_rev, "3.1"); /* FALLTHROUGH */
break;
default: default:
/* Use the latest known revision as default */ /* Use the latest known revision as default */
strcpy(cpu_rev, "3.1"); strcpy(cpu_rev, "3.1");
} }
/* /* Print verbose information */
* Print verbose information
*/
pr_info("%s ES%s (", cpu_name, cpu_rev); pr_info("%s ES%s (", cpu_name, cpu_rev);
OMAP3_SHOW_FEATURE(l2cache); OMAP3_SHOW_FEATURE(l2cache);
...@@ -348,18 +329,18 @@ void __init omap2_check_revision(void) ...@@ -348,18 +329,18 @@ void __init omap2_check_revision(void)
* At this point we have an idea about the processor revision set * At this point we have an idea about the processor revision set
* earlier with omap2_set_globals_tap(). * earlier with omap2_set_globals_tap().
*/ */
if (cpu_is_omap24xx()) if (cpu_is_omap24xx()) {
omap24xx_check_revision(); omap24xx_check_revision();
else if (cpu_is_omap34xx()) { } else if (cpu_is_omap34xx()) {
omap3_check_revision(); omap3_check_revision();
omap3_check_features(); omap3_check_features();
omap3_cpuinfo(); omap3_cpuinfo();
} } else if (cpu_is_omap44xx()) {
else if (cpu_is_omap44xx()) {
printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n"); printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n");
return; return;
} else } else {
pr_err("OMAP revision unknown, please fix!\n"); pr_err("OMAP revision unknown, please fix!\n");
}
/* /*
* OK, now we know the exact revision. Initialize omap_chip bits * OK, now we know the exact revision. Initialize omap_chip bits
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment