diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-12-15 17:13:26 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-12-15 17:13:26 -0500 |
commit | 7e1548a597ef7e26d5d62f8be3be6da9e101b26c (patch) | |
tree | fe6cbf4d9a3c1afdba04fb276fef0f932403727c /arch/arm/mach-omap1/id.c | |
parent | 1f7f569c0ae6e619504095eabf796edd712d943d (diff) | |
parent | 2619bc327417f549f1c89d5ef9b4a4aa768f41a2 (diff) |
Merge branch 'omap3-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel
Diffstat (limited to 'arch/arm/mach-omap1/id.c')
-rw-r--r-- | arch/arm/mach-omap1/id.c | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c index 13083d7e692..89bb8756f45 100644 --- a/arch/arm/mach-omap1/id.c +++ b/arch/arm/mach-omap1/id.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <mach/cpu.h> | ||
18 | 19 | ||
19 | #define OMAP_DIE_ID_0 0xfffe1800 | 20 | #define OMAP_DIE_ID_0 0xfffe1800 |
20 | #define OMAP_DIE_ID_1 0xfffe1804 | 21 | #define OMAP_DIE_ID_1 0xfffe1804 |
@@ -30,6 +31,8 @@ struct omap_id { | |||
30 | u32 type; /* Cpu id bits [31:08], cpu class bits [07:00] */ | 31 | u32 type; /* Cpu id bits [31:08], cpu class bits [07:00] */ |
31 | }; | 32 | }; |
32 | 33 | ||
34 | static unsigned int omap_revision; | ||
35 | |||
33 | /* Register values to detect the OMAP version */ | 36 | /* Register values to detect the OMAP version */ |
34 | static struct omap_id omap_ids[] __initdata = { | 37 | static struct omap_id omap_ids[] __initdata = { |
35 | { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000}, | 38 | { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000}, |
@@ -53,6 +56,12 @@ static struct omap_id omap_ids[] __initdata = { | |||
53 | { .jtag_id = 0xb5f7, .die_rev = 0x2, .omap_id = 0x03330100, .type = 0x17100000}, | 56 | { .jtag_id = 0xb5f7, .die_rev = 0x2, .omap_id = 0x03330100, .type = 0x17100000}, |
54 | }; | 57 | }; |
55 | 58 | ||
59 | unsigned int omap_rev(void) | ||
60 | { | ||
61 | return omap_revision; | ||
62 | } | ||
63 | EXPORT_SYMBOL(omap_rev); | ||
64 | |||
56 | /* | 65 | /* |
57 | * Get OMAP type from PROD_ID. | 66 | * Get OMAP type from PROD_ID. |
58 | * 1710 has the PROD_ID in bits 15:00, not in 16:01 as documented in TRM. | 67 | * 1710 has the PROD_ID in bits 15:00, not in 16:01 as documented in TRM. |
@@ -121,17 +130,18 @@ void __init omap_check_revision(void) | |||
121 | omap_id = omap_readl(OMAP32_ID_0); | 130 | omap_id = omap_readl(OMAP32_ID_0); |
122 | 131 | ||
123 | #ifdef DEBUG | 132 | #ifdef DEBUG |
124 | printk("OMAP_DIE_ID_0: 0x%08x\n", omap_readl(OMAP_DIE_ID_0)); | 133 | printk(KERN_DEBUG "OMAP_DIE_ID_0: 0x%08x\n", omap_readl(OMAP_DIE_ID_0)); |
125 | printk("OMAP_DIE_ID_1: 0x%08x DIE_REV: %i\n", | 134 | printk(KERN_DEBUG "OMAP_DIE_ID_1: 0x%08x DIE_REV: %i\n", |
126 | omap_readl(OMAP_DIE_ID_1), | 135 | omap_readl(OMAP_DIE_ID_1), |
127 | (omap_readl(OMAP_DIE_ID_1) >> 17) & 0xf); | 136 | (omap_readl(OMAP_DIE_ID_1) >> 17) & 0xf); |
128 | printk("OMAP_PRODUCTION_ID_0: 0x%08x\n", omap_readl(OMAP_PRODUCTION_ID_0)); | 137 | printk(KERN_DEBUG "OMAP_PRODUCTION_ID_0: 0x%08x\n", |
129 | printk("OMAP_PRODUCTION_ID_1: 0x%08x JTAG_ID: 0x%04x\n", | 138 | omap_readl(OMAP_PRODUCTION_ID_0)); |
139 | printk(KERN_DEBUG "OMAP_PRODUCTION_ID_1: 0x%08x JTAG_ID: 0x%04x\n", | ||
130 | omap_readl(OMAP_PRODUCTION_ID_1), | 140 | omap_readl(OMAP_PRODUCTION_ID_1), |
131 | omap_readl(OMAP_PRODUCTION_ID_1) & 0xffff); | 141 | omap_readl(OMAP_PRODUCTION_ID_1) & 0xffff); |
132 | printk("OMAP32_ID_0: 0x%08x\n", omap_readl(OMAP32_ID_0)); | 142 | printk(KERN_DEBUG "OMAP32_ID_0: 0x%08x\n", omap_readl(OMAP32_ID_0)); |
133 | printk("OMAP32_ID_1: 0x%08x\n", omap_readl(OMAP32_ID_1)); | 143 | printk(KERN_DEBUG "OMAP32_ID_1: 0x%08x\n", omap_readl(OMAP32_ID_1)); |
134 | printk("JTAG_ID: 0x%04x DIE_REV: %i\n", jtag_id, die_rev); | 144 | printk(KERN_DEBUG "JTAG_ID: 0x%04x DIE_REV: %i\n", jtag_id, die_rev); |
135 | #endif | 145 | #endif |
136 | 146 | ||
137 | system_serial_high = omap_readl(OMAP_DIE_ID_0); | 147 | system_serial_high = omap_readl(OMAP_DIE_ID_0); |
@@ -140,7 +150,7 @@ void __init omap_check_revision(void) | |||
140 | /* First check only the major version in a safe way */ | 150 | /* First check only the major version in a safe way */ |
141 | for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { | 151 | for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { |
142 | if (jtag_id == (omap_ids[i].jtag_id)) { | 152 | if (jtag_id == (omap_ids[i].jtag_id)) { |
143 | system_rev = omap_ids[i].type; | 153 | omap_revision = omap_ids[i].type; |
144 | break; | 154 | break; |
145 | } | 155 | } |
146 | } | 156 | } |
@@ -148,7 +158,7 @@ void __init omap_check_revision(void) | |||
148 | /* Check if we can find the die revision */ | 158 | /* Check if we can find the die revision */ |
149 | for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { | 159 | for (i = 0; i < ARRAY_SIZE(omap_ids); i++) { |
150 | if (jtag_id == omap_ids[i].jtag_id && die_rev == omap_ids[i].die_rev) { | 160 | if (jtag_id == omap_ids[i].jtag_id && die_rev == omap_ids[i].die_rev) { |
151 | system_rev = omap_ids[i].type; | 161 | omap_revision = omap_ids[i].type; |
152 | break; | 162 | break; |
153 | } | 163 | } |
154 | } | 164 | } |
@@ -158,38 +168,35 @@ void __init omap_check_revision(void) | |||
158 | if (jtag_id == omap_ids[i].jtag_id | 168 | if (jtag_id == omap_ids[i].jtag_id |
159 | && die_rev == omap_ids[i].die_rev | 169 | && die_rev == omap_ids[i].die_rev |
160 | && omap_id == omap_ids[i].omap_id) { | 170 | && omap_id == omap_ids[i].omap_id) { |
161 | system_rev = omap_ids[i].type; | 171 | omap_revision = omap_ids[i].type; |
162 | break; | 172 | break; |
163 | } | 173 | } |
164 | } | 174 | } |
165 | 175 | ||
166 | /* Add the cpu class info (7xx, 15xx, 16xx, 24xx) */ | 176 | /* Add the cpu class info (7xx, 15xx, 16xx, 24xx) */ |
167 | cpu_type = system_rev >> 24; | 177 | cpu_type = omap_revision >> 24; |
168 | 178 | ||
169 | switch (cpu_type) { | 179 | switch (cpu_type) { |
170 | case 0x07: | 180 | case 0x07: |
171 | system_rev |= 0x07; | 181 | omap_revision |= 0x07; |
172 | break; | 182 | break; |
173 | case 0x03: | 183 | case 0x03: |
174 | case 0x15: | 184 | case 0x15: |
175 | system_rev |= 0x15; | 185 | omap_revision |= 0x15; |
176 | break; | 186 | break; |
177 | case 0x16: | 187 | case 0x16: |
178 | case 0x17: | 188 | case 0x17: |
179 | system_rev |= 0x16; | 189 | omap_revision |= 0x16; |
180 | break; | ||
181 | case 0x24: | ||
182 | system_rev |= 0x24; | ||
183 | break; | 190 | break; |
184 | default: | 191 | default: |
185 | printk("Unknown OMAP cpu type: 0x%02x\n", cpu_type); | 192 | printk(KERN_INFO "Unknown OMAP cpu type: 0x%02x\n", cpu_type); |
186 | } | 193 | } |
187 | 194 | ||
188 | printk("OMAP%04x", system_rev >> 16); | 195 | printk(KERN_INFO "OMAP%04x", omap_revision >> 16); |
189 | if ((system_rev >> 8) & 0xff) | 196 | if ((omap_revision >> 8) & 0xff) |
190 | printk("%x", (system_rev >> 8) & 0xff); | 197 | printk(KERN_INFO "%x", (omap_revision >> 8) & 0xff); |
191 | printk(" revision %i handled as %02xxx id: %08x%08x\n", | 198 | printk(KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n", |
192 | die_rev, system_rev & 0xff, system_serial_low, | 199 | die_rev, omap_revision & 0xff, system_serial_low, |
193 | system_serial_high); | 200 | system_serial_high); |
194 | } | 201 | } |
195 | 202 | ||