linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: spi-devel-general@lists.sourceforge.net
Cc: linux-sh@vger.kernel.org, Grant Likely <grant.likely@secretlab.ca>
Subject: [PATCH 2/2] sh: use DMA with MSIOF SPI on the sh7724 ecovec board
Date: Fri, 2 Sep 2011 17:13:35 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.1109021712470.4731@axis700.grange> (raw)
In-Reply-To: <Pine.LNX.4.64.1109021706480.4731@axis700.grange>

On ecovec MSIOF0 is connected to an SD/MMC slot, this patch adds DMA
support on it.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/sh/boards/mach-ecovec24/setup.c   |    8 +++++++-
 arch/sh/include/cpu-sh4/cpu/sh7724.h   |    4 ++++
 arch/sh/kernel/cpu/sh4a/setup-sh7724.c |   20 ++++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 22faf2a..16747a8 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -10,6 +10,7 @@
 
 #include <linux/init.h>
 #include <linux/device.h>
+#include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mmcif.h>
@@ -653,6 +654,8 @@ static struct spi_board_info spi_bus[] = {
 /* MSIOF0 */
 static struct sh_msiof_spi_info msiof0_data = {
 	.num_chipselect = 1,
+	.slave_id_tx = SHDMA_SLAVE_MSIOF0_TX,
+	.slave_id_rx = SHDMA_SLAVE_MSIOF0_RX,
 };
 
 static struct resource msiof0_resources[] = {
@@ -668,11 +671,14 @@ static struct resource msiof0_resources[] = {
 	},
 };
 
+u64 msiof0_dmamask = DMA_BIT_MASK(32);
+
 static struct platform_device msiof0_device = {
 	.name		= "spi_sh_msiof",
 	.id		= 0, /* MSIOF0 */
 	.dev = {
-		.platform_data = &msiof0_data,
+		.platform_data	= &msiof0_data,
+		.dma_mask	= &msiof0_dmamask,
 	},
 	.num_resources	= ARRAY_SIZE(msiof0_resources),
 	.resource	= msiof0_resources,
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7724.h b/arch/sh/include/cpu-sh4/cpu/sh7724.h
index cbc47e6..10f9292 100644
--- a/arch/sh/include/cpu-sh4/cpu/sh7724.h
+++ b/arch/sh/include/cpu-sh4/cpu/sh7724.h
@@ -310,6 +310,10 @@ enum {
 	SHDMA_SLAVE_SDHI0_RX,
 	SHDMA_SLAVE_SDHI1_TX,
 	SHDMA_SLAVE_SDHI1_RX,
+	SHDMA_SLAVE_MSIOF0_TX,
+	SHDMA_SLAVE_MSIOF0_RX,
+	SHDMA_SLAVE_MSIOF1_TX,
+	SHDMA_SLAVE_MSIOF1_RX,
 };
 
 extern struct clk sh7724_fsimcka_clk;
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index a37dd72..d6626fe 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -152,6 +152,26 @@ static const struct sh_dmae_slave_config sh7724_dmae_slaves[] = {
 		.addr		= 0x04cf0030,
 		.chcr		= DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
 		.mid_rid	= 0xca,
+	}, {
+		.slave_id	= SHDMA_SLAVE_MSIOF0_TX,
+		.addr		= 0xa4c40050,
+		.chcr		= DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
+		.mid_rid	= 0x51,
+	}, {
+		.slave_id	= SHDMA_SLAVE_MSIOF0_RX,
+		.addr		= 0xa4c40060,
+		.chcr		= DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
+		.mid_rid	= 0x52,
+	}, {
+		.slave_id	= SHDMA_SLAVE_MSIOF1_TX,
+		.addr		= 0xa4c50050,
+		.chcr		= DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
+		.mid_rid	= 0x55,
+	}, {
+		.slave_id	= SHDMA_SLAVE_MSIOF1_RX,
+		.addr		= 0xa4c50060,
+		.chcr		= DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
+		.mid_rid	= 0x56,
 	},
 };
 
-- 
1.7.2.5


      parent reply	other threads:[~2011-09-02 15:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 15:13 [PATCH 0/2] SPI: spi-sh-msiof: add DMA support Guennadi Liakhovetski
2011-09-02 15:13 ` [PATCH 1/2] SPI: spi_sh_msiof: implement " Guennadi Liakhovetski
2011-09-05  4:59   ` Paul Mundt
2011-09-05  7:26     ` Guennadi Liakhovetski
2011-09-06 22:16       ` Magnus Damm
2011-09-12  9:27   ` [PATCH 0/2 v2] spi: MSIOF: unbalanced spi_master_put() + DMA Guennadi Liakhovetski
2011-09-12  9:27     ` [PATCH 1/2 v2] SPI: spi-sh-msiof: remove unbalanced spi_master_put() Guennadi Liakhovetski
2011-09-12  9:27     ` [PATCH 2/2 v2] SPI: spi_sh_msiof: implement DMA support Guennadi Liakhovetski
2011-09-02 15:13 ` Guennadi Liakhovetski [this message]

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=Pine.LNX.4.64.1109021712470.4731@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-sh@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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).