diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh3/setup-sh7710.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7710.c | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c index 335098b66e2f..efa76c8148f4 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/serial.h> | 14 | #include <linux/serial.h> |
15 | #include <linux/serial_sci.h> | 15 | #include <linux/serial_sci.h> |
16 | #include <linux/sh_timer.h> | ||
16 | #include <asm/rtc.h> | 17 | #include <asm/rtc.h> |
17 | 18 | ||
18 | enum { | 19 | enum { |
@@ -120,7 +121,102 @@ static struct platform_device sci_device = { | |||
120 | }, | 121 | }, |
121 | }; | 122 | }; |
122 | 123 | ||
124 | static struct sh_timer_config tmu0_platform_data = { | ||
125 | .name = "TMU0", | ||
126 | .channel_offset = 0x02, | ||
127 | .timer_bit = 0, | ||
128 | .clk = "peripheral_clk", | ||
129 | .clockevent_rating = 200, | ||
130 | }; | ||
131 | |||
132 | static struct resource tmu0_resources[] = { | ||
133 | [0] = { | ||
134 | .name = "TMU0", | ||
135 | .start = 0xa412fe94, | ||
136 | .end = 0xa412fe9f, | ||
137 | .flags = IORESOURCE_MEM, | ||
138 | }, | ||
139 | [1] = { | ||
140 | .start = 16, | ||
141 | .flags = IORESOURCE_IRQ, | ||
142 | }, | ||
143 | }; | ||
144 | |||
145 | static struct platform_device tmu0_device = { | ||
146 | .name = "sh_tmu", | ||
147 | .id = 0, | ||
148 | .dev = { | ||
149 | .platform_data = &tmu0_platform_data, | ||
150 | }, | ||
151 | .resource = tmu0_resources, | ||
152 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
153 | }; | ||
154 | |||
155 | static struct sh_timer_config tmu1_platform_data = { | ||
156 | .name = "TMU1", | ||
157 | .channel_offset = 0xe, | ||
158 | .timer_bit = 1, | ||
159 | .clk = "peripheral_clk", | ||
160 | .clocksource_rating = 200, | ||
161 | }; | ||
162 | |||
163 | static struct resource tmu1_resources[] = { | ||
164 | [0] = { | ||
165 | .name = "TMU1", | ||
166 | .start = 0xa412fea0, | ||
167 | .end = 0xa412feab, | ||
168 | .flags = IORESOURCE_MEM, | ||
169 | }, | ||
170 | [1] = { | ||
171 | .start = 17, | ||
172 | .flags = IORESOURCE_IRQ, | ||
173 | }, | ||
174 | }; | ||
175 | |||
176 | static struct platform_device tmu1_device = { | ||
177 | .name = "sh_tmu", | ||
178 | .id = 1, | ||
179 | .dev = { | ||
180 | .platform_data = &tmu1_platform_data, | ||
181 | }, | ||
182 | .resource = tmu1_resources, | ||
183 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
184 | }; | ||
185 | |||
186 | static struct sh_timer_config tmu2_platform_data = { | ||
187 | .name = "TMU2", | ||
188 | .channel_offset = 0x1a, | ||
189 | .timer_bit = 2, | ||
190 | .clk = "peripheral_clk", | ||
191 | }; | ||
192 | |||
193 | static struct resource tmu2_resources[] = { | ||
194 | [0] = { | ||
195 | .name = "TMU2", | ||
196 | .start = 0xa412feac, | ||
197 | .end = 0xa412feb5, | ||
198 | .flags = IORESOURCE_MEM, | ||
199 | }, | ||
200 | [1] = { | ||
201 | .start = 18, | ||
202 | .flags = IORESOURCE_IRQ, | ||
203 | }, | ||
204 | }; | ||
205 | |||
206 | static struct platform_device tmu2_device = { | ||
207 | .name = "sh_tmu", | ||
208 | .id = 2, | ||
209 | .dev = { | ||
210 | .platform_data = &tmu2_platform_data, | ||
211 | }, | ||
212 | .resource = tmu2_resources, | ||
213 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
214 | }; | ||
215 | |||
123 | static struct platform_device *sh7710_devices[] __initdata = { | 216 | static struct platform_device *sh7710_devices[] __initdata = { |
217 | &tmu0_device, | ||
218 | &tmu1_device, | ||
219 | &tmu2_device, | ||
124 | &sci_device, | 220 | &sci_device, |
125 | &rtc_device, | 221 | &rtc_device, |
126 | }; | 222 | }; |
@@ -132,6 +228,18 @@ static int __init sh7710_devices_setup(void) | |||
132 | } | 228 | } |
133 | __initcall(sh7710_devices_setup); | 229 | __initcall(sh7710_devices_setup); |
134 | 230 | ||
231 | static struct platform_device *sh7710_early_devices[] __initdata = { | ||
232 | &tmu0_device, | ||
233 | &tmu1_device, | ||
234 | &tmu2_device, | ||
235 | }; | ||
236 | |||
237 | void __init plat_early_device_setup(void) | ||
238 | { | ||
239 | early_platform_add_devices(sh7710_early_devices, | ||
240 | ARRAY_SIZE(sh7710_early_devices)); | ||
241 | } | ||
242 | |||
135 | void __init plat_irq_setup(void) | 243 | void __init plat_irq_setup(void) |
136 | { | 244 | { |
137 | register_intc_controller(&intc_desc); | 245 | register_intc_controller(&intc_desc); |