linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH v2 2/3] sh: add platform_device for SUDMAC in setup-sh7757
Date: Tue, 10 Jan 2012 05:21:15 +0000	[thread overview]
Message-ID: <4F0BCACB.20203@renesas.com> (raw)

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 about v2:
  - No need the .no_error_irq flag.

 arch/sh/include/cpu-sh4/cpu/sh7757.h   |    1 +
 arch/sh/kernel/cpu/sh4a/setup-sh7757.c |   49 ++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/arch/sh/include/cpu-sh4/cpu/sh7757.h b/arch/sh/include/cpu-sh4/cpu/sh7757.h
index 41f9f8b..f9be40a 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7757.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7757.h
@@ -283,5 +283,6 @@ enum {
 	SHDMA_SLAVE_RIIC8_RX,
 	SHDMA_SLAVE_RIIC9_TX,
 	SHDMA_SLAVE_RIIC9_RX,
+	SHDMA_SLAVE_SUDMAC00,
 };
 #endif /* __ASM_SH7757_H__ */
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index a7b2da6..bb9324a 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -650,6 +650,54 @@ static struct platform_device dma3_device = {
 	},
 };

+/* SUDMAC */
+static const struct sh_dmae_channel sh7757_sudmac_channel[] = {
+	{
+		.offset = 0,
+		.dmars = 0,
+		.dmars_bit = 0,
+	}
+};
+
+static const struct sh_dmae_slave_config sh7757_sudmac00_slaves[] = {
+	{
+		.slave_id	= SHDMA_SLAVE_SUDMAC00,
+		.addr		= 0xfe451000,
+	},
+};
+
+static struct sh_dmae_pdata sudmac00_platform_data = {
+	.slave		= sh7757_sudmac00_slaves,
+	.slave_num	= ARRAY_SIZE(sh7757_sudmac00_slaves),
+	.channel	= sh7757_sudmac_channel,
+	.channel_num	= 1,
+	.no_dmars	= 1,
+	.sudmac		= 1,
+};
+
+static struct resource sh7757_sudmac00_resources[] = {
+	[0] = {
+		.start	= 0xfe451000,
+		.end	= 0xfe451000,
+		.flags	= IORESOURCE_MEM,
+	},
+	{
+		.start	= 50,
+		.end	= 50,
+		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
+	},
+};
+
+static struct platform_device sudmac00_device = {
+	.name		= "sh-dma-engine",
+	.id		= 4,
+	.resource	= sh7757_sudmac00_resources,
+	.num_resources	= ARRAY_SIZE(sh7757_sudmac00_resources),
+	.dev		= {
+		.platform_data	= &sudmac00_platform_data,
+	},
+};
+
 static struct platform_device spi0_device = {
 	.name	= "sh_spi",
 	.id	= 0,
@@ -719,6 +767,7 @@ static struct platform_device *sh7757_devices[] __initdata = {
 	&dma1_device,
 	&dma2_device,
 	&dma3_device,
+	&sudmac00_device,
 	&spi0_device,
 	&usb_ehci_device,
 	&usb_ohci_device,
-- 
1.7.1

                 reply	other threads:[~2012-01-10  5:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F0BCACB.20203@renesas.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).