From patchwork Fri Sep 2 15:13:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1122552 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p82FDk7s026184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 2 Sep 2011 15:14:07 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QzVRC-0000z4-3b; Fri, 02 Sep 2011 15:13:46 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1QzVRA-0000yv-RU for spi-devel-general@lists.sourceforge.net; Fri, 02 Sep 2011 15:13:44 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of srs.kundenserver.de designates 212.227.17.8 as permitted sender) client-ip=212.227.17.8; envelope-from=SRS0=hUIY=3T=gmx.de=g.liakhovetski@srs.kundenserver.de; helo=moutng.kundenserver.de; Received: from moutng.kundenserver.de ([212.227.17.8]) by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1QzVR8-0005a2-9x for spi-devel-general@lists.sourceforge.net; Fri, 02 Sep 2011 15:13:44 +0000 Received: from axis700.grange (dslb-188-109-038-002.pools.arcor-ip.net [188.109.38.2]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0LwjiG-1REehz44vw-016Jcg; Fri, 02 Sep 2011 17:13:36 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 42564189B83; Fri, 2 Sep 2011 17:13:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 3F49B189B6F; Fri, 2 Sep 2011 17:13:35 +0200 (CEST) Date: Fri, 2 Sep 2011 17:13:35 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: spi-devel-general@lists.sourceforge.net Subject: [PATCH 2/2] sh: use DMA with MSIOF SPI on the sh7724 ecovec board In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:a0+QI2FO9vPvw9dxGDTYcstVy1iiZxK4ujw8RqeO830 IOoOV+pPLvCdPT/Q7UrvwLhg/GRYcnl69oM/h/Q1R17U6OrbAW l0JntqMpOytrs0a5/4tUQHdbXkzD/URneru1yE/5pEJLOLC6se H3jVDIOfxmxu90QXm0X9lTQDJqclYBtSWkkpBGF6KIpNip+DR7 qJrI0sE7ic6uLF1mHwv9oVj1ee1wdJ4kWXc4NOPxdt6W5zz58b Lljmc56kObnphGIAEND5/P/9v4OHv4Tm2jiN5X5TokWwWdYiR9 0WTqf5+88ds0vE0NruKHY8zpUEUI0BNcjKfUKPhCBIu5qh2ioA wbd8MDu4zmJWMh9aghHdaQ7Y920cMEc7t9cA6S0hdqLLs+pD47 dSgI0vlMNhy3Q== X-Spam-Score: -2.0 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (g.liakhovetski[at]gmx.de) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.8 listed in list.dnswl.org] 0.0 T_TO_NO_BRKTS_FREEMAIL To: misformatted and free email service -0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1QzVR8-0005a2-9x Cc: linux-sh@vger.kernel.org X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 02 Sep 2011 15:14:07 +0000 (UTC) On ecovec MSIOF0 is connected to an SD/MMC slot, this patch adds DMA support on it. Signed-off-by: Guennadi Liakhovetski --- 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 #include +#include #include #include #include @@ -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, }, };