aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-04-12 21:15:56 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-04-12 21:15:56 -0400
commit050d4cc7029b73997d6821d89487b1f777d4873c (patch)
tree36cb245d9eb06edc4d36d34ed59a1b35cf353353 /arch/sh/kernel/cpu/sh4a/setup-sh7786.c
parent99dc5c0ca953fb154a3c75ebc6801e0a3c2fe3fe (diff)
sh: dmaengine support for SH7786 DMAC0.
Hook up DMAC0 on SH7786. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-sh7786.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c82
1 files changed, 81 insertions, 1 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index f5599907ac3d..61e549190873 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SH7786 Setup 2 * SH7786 Setup
3 * 3 *
4 * Copyright (C) 2009 Renesas Solutions Corp. 4 * Copyright (C) 2009 - 2010 Renesas Solutions Corp.
5 * Kuninori Morimoto <morimoto.kuninori@renesas.com> 5 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
6 * Paul Mundt <paul.mundt@renesas.com> 6 * Paul Mundt <paul.mundt@renesas.com>
7 * 7 *
@@ -21,7 +21,9 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
23#include <linux/sh_timer.h> 23#include <linux/sh_timer.h>
24#include <cpu/dma-register.h>
24#include <asm/mmzone.h> 25#include <asm/mmzone.h>
26#include <asm/dmaengine.h>
25 27
26static struct plat_sci_port scif0_platform_data = { 28static struct plat_sci_port scif0_platform_data = {
27 .mapbase = 0xffea0000, 29 .mapbase = 0xffea0000,
@@ -442,6 +444,83 @@ static struct platform_device tmu11_device = {
442 .num_resources = ARRAY_SIZE(tmu11_resources), 444 .num_resources = ARRAY_SIZE(tmu11_resources),
443}; 445};
444 446
447static struct sh_dmae_channel dmac0_channels[] = {
448 {
449 .offset = 0,
450 .dmars = 0,
451 .dmars_bit = 0,
452 }, {
453 .offset = 0x10,
454 .dmars = 0,
455 .dmars_bit = 8,
456 }, {
457 .offset = 0x20,
458 .dmars = 4,
459 .dmars_bit = 0,
460 }, {
461 .offset = 0x30,
462 .dmars = 4,
463 .dmars_bit = 8,
464 }, {
465 .offset = 0x50,
466 .dmars = 8,
467 .dmars_bit = 0,
468 }, {
469 .offset = 0x60,
470 .dmars = 8,
471 .dmars_bit = 8,
472 }
473};
474
475static unsigned int ts_shift[] = TS_SHIFT;
476
477static struct sh_dmae_pdata dma0_platform_data = {
478 .channel = dmac0_channels,
479 .channel_num = ARRAY_SIZE(dmac0_channels),
480 .ts_low_shift = CHCR_TS_LOW_SHIFT,
481 .ts_low_mask = CHCR_TS_LOW_MASK,
482 .ts_high_shift = CHCR_TS_HIGH_SHIFT,
483 .ts_high_mask = CHCR_TS_HIGH_MASK,
484 .ts_shift = ts_shift,
485 .ts_shift_num = ARRAY_SIZE(ts_shift),
486 .dmaor_init = DMAOR_INIT,
487};
488
489/* Resource order important! */
490static struct resource dmac0_resources[] = {
491 {
492 /* Channel registers and DMAOR */
493 .start = 0xfe008020,
494 .end = 0xfe00808f,
495 .flags = IORESOURCE_MEM,
496 }, {
497 /* DMARSx */
498 .start = 0xfe009000,
499 .end = 0xfe00900b,
500 .flags = IORESOURCE_MEM,
501 }, {
502 /* DMA error IRQ */
503 .start = evt2irq(0x5c0),
504 .end = evt2irq(0x5c0),
505 .flags = IORESOURCE_IRQ,
506 }, {
507 /* IRQ for channels 0-5 */
508 .start = evt2irq(0x500),
509 .end = evt2irq(0x5a0),
510 .flags = IORESOURCE_IRQ,
511 },
512};
513
514static struct platform_device dma0_device = {
515 .name = "sh-dma-engine",
516 .id = 0,
517 .resource = dmac0_resources,
518 .num_resources = ARRAY_SIZE(dmac0_resources),
519 .dev = {
520 .platform_data = &dma0_platform_data,
521 },
522};
523
445static struct resource usb_ohci_resources[] = { 524static struct resource usb_ohci_resources[] = {
446 [0] = { 525 [0] = {
447 .start = 0xffe70400, 526 .start = 0xffe70400,
@@ -489,6 +568,7 @@ static struct platform_device *sh7786_early_devices[] __initdata = {
489}; 568};
490 569
491static struct platform_device *sh7786_devices[] __initdata = { 570static struct platform_device *sh7786_devices[] __initdata = {
571 &dma0_device,
492 &usb_ohci_device, 572 &usb_ohci_device,
493}; 573};
494 574