diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-07 06:55:37 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-07 22:40:09 -0400 |
commit | e367592cc93ac653e7bc0bebbc9bb713a77e2696 (patch) | |
tree | 567fbce6b2214e8a491feb66af50333f126ff69e /arch/sh | |
parent | 06ee846a25642c434c55209151c633f538c12022 (diff) |
sh: TMU platform data for sh7785
This patch adds TMU platform data for sh7785. Both clockevent
and clocksource support is enabled.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/Kconfig | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 204 |
2 files changed, 205 insertions, 0 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 02688d7909a1..b773e7d1b06b 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -393,6 +393,7 @@ config CPU_SUBTYPE_SH7785 | |||
393 | select CPU_SHX2 | 393 | select CPU_SHX2 |
394 | select ARCH_SPARSEMEM_ENABLE | 394 | select ARCH_SPARSEMEM_ENABLE |
395 | select SYS_SUPPORTS_NUMA | 395 | select SYS_SUPPORTS_NUMA |
396 | select SYS_SUPPORTS_TMU | ||
396 | 397 | ||
397 | config CPU_SUBTYPE_SH7786 | 398 | config CPU_SUBTYPE_SH7786 |
398 | bool "Support SH7786 processor" | 399 | bool "Support SH7786 processor" |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index d80802a49dbd..dc5d3e507a21 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c | |||
@@ -13,8 +13,191 @@ | |||
13 | #include <linux/serial_sci.h> | 13 | #include <linux/serial_sci.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/sh_timer.h> | ||
16 | #include <asm/mmzone.h> | 17 | #include <asm/mmzone.h> |
17 | 18 | ||
19 | static struct sh_timer_config tmu0_platform_data = { | ||
20 | .name = "TMU0", | ||
21 | .channel_offset = 0x04, | ||
22 | .timer_bit = 0, | ||
23 | .clk = "module_clk", | ||
24 | .clockevent_rating = 200, | ||
25 | }; | ||
26 | |||
27 | static struct resource tmu0_resources[] = { | ||
28 | [0] = { | ||
29 | .name = "TMU0", | ||
30 | .start = 0xffd80008, | ||
31 | .end = 0xffd80013, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, | ||
34 | [1] = { | ||
35 | .start = 28, | ||
36 | .flags = IORESOURCE_IRQ, | ||
37 | }, | ||
38 | }; | ||
39 | |||
40 | static struct platform_device tmu0_device = { | ||
41 | .name = "sh_tmu", | ||
42 | .id = 0, | ||
43 | .dev = { | ||
44 | .platform_data = &tmu0_platform_data, | ||
45 | }, | ||
46 | .resource = tmu0_resources, | ||
47 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
48 | }; | ||
49 | |||
50 | static struct sh_timer_config tmu1_platform_data = { | ||
51 | .name = "TMU1", | ||
52 | .channel_offset = 0x10, | ||
53 | .timer_bit = 1, | ||
54 | .clk = "module_clk", | ||
55 | .clocksource_rating = 200, | ||
56 | }; | ||
57 | |||
58 | static struct resource tmu1_resources[] = { | ||
59 | [0] = { | ||
60 | .name = "TMU1", | ||
61 | .start = 0xffd80014, | ||
62 | .end = 0xffd8001f, | ||
63 | .flags = IORESOURCE_MEM, | ||
64 | }, | ||
65 | [1] = { | ||
66 | .start = 29, | ||
67 | .flags = IORESOURCE_IRQ, | ||
68 | }, | ||
69 | }; | ||
70 | |||
71 | static struct platform_device tmu1_device = { | ||
72 | .name = "sh_tmu", | ||
73 | .id = 1, | ||
74 | .dev = { | ||
75 | .platform_data = &tmu1_platform_data, | ||
76 | }, | ||
77 | .resource = tmu1_resources, | ||
78 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
79 | }; | ||
80 | |||
81 | static struct sh_timer_config tmu2_platform_data = { | ||
82 | .name = "TMU2", | ||
83 | .channel_offset = 0x1c, | ||
84 | .timer_bit = 2, | ||
85 | .clk = "module_clk", | ||
86 | }; | ||
87 | |||
88 | static struct resource tmu2_resources[] = { | ||
89 | [0] = { | ||
90 | .name = "TMU2", | ||
91 | .start = 0xffd80020, | ||
92 | .end = 0xffd8002f, | ||
93 | .flags = IORESOURCE_MEM, | ||
94 | }, | ||
95 | [1] = { | ||
96 | .start = 30, | ||
97 | .flags = IORESOURCE_IRQ, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static struct platform_device tmu2_device = { | ||
102 | .name = "sh_tmu", | ||
103 | .id = 2, | ||
104 | .dev = { | ||
105 | .platform_data = &tmu2_platform_data, | ||
106 | }, | ||
107 | .resource = tmu2_resources, | ||
108 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
109 | }; | ||
110 | |||
111 | static struct sh_timer_config tmu3_platform_data = { | ||
112 | .name = "TMU3", | ||
113 | .channel_offset = 0x04, | ||
114 | .timer_bit = 0, | ||
115 | .clk = "module_clk", | ||
116 | }; | ||
117 | |||
118 | static struct resource tmu3_resources[] = { | ||
119 | [0] = { | ||
120 | .name = "TMU3", | ||
121 | .start = 0xffdc0008, | ||
122 | .end = 0xffdc0013, | ||
123 | .flags = IORESOURCE_MEM, | ||
124 | }, | ||
125 | [1] = { | ||
126 | .start = 96, | ||
127 | .flags = IORESOURCE_IRQ, | ||
128 | }, | ||
129 | }; | ||
130 | |||
131 | static struct platform_device tmu3_device = { | ||
132 | .name = "sh_tmu", | ||
133 | .id = 3, | ||
134 | .dev = { | ||
135 | .platform_data = &tmu3_platform_data, | ||
136 | }, | ||
137 | .resource = tmu3_resources, | ||
138 | .num_resources = ARRAY_SIZE(tmu3_resources), | ||
139 | }; | ||
140 | |||
141 | static struct sh_timer_config tmu4_platform_data = { | ||
142 | .name = "TMU4", | ||
143 | .channel_offset = 0x10, | ||
144 | .timer_bit = 1, | ||
145 | .clk = "module_clk", | ||
146 | }; | ||
147 | |||
148 | static struct resource tmu4_resources[] = { | ||
149 | [0] = { | ||
150 | .name = "TMU4", | ||
151 | .start = 0xffdc0014, | ||
152 | .end = 0xffdc001f, | ||
153 | .flags = IORESOURCE_MEM, | ||
154 | }, | ||
155 | [1] = { | ||
156 | .start = 97, | ||
157 | .flags = IORESOURCE_IRQ, | ||
158 | }, | ||
159 | }; | ||
160 | |||
161 | static struct platform_device tmu4_device = { | ||
162 | .name = "sh_tmu", | ||
163 | .id = 4, | ||
164 | .dev = { | ||
165 | .platform_data = &tmu4_platform_data, | ||
166 | }, | ||
167 | .resource = tmu4_resources, | ||
168 | .num_resources = ARRAY_SIZE(tmu4_resources), | ||
169 | }; | ||
170 | |||
171 | static struct sh_timer_config tmu5_platform_data = { | ||
172 | .name = "TMU5", | ||
173 | .channel_offset = 0x1c, | ||
174 | .timer_bit = 2, | ||
175 | .clk = "module_clk", | ||
176 | }; | ||
177 | |||
178 | static struct resource tmu5_resources[] = { | ||
179 | [0] = { | ||
180 | .name = "TMU5", | ||
181 | .start = 0xffdc0020, | ||
182 | .end = 0xffdc002b, | ||
183 | .flags = IORESOURCE_MEM, | ||
184 | }, | ||
185 | [1] = { | ||
186 | .start = 98, | ||
187 | .flags = IORESOURCE_IRQ, | ||
188 | }, | ||
189 | }; | ||
190 | |||
191 | static struct platform_device tmu5_device = { | ||
192 | .name = "sh_tmu", | ||
193 | .id = 5, | ||
194 | .dev = { | ||
195 | .platform_data = &tmu5_platform_data, | ||
196 | }, | ||
197 | .resource = tmu5_resources, | ||
198 | .num_resources = ARRAY_SIZE(tmu5_resources), | ||
199 | }; | ||
200 | |||
18 | static struct plat_sci_port sci_platform_data[] = { | 201 | static struct plat_sci_port sci_platform_data[] = { |
19 | { | 202 | { |
20 | .mapbase = 0xffea0000, | 203 | .mapbase = 0xffea0000, |
@@ -60,6 +243,12 @@ static struct platform_device sci_device = { | |||
60 | }; | 243 | }; |
61 | 244 | ||
62 | static struct platform_device *sh7785_devices[] __initdata = { | 245 | static struct platform_device *sh7785_devices[] __initdata = { |
246 | &tmu0_device, | ||
247 | &tmu1_device, | ||
248 | &tmu2_device, | ||
249 | &tmu3_device, | ||
250 | &tmu4_device, | ||
251 | &tmu5_device, | ||
63 | &sci_device, | 252 | &sci_device, |
64 | }; | 253 | }; |
65 | 254 | ||
@@ -70,6 +259,21 @@ static int __init sh7785_devices_setup(void) | |||
70 | } | 259 | } |
71 | __initcall(sh7785_devices_setup); | 260 | __initcall(sh7785_devices_setup); |
72 | 261 | ||
262 | static struct platform_device *sh7785_early_devices[] __initdata = { | ||
263 | &tmu0_device, | ||
264 | &tmu1_device, | ||
265 | &tmu2_device, | ||
266 | &tmu3_device, | ||
267 | &tmu4_device, | ||
268 | &tmu5_device, | ||
269 | }; | ||
270 | |||
271 | void __init plat_early_device_setup(void) | ||
272 | { | ||
273 | early_platform_add_devices(sh7785_early_devices, | ||
274 | ARRAY_SIZE(sh7785_early_devices)); | ||
275 | } | ||
276 | |||
73 | enum { | 277 | enum { |
74 | UNUSED = 0, | 278 | UNUSED = 0, |
75 | 279 | ||