aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@ti.com>2009-12-11 19:16:34 -0500
committerTony Lindgren <tony@atomide.com>2009-12-11 19:16:34 -0500
commitb570e0ec25b371c2e01a1a558e852e2618526817 (patch)
treec531da70c61e8eb2b202d2da14274cebd982f58e
parent8d88f7f70cca3fa6aabac287fccd40cebacb92d1 (diff)
OMAP4: Fix cpu detection
This patch fixes the OMAP4430 cpu detection. The IC rev detection is done with hawkeye and rev. Note that rev does not map directly to defined processor revision numbers as ES1.0 uses value 0.It also fixes the SCM base address to read the correct ID_CODE register. Also the cpu_is_omap44xx() and cpu_is_omap443x() correctly populated instead of always being true Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/id.c27
-rw-r--r--arch/arm/plat-omap/common.c2
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h9
3 files changed, 33 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index f48a4b2654dd..3641ba0c16ef 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -246,6 +246,31 @@ void __init omap3_check_revision(void)
246 } 246 }
247} 247}
248 248
249void __init omap4_check_revision(void)
250{
251 u32 idcode;
252 u16 hawkeye;
253 u8 rev;
254 char *rev_name = "ES1.0";
255
256 /*
257 * The IC rev detection is done with hawkeye and rev.
258 * Note that rev does not map directly to defined processor
259 * revision numbers as ES1.0 uses value 0.
260 */
261 idcode = read_tap_reg(OMAP_TAP_IDCODE);
262 hawkeye = (idcode >> 12) & 0xffff;
263 rev = (idcode >> 28) & 0xff;
264
265 if ((hawkeye == 0xb852) && (rev == 0x0)) {
266 omap_revision = OMAP4430_REV_ES1_0;
267 pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name);
268 return;
269 }
270
271 pr_err("Unknown OMAP4 CPU id\n");
272}
273
249#define OMAP3_SHOW_FEATURE(feat) \ 274#define OMAP3_SHOW_FEATURE(feat) \
250 if (omap3_has_ ##feat()) \ 275 if (omap3_has_ ##feat()) \
251 printk(#feat" "); 276 printk(#feat" ");
@@ -336,7 +361,7 @@ void __init omap2_check_revision(void)
336 omap3_check_features(); 361 omap3_check_features();
337 omap3_cpuinfo(); 362 omap3_cpuinfo();
338 } else if (cpu_is_omap44xx()) { 363 } else if (cpu_is_omap44xx()) {
339 printk(KERN_INFO "FIXME: CPU revision = OMAP4430\n"); 364 omap4_check_revision();
340 return; 365 return;
341 } else { 366 } else {
342 pr_err("OMAP revision unknown, please fix!\n"); 367 pr_err("OMAP revision unknown, please fix!\n");
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index 01ab1e56db1e..bf1eaf3a27d4 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -280,7 +280,7 @@ void __init omap2_set_globals_343x(void)
280#if defined(CONFIG_ARCH_OMAP4) 280#if defined(CONFIG_ARCH_OMAP4)
281static struct omap_globals omap4_globals = { 281static struct omap_globals omap4_globals = {
282 .class = OMAP443X_CLASS, 282 .class = OMAP443X_CLASS,
283 .tap = OMAP2_L4_IO_ADDRESS(0x4830a000), 283 .tap = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
284 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE), 284 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE),
285 .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE), 285 .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
286 .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE), 286 .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 2e1789001dfe..93597850f2f4 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -176,11 +176,13 @@ IS_OMAP_CLASS(15xx, 0x15)
176IS_OMAP_CLASS(16xx, 0x16) 176IS_OMAP_CLASS(16xx, 0x16)
177IS_OMAP_CLASS(24xx, 0x24) 177IS_OMAP_CLASS(24xx, 0x24)
178IS_OMAP_CLASS(34xx, 0x34) 178IS_OMAP_CLASS(34xx, 0x34)
179IS_OMAP_CLASS(44xx, 0x44)
179 180
180IS_OMAP_SUBCLASS(242x, 0x242) 181IS_OMAP_SUBCLASS(242x, 0x242)
181IS_OMAP_SUBCLASS(243x, 0x243) 182IS_OMAP_SUBCLASS(243x, 0x243)
182IS_OMAP_SUBCLASS(343x, 0x343) 183IS_OMAP_SUBCLASS(343x, 0x343)
183IS_OMAP_SUBCLASS(363x, 0x363) 184IS_OMAP_SUBCLASS(363x, 0x363)
185IS_OMAP_SUBCLASS(443x, 0x443)
184 186
185#define cpu_is_omap7xx() 0 187#define cpu_is_omap7xx() 0
186#define cpu_is_omap15xx() 0 188#define cpu_is_omap15xx() 0
@@ -408,8 +410,8 @@ IS_OMAP_TYPE(3517, 0x3517)
408# if defined(CONFIG_ARCH_OMAP4) 410# if defined(CONFIG_ARCH_OMAP4)
409# undef cpu_is_omap44xx 411# undef cpu_is_omap44xx
410# undef cpu_is_omap443x 412# undef cpu_is_omap443x
411# define cpu_is_omap44xx() 1 413# define cpu_is_omap44xx() is_omap44xx()
412# define cpu_is_omap443x() 1 414# define cpu_is_omap443x() is_omap443x()
413# endif 415# endif
414 416
415/* Macros to detect if we have OMAP1 or OMAP2 */ 417/* Macros to detect if we have OMAP1 or OMAP2 */
@@ -443,7 +445,8 @@ IS_OMAP_TYPE(3517, 0x3517)
443#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 12)) 445#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 12))
444#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 12)) 446#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 12))
445 447
446#define OMAP443X_CLASS 0x44300034 448#define OMAP443X_CLASS 0x44300044
449#define OMAP4430_REV_ES1_0 0x44300044
447 450
448/* 451/*
449 * omap_chip bits 452 * omap_chip bits