linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/3] sh: add platform_device for SUDMAC in setup-sh7757
@ 2012-01-10  5:21 Shimoda, Yoshihiro
  0 siblings, 0 replies; only message in thread
From: Shimoda, Yoshihiro @ 2012-01-10  5:21 UTC (permalink / raw)
  To: linux-sh

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-10  5:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10  5:21 [PATCH v2 2/3] sh: add platform_device for SUDMAC in setup-sh7757 Shimoda, Yoshihiro

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).