aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-02-11 11:50:10 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-03-01 21:09:02 -0500
commit027811b9b81a6b3ae5aa20c3302897bee9dcf09e (patch)
treecde9b764d10d7ba9d0a41d9c780bf9032214dcae /arch/sh/kernel/cpu/sh4a/setup-sh7780.c
parent47a4dc26eeb89a3746f9b1e2092602b40469640a (diff)
dmaengine: shdma: convert to platform device resources
The shdma dmaengine driver currently uses numerous macros to support various platforms, selected by ifdef's. Convert it to use platform device resources and lists of channel descriptors to specify register locations, interrupt numbers and other system-specific configuration variants. Unavoidably, we have to simultaneously convert all shdma users to provide those resources. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7780.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7780.c113
1 files changed, 107 insertions, 6 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index f8f21618d785..338dfc2c2bb5 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -247,15 +247,115 @@ static struct platform_device rtc_device = {
247 .resource = rtc_resources, 247 .resource = rtc_resources,
248}; 248};
249 249
250static struct sh_dmae_pdata dma_platform_data = { 250/* DMA */
251 .mode = (SHDMA_MIX_IRQ | SHDMA_DMAOR1), 251static struct sh_dmae_channel sh7780_dmae0_channels[] = {
252 {
253 .offset = 0,
254 .dmars = 0,
255 .dmars_bit = 0,
256 }, {
257 .offset = 0x10,
258 .dmars = 0,
259 .dmars_bit = 8,
260 }, {
261 .offset = 0x20,
262 .dmars = 4,
263 .dmars_bit = 0,
264 }, {
265 .offset = 0x30,
266 .dmars = 4,
267 .dmars_bit = 8,
268 }, {
269 .offset = 0x50,
270 .dmars = 8,
271 .dmars_bit = 0,
272 }, {
273 .offset = 0x60,
274 .dmars = 8,
275 .dmars_bit = 8,
276 }
277};
278
279static struct sh_dmae_channel sh7780_dmae1_channels[] = {
280 {
281 .offset = 0,
282 }, {
283 .offset = 0x10,
284 }, {
285 .offset = 0x20,
286 }, {
287 .offset = 0x30,
288 }, {
289 .offset = 0x50,
290 }, {
291 .offset = 0x60,
292 }
293};
294
295static struct sh_dmae_pdata dma0_platform_data = {
296 .channel = sh7780_dmae0_channels,
297 .channel_num = ARRAY_SIZE(sh7780_dmae0_channels),
298};
299
300static struct sh_dmae_pdata dma1_platform_data = {
301 .channel = sh7780_dmae1_channels,
302 .channel_num = ARRAY_SIZE(sh7780_dmae1_channels),
303};
304
305static struct resource sh7780_dmae0_resources[] = {
306 [0] = {
307 /* Channel registers and DMAOR */
308 .start = 0xfc808020,
309 .end = 0xfc80808f,
310 .flags = IORESOURCE_MEM,
311 },
312 [1] = {
313 /* DMARSx */
314 .start = 0xfc809000,
315 .end = 0xfc80900b,
316 .flags = IORESOURCE_MEM,
317 },
318 {
319 /* Real DMA error IRQ is 38, and channel IRQs are 34-37, 44-45 */
320 .start = 34,
321 .end = 34,
322 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
323 },
324};
325
326static struct resource sh7780_dmae1_resources[] = {
327 [0] = {
328 /* Channel registers and DMAOR */
329 .start = 0xfc818020,
330 .end = 0xfc81808f,
331 .flags = IORESOURCE_MEM,
332 },
333 /* DMAC1 has no DMARS */
334 {
335 /* Real DMA error IRQ is 38, and channel IRQs are 46-47, 92-95 */
336 .start = 46,
337 .end = 46,
338 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
339 },
252}; 340};
253 341
254static struct platform_device dma_device = { 342static struct platform_device dma0_device = {
255 .name = "sh-dma-engine", 343 .name = "sh-dma-engine",
256 .id = -1, 344 .id = 0,
345 .resource = sh7780_dmae0_resources,
346 .num_resources = ARRAY_SIZE(sh7780_dmae0_resources),
257 .dev = { 347 .dev = {
258 .platform_data = &dma_platform_data, 348 .platform_data = &dma0_platform_data,
349 },
350};
351
352static struct platform_device dma1_device = {
353 .name = "sh-dma-engine",
354 .id = 1,
355 .resource = sh7780_dmae1_resources,
356 .num_resources = ARRAY_SIZE(sh7780_dmae1_resources),
357 .dev = {
358 .platform_data = &dma1_platform_data,
259 }, 359 },
260}; 360};
261 361
@@ -269,7 +369,8 @@ static struct platform_device *sh7780_devices[] __initdata = {
269 &tmu4_device, 369 &tmu4_device,
270 &tmu5_device, 370 &tmu5_device,
271 &rtc_device, 371 &rtc_device,
272 &dma_device, 372 &dma0_device,
373 &dma1_device,
273}; 374};
274 375
275static int __init sh7780_devices_setup(void) 376static int __init sh7780_devices_setup(void)