diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-10-14 17:24:42 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-10-14 17:24:42 -0400 |
commit | b6825d2df55aa7d7341c715b577b73a6a03dc944 (patch) | |
tree | ae4f0f52f4c2ad4e501dd323318486ccdd7fcd93 /arch/arm/mach-omap2/id.c | |
parent | 6defd90433729c2d795865165cb34d938d8ff07c (diff) | |
parent | aa59e19d05114f9fb7718d6bc8398255476fb4f5 (diff) |
Merge branch 'omap-all' into devel
Conflicts:
arch/arm/mach-omap2/gpmc.c
arch/arm/mach-omap2/irq.c
Diffstat (limited to 'arch/arm/mach-omap2/id.c')
-rw-r--r-- | arch/arm/mach-omap2/id.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 209177c7f22f..bf45ff39a7b5 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -18,24 +18,15 @@ | |||
18 | 18 | ||
19 | #include <asm/cputype.h> | 19 | #include <asm/cputype.h> |
20 | 20 | ||
21 | #include <mach/common.h> | ||
21 | #include <mach/control.h> | 22 | #include <mach/control.h> |
22 | #include <mach/cpu.h> | 23 | #include <mach/cpu.h> |
23 | 24 | ||
24 | #if defined(CONFIG_ARCH_OMAP2420) | 25 | static u32 class; |
25 | #define TAP_BASE io_p2v(0x48014000) | 26 | static void __iomem *tap_base; |
26 | #elif defined(CONFIG_ARCH_OMAP2430) | 27 | static u16 tap_prod_id; |
27 | #define TAP_BASE io_p2v(0x4900A000) | ||
28 | #elif defined(CONFIG_ARCH_OMAP34XX) | ||
29 | #define TAP_BASE io_p2v(0x4830A000) | ||
30 | #endif | ||
31 | 28 | ||
32 | #define OMAP_TAP_IDCODE 0x0204 | 29 | #define OMAP_TAP_IDCODE 0x0204 |
33 | #if defined(CONFIG_ARCH_OMAP34XX) | ||
34 | #define OMAP_TAP_PROD_ID 0x0210 | ||
35 | #else | ||
36 | #define OMAP_TAP_PROD_ID 0x0208 | ||
37 | #endif | ||
38 | |||
39 | #define OMAP_TAP_DIE_ID_0 0x0218 | 30 | #define OMAP_TAP_DIE_ID_0 0x0218 |
40 | #define OMAP_TAP_DIE_ID_1 0x021C | 31 | #define OMAP_TAP_DIE_ID_1 0x021C |
41 | #define OMAP_TAP_DIE_ID_2 0x0220 | 32 | #define OMAP_TAP_DIE_ID_2 0x0220 |
@@ -94,18 +85,24 @@ static u32 __init read_tap_reg(int reg) | |||
94 | * it means its Cortex r0p0 which is 3430 ES1 | 85 | * it means its Cortex r0p0 which is 3430 ES1 |
95 | */ | 86 | */ |
96 | if ((((cpuid >> 4) & 0xFFF) == 0xC08) && ((cpuid & 0xF) == 0x0)) { | 87 | if ((((cpuid >> 4) & 0xFFF) == 0xC08) && ((cpuid & 0xF) == 0x0)) { |
88 | |||
89 | if (reg == tap_prod_id) { | ||
90 | regval = 0x000F00F0; | ||
91 | goto out; | ||
92 | } | ||
93 | |||
97 | switch (reg) { | 94 | switch (reg) { |
98 | case OMAP_TAP_IDCODE : regval = 0x0B7AE02F; break; | 95 | case OMAP_TAP_IDCODE : regval = 0x0B7AE02F; break; |
99 | /* Making DevType as 0xF in ES1 to differ from ES2 */ | 96 | /* Making DevType as 0xF in ES1 to differ from ES2 */ |
100 | case OMAP_TAP_PROD_ID : regval = 0x000F00F0; break; | ||
101 | case OMAP_TAP_DIE_ID_0: regval = 0x01000000; break; | 97 | case OMAP_TAP_DIE_ID_0: regval = 0x01000000; break; |
102 | case OMAP_TAP_DIE_ID_1: regval = 0x1012d687; break; | 98 | case OMAP_TAP_DIE_ID_1: regval = 0x1012d687; break; |
103 | case OMAP_TAP_DIE_ID_2: regval = 0x00000000; break; | 99 | case OMAP_TAP_DIE_ID_2: regval = 0x00000000; break; |
104 | case OMAP_TAP_DIE_ID_3: regval = 0x2d2c0000; break; | 100 | case OMAP_TAP_DIE_ID_3: regval = 0x2d2c0000; break; |
105 | } | 101 | } |
106 | } else | 102 | } else |
107 | regval = __raw_readl(TAP_BASE + reg); | 103 | regval = __raw_readl(tap_base + reg); |
108 | 104 | ||
105 | out: | ||
109 | return regval; | 106 | return regval; |
110 | 107 | ||
111 | } | 108 | } |
@@ -204,7 +201,7 @@ void __init omap2_check_revision(void) | |||
204 | u8 rev; | 201 | u8 rev; |
205 | 202 | ||
206 | idcode = read_tap_reg(OMAP_TAP_IDCODE); | 203 | idcode = read_tap_reg(OMAP_TAP_IDCODE); |
207 | prod_id = read_tap_reg(OMAP_TAP_PROD_ID); | 204 | prod_id = read_tap_reg(tap_prod_id); |
208 | hawkeye = (idcode >> 12) & 0xffff; | 205 | hawkeye = (idcode >> 12) & 0xffff; |
209 | rev = (idcode >> 28) & 0x0f; | 206 | rev = (idcode >> 28) & 0x0f; |
210 | dev_type = (prod_id >> 16) & 0x0f; | 207 | dev_type = (prod_id >> 16) & 0x0f; |
@@ -269,3 +266,13 @@ void __init omap2_check_revision(void) | |||
269 | 266 | ||
270 | } | 267 | } |
271 | 268 | ||
269 | void __init omap2_set_globals_tap(struct omap_globals *omap2_globals) | ||
270 | { | ||
271 | class = omap2_globals->class; | ||
272 | tap_base = omap2_globals->tap; | ||
273 | |||
274 | if (class == 0x3430) | ||
275 | tap_prod_id = 0x0210; | ||
276 | else | ||
277 | tap_prod_id = 0x0208; | ||
278 | } | ||