4 * Copyright (C) 2006 - 2008 Paul Mundt
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/platform_device.h>
11 #include <linux/init.h>
12 #include <linux/serial.h>
13 #include <linux/serial_sci.h>
14 #include <linux/sh_timer.h>
16 static struct plat_sci_port sci_platform_data[] = {
18 .mapbase = 0xff923000,
19 .flags = UPF_BOOT_AUTOCONF,
21 .irqs = { 61, 61, 61, 61 },
23 .mapbase = 0xff924000,
24 .flags = UPF_BOOT_AUTOCONF,
26 .irqs = { 62, 62, 62, 62 },
28 .mapbase = 0xff925000,
29 .flags = UPF_BOOT_AUTOCONF,
31 .irqs = { 63, 63, 63, 63 },
33 .mapbase = 0xff926000,
34 .flags = UPF_BOOT_AUTOCONF,
36 .irqs = { 64, 64, 64, 64 },
38 .mapbase = 0xff927000,
39 .flags = UPF_BOOT_AUTOCONF,
41 .irqs = { 65, 65, 65, 65 },
43 .mapbase = 0xff928000,
44 .flags = UPF_BOOT_AUTOCONF,
46 .irqs = { 66, 66, 66, 66 },
48 .mapbase = 0xff929000,
49 .flags = UPF_BOOT_AUTOCONF,
51 .irqs = { 67, 67, 67, 67 },
53 .mapbase = 0xff92a000,
54 .flags = UPF_BOOT_AUTOCONF,
56 .irqs = { 68, 68, 68, 68 },
58 .mapbase = 0xff92b000,
59 .flags = UPF_BOOT_AUTOCONF,
61 .irqs = { 69, 69, 69, 69 },
63 .mapbase = 0xff92c000,
64 .flags = UPF_BOOT_AUTOCONF,
66 .irqs = { 70, 70, 70, 70 },
72 static struct platform_device sci_device = {
76 .platform_data = sci_platform_data,
80 static struct sh_timer_config tmu0_platform_data = {
82 .channel_offset = 0x04,
85 .clockevent_rating = 200,
88 static struct resource tmu0_resources[] = {
93 .flags = IORESOURCE_MEM,
97 .flags = IORESOURCE_IRQ,
101 static struct platform_device tmu0_device = {
105 .platform_data = &tmu0_platform_data,
107 .resource = tmu0_resources,
108 .num_resources = ARRAY_SIZE(tmu0_resources),
111 static struct sh_timer_config tmu1_platform_data = {
113 .channel_offset = 0x10,
116 .clocksource_rating = 200,
119 static struct resource tmu1_resources[] = {
124 .flags = IORESOURCE_MEM,
128 .flags = IORESOURCE_IRQ,
132 static struct platform_device tmu1_device = {
136 .platform_data = &tmu1_platform_data,
138 .resource = tmu1_resources,
139 .num_resources = ARRAY_SIZE(tmu1_resources),
142 static struct sh_timer_config tmu2_platform_data = {
144 .channel_offset = 0x1c,
149 static struct resource tmu2_resources[] = {
154 .flags = IORESOURCE_MEM,
158 .flags = IORESOURCE_IRQ,
162 static struct platform_device tmu2_device = {
166 .platform_data = &tmu2_platform_data,
168 .resource = tmu2_resources,
169 .num_resources = ARRAY_SIZE(tmu2_resources),
172 static struct sh_timer_config tmu3_platform_data = {
174 .channel_offset = 0x04,
179 static struct resource tmu3_resources[] = {
184 .flags = IORESOURCE_MEM,
188 .flags = IORESOURCE_IRQ,
192 static struct platform_device tmu3_device = {
196 .platform_data = &tmu3_platform_data,
198 .resource = tmu3_resources,
199 .num_resources = ARRAY_SIZE(tmu3_resources),
202 static struct sh_timer_config tmu4_platform_data = {
204 .channel_offset = 0x10,
209 static struct resource tmu4_resources[] = {
214 .flags = IORESOURCE_MEM,
218 .flags = IORESOURCE_IRQ,
222 static struct platform_device tmu4_device = {
226 .platform_data = &tmu4_platform_data,
228 .resource = tmu4_resources,
229 .num_resources = ARRAY_SIZE(tmu4_resources),
232 static struct sh_timer_config tmu5_platform_data = {
234 .channel_offset = 0x1c,
239 static struct resource tmu5_resources[] = {
244 .flags = IORESOURCE_MEM,
248 .flags = IORESOURCE_IRQ,
252 static struct platform_device tmu5_device = {
256 .platform_data = &tmu5_platform_data,
258 .resource = tmu5_resources,
259 .num_resources = ARRAY_SIZE(tmu5_resources),
262 static struct sh_timer_config tmu6_platform_data = {
264 .channel_offset = 0x04,
269 static struct resource tmu6_resources[] = {
274 .flags = IORESOURCE_MEM,
278 .flags = IORESOURCE_IRQ,
282 static struct platform_device tmu6_device = {
286 .platform_data = &tmu6_platform_data,
288 .resource = tmu6_resources,
289 .num_resources = ARRAY_SIZE(tmu6_resources),
292 static struct sh_timer_config tmu7_platform_data = {
294 .channel_offset = 0x10,
299 static struct resource tmu7_resources[] = {
304 .flags = IORESOURCE_MEM,
308 .flags = IORESOURCE_IRQ,
312 static struct platform_device tmu7_device = {
316 .platform_data = &tmu7_platform_data,
318 .resource = tmu7_resources,
319 .num_resources = ARRAY_SIZE(tmu7_resources),
322 static struct sh_timer_config tmu8_platform_data = {
324 .channel_offset = 0x1c,
329 static struct resource tmu8_resources[] = {
334 .flags = IORESOURCE_MEM,
338 .flags = IORESOURCE_IRQ,
342 static struct platform_device tmu8_device = {
346 .platform_data = &tmu8_platform_data,
348 .resource = tmu8_resources,
349 .num_resources = ARRAY_SIZE(tmu8_resources),
352 static struct platform_device *sh7770_devices[] __initdata = {
365 static int __init sh7770_devices_setup(void)
367 return platform_add_devices(sh7770_devices,
368 ARRAY_SIZE(sh7770_devices));
370 __initcall(sh7770_devices_setup);
372 static struct platform_device *sh7770_early_devices[] __initdata = {
384 void __init plat_early_device_setup(void)
386 early_platform_add_devices(sh7770_early_devices,
387 ARRAY_SIZE(sh7770_early_devices));
390 void __init plat_irq_setup(void)