aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-05-12 05:20:08 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-05-12 06:35:59 -0400
commitf251935e02e89aa203e0729bfd727175018cec6f (patch)
treea7afcf2afa1a0d5e9179a00c6ae28456afbc3cc8
parent5d8728a71f416fd38a0945271c71cb2933fc5734 (diff)
sh: TMU platform data for sh7770
This patch adds TMU platform data for sh7770. 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>
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7770.c300
1 files changed, 300 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index b73578ee295d..b61d6143aaaa 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -11,6 +11,7 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/serial.h> 12#include <linux/serial.h>
13#include <linux/serial_sci.h> 13#include <linux/serial_sci.h>
14#include <linux/sh_timer.h>
14 15
15static struct plat_sci_port sci_platform_data[] = { 16static struct plat_sci_port sci_platform_data[] = {
16 { 17 {
@@ -76,7 +77,288 @@ static struct platform_device sci_device = {
76 }, 77 },
77}; 78};
78 79
80static struct sh_timer_config tmu0_platform_data = {
81 .name = "TMU0",
82 .channel_offset = 0x04,
83 .timer_bit = 0,
84 .clk = "module_clk",
85 .clockevent_rating = 200,
86};
87
88static struct resource tmu0_resources[] = {
89 [0] = {
90 .name = "TMU0",
91 .start = 0xffd80008,
92 .end = 0xffd80013,
93 .flags = IORESOURCE_MEM,
94 },
95 [1] = {
96 .start = 16,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101static struct platform_device tmu0_device = {
102 .name = "sh_tmu",
103 .id = 0,
104 .dev = {
105 .platform_data = &tmu0_platform_data,
106 },
107 .resource = tmu0_resources,
108 .num_resources = ARRAY_SIZE(tmu0_resources),
109};
110
111static struct sh_timer_config tmu1_platform_data = {
112 .name = "TMU1",
113 .channel_offset = 0x10,
114 .timer_bit = 1,
115 .clk = "module_clk",
116 .clocksource_rating = 200,
117};
118
119static struct resource tmu1_resources[] = {
120 [0] = {
121 .name = "TMU1",
122 .start = 0xffd80014,
123 .end = 0xffd8001f,
124 .flags = IORESOURCE_MEM,
125 },
126 [1] = {
127 .start = 17,
128 .flags = IORESOURCE_IRQ,
129 },
130};
131
132static struct platform_device tmu1_device = {
133 .name = "sh_tmu",
134 .id = 1,
135 .dev = {
136 .platform_data = &tmu1_platform_data,
137 },
138 .resource = tmu1_resources,
139 .num_resources = ARRAY_SIZE(tmu1_resources),
140};
141
142static struct sh_timer_config tmu2_platform_data = {
143 .name = "TMU2",
144 .channel_offset = 0x1c,
145 .timer_bit = 2,
146 .clk = "module_clk",
147};
148
149static struct resource tmu2_resources[] = {
150 [0] = {
151 .name = "TMU2",
152 .start = 0xffd80020,
153 .end = 0xffd8002f,
154 .flags = IORESOURCE_MEM,
155 },
156 [1] = {
157 .start = 18,
158 .flags = IORESOURCE_IRQ,
159 },
160};
161
162static struct platform_device tmu2_device = {
163 .name = "sh_tmu",
164 .id = 2,
165 .dev = {
166 .platform_data = &tmu2_platform_data,
167 },
168 .resource = tmu2_resources,
169 .num_resources = ARRAY_SIZE(tmu2_resources),
170};
171
172static struct sh_timer_config tmu3_platform_data = {
173 .name = "TMU3",
174 .channel_offset = 0x04,
175 .timer_bit = 0,
176 .clk = "module_clk",
177};
178
179static struct resource tmu3_resources[] = {
180 [0] = {
181 .name = "TMU3",
182 .start = 0xffd81008,
183 .end = 0xffd81013,
184 .flags = IORESOURCE_MEM,
185 },
186 [1] = {
187 .start = 19,
188 .flags = IORESOURCE_IRQ,
189 },
190};
191
192static struct platform_device tmu3_device = {
193 .name = "sh_tmu",
194 .id = 3,
195 .dev = {
196 .platform_data = &tmu3_platform_data,
197 },
198 .resource = tmu3_resources,
199 .num_resources = ARRAY_SIZE(tmu3_resources),
200};
201
202static struct sh_timer_config tmu4_platform_data = {
203 .name = "TMU4",
204 .channel_offset = 0x10,
205 .timer_bit = 1,
206 .clk = "module_clk",
207};
208
209static struct resource tmu4_resources[] = {
210 [0] = {
211 .name = "TMU4",
212 .start = 0xffd81014,
213 .end = 0xffd8101f,
214 .flags = IORESOURCE_MEM,
215 },
216 [1] = {
217 .start = 20,
218 .flags = IORESOURCE_IRQ,
219 },
220};
221
222static struct platform_device tmu4_device = {
223 .name = "sh_tmu",
224 .id = 4,
225 .dev = {
226 .platform_data = &tmu4_platform_data,
227 },
228 .resource = tmu4_resources,
229 .num_resources = ARRAY_SIZE(tmu4_resources),
230};
231
232static struct sh_timer_config tmu5_platform_data = {
233 .name = "TMU5",
234 .channel_offset = 0x1c,
235 .timer_bit = 2,
236 .clk = "module_clk",
237};
238
239static struct resource tmu5_resources[] = {
240 [0] = {
241 .name = "TMU5",
242 .start = 0xffd81020,
243 .end = 0xffd8102f,
244 .flags = IORESOURCE_MEM,
245 },
246 [1] = {
247 .start = 21,
248 .flags = IORESOURCE_IRQ,
249 },
250};
251
252static struct platform_device tmu5_device = {
253 .name = "sh_tmu",
254 .id = 5,
255 .dev = {
256 .platform_data = &tmu5_platform_data,
257 },
258 .resource = tmu5_resources,
259 .num_resources = ARRAY_SIZE(tmu5_resources),
260};
261
262static struct sh_timer_config tmu6_platform_data = {
263 .name = "TMU6",
264 .channel_offset = 0x04,
265 .timer_bit = 0,
266 .clk = "module_clk",
267};
268
269static struct resource tmu6_resources[] = {
270 [0] = {
271 .name = "TMU6",
272 .start = 0xffd82008,
273 .end = 0xffd82013,
274 .flags = IORESOURCE_MEM,
275 },
276 [1] = {
277 .start = 22,
278 .flags = IORESOURCE_IRQ,
279 },
280};
281
282static struct platform_device tmu6_device = {
283 .name = "sh_tmu",
284 .id = 6,
285 .dev = {
286 .platform_data = &tmu6_platform_data,
287 },
288 .resource = tmu6_resources,
289 .num_resources = ARRAY_SIZE(tmu6_resources),
290};
291
292static struct sh_timer_config tmu7_platform_data = {
293 .name = "TMU7",
294 .channel_offset = 0x10,
295 .timer_bit = 1,
296 .clk = "module_clk",
297};
298
299static struct resource tmu7_resources[] = {
300 [0] = {
301 .name = "TMU7",
302 .start = 0xffd82014,
303 .end = 0xffd8201f,
304 .flags = IORESOURCE_MEM,
305 },
306 [1] = {
307 .start = 23,
308 .flags = IORESOURCE_IRQ,
309 },
310};
311
312static struct platform_device tmu7_device = {
313 .name = "sh_tmu",
314 .id = 7,
315 .dev = {
316 .platform_data = &tmu7_platform_data,
317 },
318 .resource = tmu7_resources,
319 .num_resources = ARRAY_SIZE(tmu7_resources),
320};
321
322static struct sh_timer_config tmu8_platform_data = {
323 .name = "TMU8",
324 .channel_offset = 0x1c,
325 .timer_bit = 2,
326 .clk = "module_clk",
327};
328
329static struct resource tmu8_resources[] = {
330 [0] = {
331 .name = "TMU8",
332 .start = 0xffd82020,
333 .end = 0xffd8202b,
334 .flags = IORESOURCE_MEM,
335 },
336 [1] = {
337 .start = 24,
338 .flags = IORESOURCE_IRQ,
339 },
340};
341
342static struct platform_device tmu8_device = {
343 .name = "sh_tmu",
344 .id = 8,
345 .dev = {
346 .platform_data = &tmu8_platform_data,
347 },
348 .resource = tmu8_resources,
349 .num_resources = ARRAY_SIZE(tmu8_resources),
350};
351
79static struct platform_device *sh7770_devices[] __initdata = { 352static struct platform_device *sh7770_devices[] __initdata = {
353 &tmu0_device,
354 &tmu1_device,
355 &tmu2_device,
356 &tmu3_device,
357 &tmu4_device,
358 &tmu5_device,
359 &tmu6_device,
360 &tmu7_device,
361 &tmu8_device,
80 &sci_device, 362 &sci_device,
81}; 363};
82 364
@@ -87,6 +369,24 @@ static int __init sh7770_devices_setup(void)
87} 369}
88__initcall(sh7770_devices_setup); 370__initcall(sh7770_devices_setup);
89 371
372static struct platform_device *sh7770_early_devices[] __initdata = {
373 &tmu0_device,
374 &tmu1_device,
375 &tmu2_device,
376 &tmu3_device,
377 &tmu4_device,
378 &tmu5_device,
379 &tmu6_device,
380 &tmu7_device,
381 &tmu8_device,
382};
383
384void __init plat_early_device_setup(void)
385{
386 early_platform_add_devices(sh7770_early_devices,
387 ARRAY_SIZE(sh7770_early_devices));
388}
389
90void __init plat_irq_setup(void) 390void __init plat_irq_setup(void)
91{ 391{
92} 392}