4 * Copyright (C) 2006 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>
15 static struct resource rtc_resources[] = {
18 .end = 0xfffffec0 + 0x1e,
19 .flags = IORESOURCE_IO,
23 .flags = IORESOURCE_IRQ,
27 .flags = IORESOURCE_IRQ,
31 .flags = IORESOURCE_IRQ,
35 static struct plat_sci_port sci_platform_data[] = {
37 .mapbase = 0xfffffe80,
38 .flags = UPF_BOOT_AUTOCONF,
40 .irqs = { 23, 24, 25, 0 },
42 .mapbase = 0xa4000150,
43 .flags = UPF_BOOT_AUTOCONF,
45 .irqs = { 56, 57, 59, 58 },
47 .mapbase = 0xa4000140,
48 .flags = UPF_BOOT_AUTOCONF,
50 .irqs = { 52, 53, 55, 54 },
56 static struct platform_device sci_device = {
60 .platform_data = sci_platform_data,
64 static struct platform_device rtc_device = {
67 .num_resources = ARRAY_SIZE(rtc_resources),
68 .resource = rtc_resources,
71 static struct platform_device *sh7709_devices[] __initdata = {
76 static int __init sh7709_devices_setup(void)
78 return platform_add_devices(sh7709_devices,
79 ARRAY_SIZE(sh7709_devices));
81 __initcall(sh7709_devices_setup);
83 static struct ipr_data ipr_irq_table[] = {
84 { 16, 0, 12, 2 }, /* TMU TUNI0 */
85 { 17, 0, 8, 4 }, /* TMU TUNI1 */
86 { 18, 0, 4, 1 }, /* TMU TUNI1 */
87 { 19, 0, 4, 1 }, /* TMU TUNI1 */
88 { 20, 0, 0, 2 }, /* RTC CUI */
89 { 21, 0, 0, 2 }, /* RTC CUI */
90 { 22, 0, 0, 2 }, /* RTC CUI */
92 { 23, 1, 4, 3 }, /* SCI */
93 { 24, 1, 4, 3 }, /* SCI */
94 { 25, 1, 4, 3 }, /* SCI */
95 { 26, 1, 4, 3 }, /* SCI */
96 { 27, 1, 12, 3 }, /* WDT ITI */
98 { 32, 2, 0, 1 }, /* IRQ 0 */
99 { 33, 2, 4, 1 }, /* IRQ 1 */
100 { 34, 2, 8, 1 }, /* IRQ 2 APM */
101 { 35, 2, 12, 1 }, /* IRQ 3 TOUCHSCREEN */
103 { 36, 3, 0, 1 }, /* IRQ 4 */
104 { 37, 3, 4, 1 }, /* IRQ 5 */
106 { 48, 4, 12, 7 }, /* DMA */
107 { 49, 4, 12, 7 }, /* DMA */
108 { 50, 4, 12, 7 }, /* DMA */
109 { 51, 4, 12, 7 }, /* DMA */
111 { 52, 4, 8, 3 }, /* IRDA */
112 { 53, 4, 8, 3 }, /* IRDA */
113 { 54, 4, 8, 3 }, /* IRDA */
114 { 55, 4, 8, 3 }, /* IRDA */
116 { 56, 4, 4, 3 }, /* SCIF */
117 { 57, 4, 4, 3 }, /* SCIF */
118 { 58, 4, 4, 3 }, /* SCIF */
119 { 59, 4, 4, 3 }, /* SCIF */
122 static unsigned long ipr_offsets[] = {
123 0xfffffee2, /* 0: IPRA */
124 0xfffffee4, /* 1: IPRB */
125 0xa4000016, /* 2: IPRC */
126 0xa4000018, /* 3: IPRD */
127 0xa400001a, /* 4: IPRE */
130 static struct ipr_desc ipr_irq_desc = {
131 .ipr_offsets = ipr_offsets,
132 .nr_offsets = ARRAY_SIZE(ipr_offsets),
134 .ipr_data = ipr_irq_table,
135 .nr_irqs = ARRAY_SIZE(ipr_irq_table),
138 .name = "IPR-sh7709",
142 void __init init_IRQ_ipr(void)
144 register_ipr_controller(&ipr_irq_desc);