aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-04-23 07:15:15 -0400
committerSimon Horman <horms+renesas@verge.net.au>2014-05-11 06:35:27 -0400
commit1399c195ef5009bf44a41649da4718f6e67c0bff (patch)
treee3110135db8be1c1057b03520c3c42f734a77be8 /arch/sh/kernel/cpu/sh4a/setup-sh7763.c
parent356af68bf483e4564f75a35287a8f5f39d31041f (diff)
sh: Switch to new style TMU device
The TMU (Timer Unit) driver implements a new style of platform data that handles the timer as a single device with multiple channel. Switch from the old-style platform data to the new-style platform data. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7763.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7763.c154
1 files changed, 12 insertions, 142 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 5eebbd7f4c21..5a47d670ddec 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -158,25 +158,18 @@ static struct platform_device usbf_device = {
158}; 158};
159 159
160static struct sh_timer_config tmu0_platform_data = { 160static struct sh_timer_config tmu0_platform_data = {
161 .channel_offset = 0x04, 161 .channels_mask = 7,
162 .timer_bit = 0,
163 .clockevent_rating = 200,
164}; 162};
165 163
166static struct resource tmu0_resources[] = { 164static struct resource tmu0_resources[] = {
167 [0] = { 165 DEFINE_RES_MEM(0xffd80000, 0x30),
168 .start = 0xffd80008, 166 DEFINE_RES_IRQ(evt2irq(0x580)),
169 .end = 0xffd80013, 167 DEFINE_RES_IRQ(evt2irq(0x5a0)),
170 .flags = IORESOURCE_MEM, 168 DEFINE_RES_IRQ(evt2irq(0x5c0)),
171 },
172 [1] = {
173 .start = evt2irq(0x580),
174 .flags = IORESOURCE_IRQ,
175 },
176}; 169};
177 170
178static struct platform_device tmu0_device = { 171static struct platform_device tmu0_device = {
179 .name = "sh_tmu", 172 .name = "sh-tmu",
180 .id = 0, 173 .id = 0,
181 .dev = { 174 .dev = {
182 .platform_data = &tmu0_platform_data, 175 .platform_data = &tmu0_platform_data,
@@ -186,25 +179,18 @@ static struct platform_device tmu0_device = {
186}; 179};
187 180
188static struct sh_timer_config tmu1_platform_data = { 181static struct sh_timer_config tmu1_platform_data = {
189 .channel_offset = 0x10, 182 .channels_mask = 7,
190 .timer_bit = 1,
191 .clocksource_rating = 200,
192}; 183};
193 184
194static struct resource tmu1_resources[] = { 185static struct resource tmu1_resources[] = {
195 [0] = { 186 DEFINE_RES_MEM(0xffd88000, 0x2c),
196 .start = 0xffd80014, 187 DEFINE_RES_IRQ(evt2irq(0xe00)),
197 .end = 0xffd8001f, 188 DEFINE_RES_IRQ(evt2irq(0xe20)),
198 .flags = IORESOURCE_MEM, 189 DEFINE_RES_IRQ(evt2irq(0xe40)),
199 },
200 [1] = {
201 .start = evt2irq(0x5a0),
202 .flags = IORESOURCE_IRQ,
203 },
204}; 190};
205 191
206static struct platform_device tmu1_device = { 192static struct platform_device tmu1_device = {
207 .name = "sh_tmu", 193 .name = "sh-tmu",
208 .id = 1, 194 .id = 1,
209 .dev = { 195 .dev = {
210 .platform_data = &tmu1_platform_data, 196 .platform_data = &tmu1_platform_data,
@@ -213,124 +199,12 @@ static struct platform_device tmu1_device = {
213 .num_resources = ARRAY_SIZE(tmu1_resources), 199 .num_resources = ARRAY_SIZE(tmu1_resources),
214}; 200};
215 201
216static struct sh_timer_config tmu2_platform_data = {
217 .channel_offset = 0x1c,
218 .timer_bit = 2,
219};
220
221static struct resource tmu2_resources[] = {
222 [0] = {
223 .start = 0xffd80020,
224 .end = 0xffd8002f,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .start = evt2irq(0x5c0),
229 .flags = IORESOURCE_IRQ,
230 },
231};
232
233static struct platform_device tmu2_device = {
234 .name = "sh_tmu",
235 .id = 2,
236 .dev = {
237 .platform_data = &tmu2_platform_data,
238 },
239 .resource = tmu2_resources,
240 .num_resources = ARRAY_SIZE(tmu2_resources),
241};
242
243static struct sh_timer_config tmu3_platform_data = {
244 .channel_offset = 0x04,
245 .timer_bit = 0,
246};
247
248static struct resource tmu3_resources[] = {
249 [0] = {
250 .start = 0xffd88008,
251 .end = 0xffd88013,
252 .flags = IORESOURCE_MEM,
253 },
254 [1] = {
255 .start = evt2irq(0xe00),
256 .flags = IORESOURCE_IRQ,
257 },
258};
259
260static struct platform_device tmu3_device = {
261 .name = "sh_tmu",
262 .id = 3,
263 .dev = {
264 .platform_data = &tmu3_platform_data,
265 },
266 .resource = tmu3_resources,
267 .num_resources = ARRAY_SIZE(tmu3_resources),
268};
269
270static struct sh_timer_config tmu4_platform_data = {
271 .channel_offset = 0x10,
272 .timer_bit = 1,
273};
274
275static struct resource tmu4_resources[] = {
276 [0] = {
277 .start = 0xffd88014,
278 .end = 0xffd8801f,
279 .flags = IORESOURCE_MEM,
280 },
281 [1] = {
282 .start = evt2irq(0xe20),
283 .flags = IORESOURCE_IRQ,
284 },
285};
286
287static struct platform_device tmu4_device = {
288 .name = "sh_tmu",
289 .id = 4,
290 .dev = {
291 .platform_data = &tmu4_platform_data,
292 },
293 .resource = tmu4_resources,
294 .num_resources = ARRAY_SIZE(tmu4_resources),
295};
296
297static struct sh_timer_config tmu5_platform_data = {
298 .channel_offset = 0x1c,
299 .timer_bit = 2,
300};
301
302static struct resource tmu5_resources[] = {
303 [0] = {
304 .start = 0xffd88020,
305 .end = 0xffd8802b,
306 .flags = IORESOURCE_MEM,
307 },
308 [1] = {
309 .start = evt2irq(0xe40),
310 .flags = IORESOURCE_IRQ,
311 },
312};
313
314static struct platform_device tmu5_device = {
315 .name = "sh_tmu",
316 .id = 5,
317 .dev = {
318 .platform_data = &tmu5_platform_data,
319 },
320 .resource = tmu5_resources,
321 .num_resources = ARRAY_SIZE(tmu5_resources),
322};
323
324static struct platform_device *sh7763_devices[] __initdata = { 202static struct platform_device *sh7763_devices[] __initdata = {
325 &scif0_device, 203 &scif0_device,
326 &scif1_device, 204 &scif1_device,
327 &scif2_device, 205 &scif2_device,
328 &tmu0_device, 206 &tmu0_device,
329 &tmu1_device, 207 &tmu1_device,
330 &tmu2_device,
331 &tmu3_device,
332 &tmu4_device,
333 &tmu5_device,
334 &rtc_device, 208 &rtc_device,
335 &usb_ohci_device, 209 &usb_ohci_device,
336 &usbf_device, 210 &usbf_device,
@@ -349,10 +223,6 @@ static struct platform_device *sh7763_early_devices[] __initdata = {
349 &scif2_device, 223 &scif2_device,
350 &tmu0_device, 224 &tmu0_device,
351 &tmu1_device, 225 &tmu1_device,
352 &tmu2_device,
353 &tmu3_device,
354 &tmu4_device,
355 &tmu5_device,
356}; 226};
357 227
358void __init plat_early_device_setup(void) 228void __init plat_early_device_setup(void)