Commit e9acb9b6 authored by Tony Lindgren's avatar Tony Lindgren

omap3: Fix cpu detection

We need to set the omap_chip.oc carefully for the clocks to work.

To fix this, set the omap_chip.oc in omap3_check_features() based
on the CONTROL_IDCODE and silicon revision registers.

Also add handling for 34xx es3.1.2 as es3.1 for now.

Fixes booting on at least overo board.

Based on an earlier patch by Paul Walmsley <paul@pwsan.com>.
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent d4bb72e5
...@@ -188,6 +188,8 @@ void __init omap3_check_revision(void) ...@@ -188,6 +188,8 @@ void __init omap3_check_revision(void)
u16 hawkeye; u16 hawkeye;
u8 rev; u8 rev;
omap_chip.oc = CHIP_IS_OMAP3430;
/* /*
* We cannot access revision registers on ES1.0. * We cannot access revision registers on ES1.0.
* If the processor type is Cortex-A8 and the revision is 0x0 * If the processor type is Cortex-A8 and the revision is 0x0
...@@ -196,6 +198,7 @@ void __init omap3_check_revision(void) ...@@ -196,6 +198,7 @@ void __init omap3_check_revision(void)
cpuid = read_cpuid(CPUID_ID); cpuid = read_cpuid(CPUID_ID);
if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) {
omap_revision = OMAP3430_REV_ES1_0; omap_revision = OMAP3430_REV_ES1_0;
omap_chip.oc |= CHIP_IS_OMAP3430ES1;
return; return;
} }
...@@ -216,18 +219,28 @@ void __init omap3_check_revision(void) ...@@ -216,18 +219,28 @@ void __init omap3_check_revision(void)
case 0: /* Take care of early samples */ case 0: /* Take care of early samples */
case 1: case 1:
omap_revision = OMAP3430_REV_ES2_0; omap_revision = OMAP3430_REV_ES2_0;
omap_chip.oc |= CHIP_IS_OMAP3430ES2;
break; break;
case 2: case 2:
omap_revision = OMAP3430_REV_ES2_1; omap_revision = OMAP3430_REV_ES2_1;
omap_chip.oc |= CHIP_IS_OMAP3430ES2;
break; break;
case 3: case 3:
omap_revision = OMAP3430_REV_ES3_0; omap_revision = OMAP3430_REV_ES3_0;
omap_chip.oc |= CHIP_IS_OMAP3430ES3_0;
break; break;
case 4: case 4:
omap_revision = OMAP3430_REV_ES3_1;
omap_chip.oc |= CHIP_IS_OMAP3430ES3_1;
break;
case 7:
/* FALLTHROUGH */ /* FALLTHROUGH */
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_2;
/* REVISIT: Add CHIP_IS_OMAP3430ES3_1_2? */
omap_chip.oc |= CHIP_IS_OMAP3430ES3_1;
} }
break; break;
case 0xb868: case 0xb868:
...@@ -235,14 +248,18 @@ void __init omap3_check_revision(void) ...@@ -235,14 +248,18 @@ void __init omap3_check_revision(void)
* *
* Set the device to be OMAP3505 here. Actual device * Set the device to be OMAP3505 here. Actual device
* is identified later based on the features. * is identified later based on the features.
*
* REVISIT: AM3505/AM3517 should have their own CHIP_IS
*/ */
omap_revision = OMAP3505_REV(rev); omap_revision = OMAP3505_REV(rev);
omap_chip.oc |= CHIP_IS_OMAP3430ES3_1;
break; break;
case 0xb891: case 0xb891:
/* FALLTHROUGH */ /* 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;
omap_chip.oc |= CHIP_IS_OMAP3630ES1;
} }
} }
...@@ -360,6 +377,7 @@ void __init omap2_check_revision(void) ...@@ -360,6 +377,7 @@ void __init omap2_check_revision(void)
omap3_check_revision(); omap3_check_revision();
omap3_check_features(); omap3_check_features();
omap3_cpuinfo(); omap3_cpuinfo();
return;
} else if (cpu_is_omap44xx()) { } else if (cpu_is_omap44xx()) {
omap4_check_revision(); omap4_check_revision();
return; return;
...@@ -374,27 +392,14 @@ void __init omap2_check_revision(void) ...@@ -374,27 +392,14 @@ void __init omap2_check_revision(void)
if (cpu_is_omap243x()) { if (cpu_is_omap243x()) {
/* Currently only supports 2430ES2.1 and 2430-all */ /* Currently only supports 2430ES2.1 and 2430-all */
omap_chip.oc |= CHIP_IS_OMAP2430; omap_chip.oc |= CHIP_IS_OMAP2430;
return;
} else if (cpu_is_omap242x()) { } else if (cpu_is_omap242x()) {
/* Currently only supports 2420ES2.1.1 and 2420-all */ /* Currently only supports 2420ES2.1.1 and 2420-all */
omap_chip.oc |= CHIP_IS_OMAP2420; omap_chip.oc |= CHIP_IS_OMAP2420;
} else if (cpu_is_omap3505() || cpu_is_omap3517()) { return;
omap_chip.oc = CHIP_IS_OMAP3430 | CHIP_IS_OMAP3430ES3_1;
} else if (cpu_is_omap343x()) {
omap_chip.oc = CHIP_IS_OMAP3430;
if (omap_rev() == OMAP3430_REV_ES1_0)
omap_chip.oc |= CHIP_IS_OMAP3430ES1;
else if (omap_rev() >= OMAP3430_REV_ES2_0 &&
omap_rev() <= OMAP3430_REV_ES2_1)
omap_chip.oc |= CHIP_IS_OMAP3430ES2;
else if (omap_rev() == OMAP3430_REV_ES3_0)
omap_chip.oc |= CHIP_IS_OMAP3430ES3_0;
else if (omap_rev() == OMAP3430_REV_ES3_1)
omap_chip.oc |= CHIP_IS_OMAP3430ES3_1;
else if (omap_rev() == OMAP3630_REV_ES1_0)
omap_chip.oc |= CHIP_IS_OMAP3630ES1;
} else {
pr_err("Uninitialized omap_chip, please fix!\n");
} }
pr_err("Uninitialized omap_chip, please fix!\n");
} }
/* /*
......
...@@ -434,6 +434,7 @@ IS_OMAP_TYPE(3517, 0x3517) ...@@ -434,6 +434,7 @@ IS_OMAP_TYPE(3517, 0x3517)
#define OMAP3430_REV_ES2_1 0x34302034 #define OMAP3430_REV_ES2_1 0x34302034
#define OMAP3430_REV_ES3_0 0x34303034 #define OMAP3430_REV_ES3_0 0x34303034
#define OMAP3430_REV_ES3_1 0x34304034 #define OMAP3430_REV_ES3_1 0x34304034
#define OMAP3430_REV_ES3_1_2 0x34305034
#define OMAP3630_REV_ES1_0 0x36300034 #define OMAP3630_REV_ES1_0 0x36300034
......
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