diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-12 05:39:06 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-12 06:37:33 -0400 |
commit | e37677a429a67cb45004b060ea3376e500bc73c4 (patch) | |
tree | eb9b212e1979e5278480de2a009055c3533e60da | |
parent | 67d889bd828a3cbf36ef27bd4a5c5f7ec76e20b9 (diff) |
sh: TMU platform data for sh7343
This patch adds TMU platform data for sh7343. 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-sh7343.c | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c index b9c361e8cc82..51204dc7ca21 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c | |||
@@ -173,6 +173,98 @@ static struct platform_device cmt_device = { | |||
173 | .num_resources = ARRAY_SIZE(cmt_resources), | 173 | .num_resources = ARRAY_SIZE(cmt_resources), |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static struct sh_timer_config tmu0_platform_data = { | ||
177 | .name = "TMU0", | ||
178 | .channel_offset = 0x04, | ||
179 | .timer_bit = 0, | ||
180 | .clk = "tmu0", | ||
181 | .clockevent_rating = 200, | ||
182 | }; | ||
183 | |||
184 | static struct resource tmu0_resources[] = { | ||
185 | [0] = { | ||
186 | .name = "TMU0", | ||
187 | .start = 0xffd80008, | ||
188 | .end = 0xffd80013, | ||
189 | .flags = IORESOURCE_MEM, | ||
190 | }, | ||
191 | [1] = { | ||
192 | .start = 16, | ||
193 | .flags = IORESOURCE_IRQ, | ||
194 | }, | ||
195 | }; | ||
196 | |||
197 | static struct platform_device tmu0_device = { | ||
198 | .name = "sh_tmu", | ||
199 | .id = 0, | ||
200 | .dev = { | ||
201 | .platform_data = &tmu0_platform_data, | ||
202 | }, | ||
203 | .resource = tmu0_resources, | ||
204 | .num_resources = ARRAY_SIZE(tmu0_resources), | ||
205 | }; | ||
206 | |||
207 | static struct sh_timer_config tmu1_platform_data = { | ||
208 | .name = "TMU1", | ||
209 | .channel_offset = 0x10, | ||
210 | .timer_bit = 1, | ||
211 | .clk = "tmu0", | ||
212 | .clocksource_rating = 200, | ||
213 | }; | ||
214 | |||
215 | static struct resource tmu1_resources[] = { | ||
216 | [0] = { | ||
217 | .name = "TMU1", | ||
218 | .start = 0xffd80014, | ||
219 | .end = 0xffd8001f, | ||
220 | .flags = IORESOURCE_MEM, | ||
221 | }, | ||
222 | [1] = { | ||
223 | .start = 17, | ||
224 | .flags = IORESOURCE_IRQ, | ||
225 | }, | ||
226 | }; | ||
227 | |||
228 | static struct platform_device tmu1_device = { | ||
229 | .name = "sh_tmu", | ||
230 | .id = 1, | ||
231 | .dev = { | ||
232 | .platform_data = &tmu1_platform_data, | ||
233 | }, | ||
234 | .resource = tmu1_resources, | ||
235 | .num_resources = ARRAY_SIZE(tmu1_resources), | ||
236 | }; | ||
237 | |||
238 | static struct sh_timer_config tmu2_platform_data = { | ||
239 | .name = "TMU2", | ||
240 | .channel_offset = 0x1c, | ||
241 | .timer_bit = 2, | ||
242 | .clk = "tmu0", | ||
243 | }; | ||
244 | |||
245 | static struct resource tmu2_resources[] = { | ||
246 | [0] = { | ||
247 | .name = "TMU2", | ||
248 | .start = 0xffd80020, | ||
249 | .end = 0xffd8002b, | ||
250 | .flags = IORESOURCE_MEM, | ||
251 | }, | ||
252 | [1] = { | ||
253 | .start = 18, | ||
254 | .flags = IORESOURCE_IRQ, | ||
255 | }, | ||
256 | }; | ||
257 | |||
258 | static struct platform_device tmu2_device = { | ||
259 | .name = "sh_tmu", | ||
260 | .id = 2, | ||
261 | .dev = { | ||
262 | .platform_data = &tmu2_platform_data, | ||
263 | }, | ||
264 | .resource = tmu2_resources, | ||
265 | .num_resources = ARRAY_SIZE(tmu2_resources), | ||
266 | }; | ||
267 | |||
176 | static struct plat_sci_port sci_platform_data[] = { | 268 | static struct plat_sci_port sci_platform_data[] = { |
177 | { | 269 | { |
178 | .mapbase = 0xffe00000, | 270 | .mapbase = 0xffe00000, |
@@ -213,6 +305,9 @@ static struct platform_device sci_device = { | |||
213 | 305 | ||
214 | static struct platform_device *sh7343_devices[] __initdata = { | 306 | static struct platform_device *sh7343_devices[] __initdata = { |
215 | &cmt_device, | 307 | &cmt_device, |
308 | &tmu0_device, | ||
309 | &tmu1_device, | ||
310 | &tmu2_device, | ||
216 | &iic0_device, | 311 | &iic0_device, |
217 | &iic1_device, | 312 | &iic1_device, |
218 | &sci_device, | 313 | &sci_device, |
@@ -240,6 +335,9 @@ __initcall(sh7343_devices_setup); | |||
240 | 335 | ||
241 | static struct platform_device *sh7343_early_devices[] __initdata = { | 336 | static struct platform_device *sh7343_early_devices[] __initdata = { |
242 | &cmt_device, | 337 | &cmt_device, |
338 | &tmu0_device, | ||
339 | &tmu1_device, | ||
340 | &tmu2_device, | ||
243 | }; | 341 | }; |
244 | 342 | ||
245 | void __init plat_early_device_setup(void) | 343 | void __init plat_early_device_setup(void) |