diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-01 02:58:52 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-03 04:41:37 -0400 |
commit | d43a41bf8b504a1d9f0b4ce7e17d803f4ef39d84 (patch) | |
tree | 4021999f16ac221e7478f43b7ee4fea6de863b28 /arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |
parent | 9570ef20423b549757aa484ad388f9a7d5bdc4d9 (diff) |
sh: TMU platform data for sh7722
This patch adds TMU platform data for sh7722. Only clockevent
mode is enabled for now, clocksource requires this patch:
"clocksource: setup mult_orig in clocksource_enable()"
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7722.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 793c50da6a84..512735c5cc86 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
15 | #include <linux/uio_driver.h> | 15 | #include <linux/uio_driver.h> |
16 | #include <linux/sh_cmt.h> | 16 | #include <linux/sh_cmt.h> |
17 | #include <linux/sh_tmu.h> | ||
17 | #include <asm/clock.h> | 18 | #include <asm/clock.h> |
18 | #include <asm/mmzone.h> | 19 | #include <asm/mmzone.h> |
19 | 20 | ||
@@ -209,6 +210,98 @@ static struct platform_device cmt_device = { | |||
209 | .num_resources = ARRAY_SIZE(cmt_resources), | 210 | .num_resources = ARRAY_SIZE(cmt_resources), |
210 | }; | 211 | }; |
211 | 212 | ||
213 | static struct sh_tmu_config tmu0_platform_data = { | ||
214 | .name = "TMU0", | ||
215 | .channel_offset = 0x04, | ||
216 | .timer_bit = 0, | ||
217 | .clk = "tmu0", | ||
218 | .clockevent_rating = 200, | ||
219 | }; | ||
220 | |||
221 | static struct resource tmu0_resources[] = { | ||
222 | [0] = { | ||
223 | .name = "TMU0", | ||
224 | .start = 0xffd80008, | ||
225 | .end = 0xffd80013, | ||
226 | .flags = IORESOURCE_MEM, | ||
227 | }, | ||
228 | [1] = { | ||
229 | .start = 16, | ||
230 | .flags = IORESOURCE_IRQ, | ||
231 | }, | ||
232 | }; | ||
233 | |||
234 | static struct platform_device tmu0_device = { | ||
235 | .name = "sh_tmu", | ||
236 | .id = 0, | ||
237 | .dev = { | ||
238 | .platform_data = &tmu0_platform_data, | ||
239 | }, | ||
240 | .resource = tmu0_resources, | ||
241 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
242 | }; | ||
243 | |||
244 | static struct sh_tmu_config tmu1_platform_data = { | ||
245 | .name = "TMU1", | ||
246 | .channel_offset = 0x10, | ||
247 | .timer_bit = 1, | ||
248 | .clk = "tmu0", | ||
249 | .clocksource_rating = 0, /* disabled for now */ | ||
250 | }; | ||
251 | |||
252 | static struct resource tmu1_resources[] = { | ||
253 | [0] = { | ||
254 | .name = "TMU1", | ||
255 | .start = 0xffd80014, | ||
256 | .end = 0xffd8001f, | ||
257 | .flags = IORESOURCE_MEM, | ||
258 | }, | ||
259 | [1] = { | ||
260 | .start = 17, | ||
261 | .flags = IORESOURCE_IRQ, | ||
262 | }, | ||
263 | }; | ||
264 | |||
265 | static struct platform_device tmu1_device = { | ||
266 | .name = "sh_tmu", | ||
267 | .id = 1, | ||
268 | .dev = { | ||
269 | .platform_data = &tmu1_platform_data, | ||
270 | }, | ||
271 | .resource = tmu1_resources, | ||
272 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
273 | }; | ||
274 | |||
275 | static struct sh_tmu_config tmu2_platform_data = { | ||
276 | .name = "TMU2", | ||
277 | .channel_offset = 0x1c, | ||
278 | .timer_bit = 2, | ||
279 | .clk = "tmu0", | ||
280 | }; | ||
281 | |||
282 | static struct resource tmu2_resources[] = { | ||
283 | [0] = { | ||
284 | .name = "TMU2", | ||
285 | .start = 0xffd80020, | ||
286 | .end = 0xffd8002b, | ||
287 | .flags = IORESOURCE_MEM, | ||
288 | }, | ||
289 | [1] = { | ||
290 | .start = 18, | ||
291 | .flags = IORESOURCE_IRQ, | ||
292 | }, | ||
293 | }; | ||
294 | |||
295 | static struct platform_device tmu2_device = { | ||
296 | .name = "sh_tmu", | ||
297 | .id = 2, | ||
298 | .dev = { | ||
299 | .platform_data = &tmu2_platform_data, | ||
300 | }, | ||
301 | .resource = tmu2_resources, | ||
302 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
303 | }; | ||
304 | |||
212 | static struct plat_sci_port sci_platform_data[] = { | 305 | static struct plat_sci_port sci_platform_data[] = { |
213 | { | 306 | { |
214 | .mapbase = 0xffe00000, | 307 | .mapbase = 0xffe00000, |
@@ -243,6 +336,9 @@ static struct platform_device sci_device = { | |||
243 | 336 | ||
244 | static struct platform_device *sh7722_devices[] __initdata = { | 337 | static struct platform_device *sh7722_devices[] __initdata = { |
245 | &cmt_device, | 338 | &cmt_device, |
339 | &tmu0_device, | ||
340 | &tmu1_device, | ||
341 | &tmu2_device, | ||
246 | &rtc_device, | 342 | &rtc_device, |
247 | &usbf_device, | 343 | &usbf_device, |
248 | &iic_device, | 344 | &iic_device, |
@@ -271,6 +367,9 @@ __initcall(sh7722_devices_setup); | |||
271 | 367 | ||
272 | static struct platform_device *sh7722_early_devices[] __initdata = { | 368 | static struct platform_device *sh7722_early_devices[] __initdata = { |
273 | &cmt_device, | 369 | &cmt_device, |
370 | &tmu0_device, | ||
371 | &tmu1_device, | ||
372 | &tmu2_device, | ||
274 | }; | 373 | }; |
275 | 374 | ||
276 | void __init plat_early_device_setup(void) | 375 | void __init plat_early_device_setup(void) |