@@ -42,28 +42,20 @@ int omap_type(void)
{
u32 val = 0;
- if (cpu_is_omap24xx()) {
- val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
- } else if (soc_is_am33xx()) {
- val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
- } else if (cpu_is_omap34xx()) {
- val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
- } else if (cpu_is_omap44xx()) {
- val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
- } else if (soc_is_omap54xx()) {
- val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
+ val = __raw_readl(omap_ctrl_base_get());
+ if (!val) {
+ pr_err("Cannot detect omap type!\n");
+ return 0;
+ }
+
+ if (soc_is_omap54xx()) {
val &= OMAP5_DEVICETYPE_MASK;
val >>= 6;
- goto out;
} else {
- pr_err("Cannot detect omap type!\n");
- goto out;
+ val &= OMAP2_DEVICETYPE_MASK;
+ val >>= 8;
}
- val &= OMAP2_DEVICETYPE_MASK;
- val >>= 8;
-
-out:
return val;
}
EXPORT_SYMBOL(omap_type);