aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/id.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/id.c')
-rw-r--r--arch/arm/mach-davinci/id.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/arch/arm/mach-davinci/id.c b/arch/arm/mach-davinci/id.c
index bf067d604918..018b994cd794 100644
--- a/arch/arm/mach-davinci/id.c
+++ b/arch/arm/mach-davinci/id.c
@@ -15,7 +15,9 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#define JTAG_ID_BASE 0x01c40028 18#define JTAG_ID_BASE IO_ADDRESS(0x01c40028)
19
20static unsigned int davinci_revision;
19 21
20struct davinci_id { 22struct davinci_id {
21 u8 variant; /* JTAG ID bits 31:28 */ 23 u8 variant; /* JTAG ID bits 31:28 */
@@ -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/*
@@ -42,7 +58,7 @@ static u16 __init davinci_get_part_no(void)
42{ 58{
43 u32 dev_id, part_no; 59 u32 dev_id, part_no;
44 60
45 dev_id = davinci_readl(JTAG_ID_BASE); 61 dev_id = __raw_readl(JTAG_ID_BASE);
46 62
47 part_no = ((dev_id >> 12) & 0xffff); 63 part_no = ((dev_id >> 12) & 0xffff);
48 64
@@ -56,13 +72,19 @@ static u8 __init davinci_get_variant(void)
56{ 72{
57 u32 variant; 73 u32 variant;
58 74
59 variant = davinci_readl(JTAG_ID_BASE); 75 variant = __raw_readl(JTAG_ID_BASE);
60 76
61 variant = (variant >> 28) & 0xf; 77 variant = (variant >> 28) & 0xf;
62 78
63 return variant; 79 return variant;
64} 80}
65 81
82unsigned int davinci_rev(void)
83{
84 return davinci_revision >> 16;
85}
86EXPORT_SYMBOL(davinci_rev);
87
66void __init davinci_check_revision(void) 88void __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}