diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2009-03-20 20:37:21 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-04-23 12:27:59 -0400 |
commit | e653034e66ec406f37427f588115badc6fc6af64 (patch) | |
tree | d30b5486bf2ef34d4eab79f7632f95065c96a297 /arch/arm/mach-davinci/id.c | |
parent | 9232fcc99948e39d5be04fc1c1025bd4f7998739 (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.c | 29 |
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 @@ | |||
17 | 17 | ||
18 | #define JTAG_ID_BASE 0x01c40028 | 18 | #define JTAG_ID_BASE 0x01c40028 |
19 | 19 | ||
20 | static unsigned int davinci_revision; | ||
21 | |||
20 | struct davinci_id { | 22 | struct davinci_id { |
21 | u8 variant; /* JTAG ID bits 31:28 */ | 23 | u8 variant; /* JTAG ID bits 31:28 */ |
22 | u16 part_no; /* JTAG ID bits 27:12 */ | 24 | u16 part_no; /* JTAG ID bits 27:12 */ |
@@ -33,6 +35,20 @@ static struct davinci_id davinci_ids[] __initdata = { | |||
33 | .manufacturer = 0x017, | 35 | .manufacturer = 0x017, |
34 | .type = 0x64460000, | 36 | .type = 0x64460000, |
35 | }, | 37 | }, |
38 | { | ||
39 | /* DM646X */ | ||
40 | .part_no = 0xb770, | ||
41 | .variant = 0x0, | ||
42 | .manufacturer = 0x017, | ||
43 | .type = 0x64670000, | ||
44 | }, | ||
45 | { | ||
46 | /* DM355 */ | ||
47 | .part_no = 0xb73b, | ||
48 | .variant = 0x0, | ||
49 | .manufacturer = 0x00f, | ||
50 | .type = 0x03550000, | ||
51 | }, | ||
36 | }; | 52 | }; |
37 | 53 | ||
38 | /* | 54 | /* |
@@ -63,6 +79,12 @@ static u8 __init davinci_get_variant(void) | |||
63 | return variant; | 79 | return variant; |
64 | } | 80 | } |
65 | 81 | ||
82 | unsigned int davinci_rev(void) | ||
83 | { | ||
84 | return davinci_revision >> 16; | ||
85 | } | ||
86 | EXPORT_SYMBOL(davinci_rev); | ||
87 | |||
66 | void __init davinci_check_revision(void) | 88 | void __init davinci_check_revision(void) |
67 | { | 89 | { |
68 | int i; | 90 | int i; |
@@ -75,7 +97,7 @@ void __init davinci_check_revision(void) | |||
75 | /* First check only the major version in a safe way */ | 97 | /* First check only the major version in a safe way */ |
76 | for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) { | 98 | for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) { |
77 | if (part_no == (davinci_ids[i].part_no)) { | 99 | if (part_no == (davinci_ids[i].part_no)) { |
78 | system_rev = davinci_ids[i].type; | 100 | davinci_revision = davinci_ids[i].type; |
79 | break; | 101 | break; |
80 | } | 102 | } |
81 | } | 103 | } |
@@ -84,10 +106,11 @@ void __init davinci_check_revision(void) | |||
84 | for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) { | 106 | for (i = 0; i < ARRAY_SIZE(davinci_ids); i++) { |
85 | if (part_no == davinci_ids[i].part_no && | 107 | if (part_no == davinci_ids[i].part_no && |
86 | variant == davinci_ids[i].variant) { | 108 | variant == davinci_ids[i].variant) { |
87 | system_rev = davinci_ids[i].type; | 109 | davinci_revision = davinci_ids[i].type; |
88 | break; | 110 | break; |
89 | } | 111 | } |
90 | } | 112 | } |
91 | 113 | ||
92 | printk("DaVinci DM%04x variant 0x%x\n", system_rev >> 16, variant); | 114 | printk(KERN_INFO "DaVinci DM%04x variant 0x%x\n", |
115 | davinci_rev(), variant); | ||
93 | } | 116 | } |