mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhaoy <zhaoy@marvell.com>
To: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, nicolas.pitre@linaro.org,
	linux@arm.linux.org.uk, hzhuang1@marvell.com, cxie4@marvell.com,
	leoy@marvell.com
Cc: zhaoy <zhaoy@marvell.com>
Subject: [PATCH 06/13] mmp3:register dma devices for mmp3 platform
Date: Tue, 28 Feb 2012 15:27:38 +0800	[thread overview]
Message-ID: <1330414065-2949-7-git-send-email-zhaoy@marvell.com> (raw)
In-Reply-To: <Y>

	1.register dma device for mmp3 platform

Change-Id: I93675ca4df66c17e08d6d64e3352d5bccf8afa9c
Signed-off-by: zhaoy <zhaoy@marvell.com>
---
 arch/arm/mach-mmp/mmp3.c |   78 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mmp/mmp3.c b/arch/arm/mach-mmp/mmp3.c
index 8ae7d1f..a98c611 100644
--- a/arch/arm/mach-mmp/mmp3.c
+++ b/arch/arm/mach-mmp/mmp3.c
@@ -249,6 +249,80 @@ struct platform_device mmp3_device_asoc_hdmi = {
 	.id		= -1,
 };
 
+static struct resource mmp3_adma_resource[] = {
+	[0] = {
+		.name   = "reg_phys",
+		.start  = 0xc0ffd800,
+		.end    = 0xc0ffd800 + SZ_512 - 1,
+		.flags  = IORESOURCE_MEM,
+	},
+	[1] = {
+		.name   = "adma_irq",
+		.start  = IRQ_MMP3_DMA_SECONDARY(18),
+		.end    = IRQ_MMP3_DMA_SECONDARY(21),
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+struct mmp_tdma_chan_info amda_chan_info[] = {
+	[0] = {
+		.type	  = ADMA1_CH0,
+		.reg_base = 0xc0ffd800,
+	},
+	[1] = {
+		.type	  = ADMA1_CH1,
+		.reg_base = 0xc0ffd804,
+	},
+	[2] = {
+		.type	  = ADMA2_CH0,
+		.reg_base = 0xc0ffd900,
+	},
+	[3] = {
+		.type	  = ADMA2_CH1,
+		.reg_base = 0xc0ffd904,
+	},
+};
+
+struct mmp_tdma_platform_data amda_platform_data = {
+	.nr_ch = 4,
+	.info  = amda_chan_info,
+};
+
+static struct platform_device mmp3_device_adma = {
+	.name		= "mmp-adma",
+	.id		= -1,
+	.num_resources  = ARRAY_SIZE(mmp3_adma_resource),
+	.resource       = mmp3_adma_resource,
+	.dev		= {
+		.platform_data = &amda_platform_data,
+	},
+};
+
+static struct resource mmp3_dmac_resource[] = {
+	[0] = {
+		.name   = "reg_phys",
+		.start  = 0xd4000000,
+		.end    = 0xd4000000 + SZ_1K - 1,
+		.flags  = IORESOURCE_MEM,
+	},
+};
+
+struct pxa_dmac_platform_data dmac_platform_data = {
+	.irq_base = IRQ_MMP3_DMA_BASE,
+	.nr_ch = 16,
+};
+
+static struct platform_device mmp3_device_dmac = {
+	.name           = "pxa-dmac",
+	.id             = -1,
+	.num_resources  = ARRAY_SIZE(mmp3_dmac_resource),
+	.resource       = mmp3_dmac_resource,
+	.dev            = {
+		.platform_data = &dmac_platform_data,
+		.coherent_dma_mask = DMA_BIT_MASK(64),
+	},
+};
+
 static int __init mmp3_init(void)
 {
 	/*
@@ -263,8 +337,8 @@ static int __init mmp3_init(void)
 
 	mmp3_init_gpio();
 
-	pxa_init_dma(IRQ_MMP3_DMA_RIQ, 16);
-	mmp_init_dma(IRQ_MMP3_DMA_RIQ);
+	platform_device_register(&mmp3_device_dmac);
+	platform_device_register(&mmp3_device_adma);
 
 	platform_device_register(&mmp3_device_asoc_sspa1);
 	platform_device_register(&mmp3_device_asoc_platform);
-- 
1.7.0.4


  parent reply	other threads:[~2012-02-28  7:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Y>
2012-02-28  7:27 ` [PATCH 00/13] Enable DMA engine for mmp2 and mmp3 zhaoy
2012-02-28  8:41   ` Haojian Zhuang
2012-02-28  8:49     ` Zhao Ye
2012-02-28  7:27 ` [PATCH 01/13] DMA:define second level irq definition zhaoy
2012-02-28  7:27 ` [PATCH 02/13] dmaengine:open dmac and tdma support zhaoy
2012-02-28  7:27 ` [PATCH 03/13] dmaengine: mmp: add two-channel dma driver zhaoy
2012-02-28  7:27 ` [PATCH 04/13] dmaengine:mmp add peripheral " zhaoy
2012-02-28  7:27 ` [PATCH 05/13] mmp2:register dma devices for mmp2 platform zhaoy
2012-02-28  7:27 ` zhaoy [this message]
2012-02-28  7:27 ` [PATCH 07/13] DMA:mmp:remove redundant dma drivers zhaoy
2012-02-28 12:30   ` Sergei Shtylyov
2012-02-28  7:27 ` [PATCH 08/13] DMAC:tty serial pxa use generic dma engine APIs zhaoy
2012-02-28  7:27 ` [PATCH 09/13] DMA:remove unnecessary dma configurations zhaoy
2012-02-28  7:27 ` [PATCH 10/13] dmaengine:audio:mmp audio use generic dma engine APIs zhaoy
2012-02-28  7:27 ` [PATCH 11/13] DMA:update defconfig for mmp3 zhaoy
2012-02-28  7:27 ` [PATCH 12/13] mdma:dmaengine:update mdma for tdma zhaoy
2012-02-28  7:27 ` [PATCH 13/13] DMA:update defconfig for mmp2 zhaoy
2012-02-28  7:42   ` Zhao Ye

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=1330414065-2949-7-git-send-email-zhaoy@marvell.com \
    --to=zhaoy@marvell.com \
    --cc=cxie4@marvell.com \
    --cc=hzhuang1@marvell.com \
    --cc=leoy@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nicolas.pitre@linaro.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

all inboxes | Powered by JetHome®