summaryrefslogtreecommitdiff
path: root/arch/arm/mach-davinci/id.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-03-20 17:37:21 -0700
committerKevin Hilman <khilman@deeprootsystems.com>2009-04-23 09:27:59 -0700
commite653034e66ec406f37427f588115badc6fc6af64 (patch)
treed30b5486bf2ef34d4eab79f7632f95065c96a297 /arch/arm/mach-davinci/id.c
parent9232fcc99948e39d5be04fc1c1025bd4f7998739 (diff)
davinci: add runtime CPU detection support
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/id.c')
-rw-r--r--arch/arm/mach-davinci/id.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/arch/arm/mach-davinci/id.c b/arch/arm/mach-davinci/id.c
index bf067d604918..379f2baf66d6 100644
--- a/arch/arm/mach-davinci/id.c
+++ b/arch/arm/mach-davinci/id.c
@@ -17,6 +17,8 @@
#define JTAG_ID_BASE 0x01c40028
+static unsigned int davinci_revision;
+
struct davinci_id {
u8 variant; /* JTAG ID bits 31:28 */
u16 part_no; /* JTAG ID bits 27:12 */
@@ -33,6 +35,20 @@ static struct davinci_id davinci_ids[] __initdata = {
.manufacturer = 0x017,
.type = 0x64460000,
},
+ {
+ /* DM646X */
+ .part_no = 0xb770,
+ .variant = 0x0,
+ .manufacturer = 0x017,
+ .type = 0x64670000,
+ },
+ {
+ /* DM355 */
+ .part_no = 0xb73b,
+ .variant = 0x0,
+ .manufacturer = 0x00f,
+ .type = 0x03550000,
+ },
};
/*
@@ -63,6 +79,12 @@ static u8 __init davinci_get_variant(void)
return variant;
}
+unsigned int davinci_rev(void)
+{
+ return davinci_revision >> 16;
+}
+EXPORT_SYMBOL(davinci_rev);
+
void __init davinci_check_revision(void)
{
int i;
@@ -75,7 +97,7 @@ void __init davinci_check_revision(void)
/* First check only the major version in a safe way */
for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) {
if (part_no == (davinci_ids[i].part_no)) {
- system_rev = davinci_ids[i].type;
+ davinci_revision = davinci_ids[i].type;
break;
}
}
@@ -84,10 +106,11 @@ void __init davinci_check_revision(void)
for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) {
if (part_no == davinci_ids[i].part_no &&
variant == davinci_ids[i].variant) {
- system_rev = davinci_ids[i].type;
+ davinci_revision = davinci_ids[i].type;
break;
}
}
- printk("DaVinci DM%04x variant 0x%x\n", system_rev >> 16, variant);
+ printk(KERN_INFO "DaVinci DM%04x variant 0x%x\n",
+ davinci_rev(), variant);
}