From patchwork Sun Aug 26 20:20:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hein_Tibosch X-Patchwork-Id: 1375901 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 08A753FC71 for ; Sun, 26 Aug 2012 22:25:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753248Ab2HZWZL (ORCPT ); Sun, 26 Aug 2012 18:25:11 -0400 Received: from bosmailout14.eigbox.net ([66.96.185.14]:55800 "EHLO bosmailout14.eigbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753122Ab2HZWZK (ORCPT ); Sun, 26 Aug 2012 18:25:10 -0400 X-Greylist: delayed 2397 seconds by postgrey-1.27 at vger.kernel.org; Sun, 26 Aug 2012 18:25:10 EDT Received: from bosmailscan04.eigbox.net ([10.20.15.4]) by bosmailout14.eigbox.net with esmtp (Exim) id 1T5kdr-0008Cg-N9 for linux-mmc@vger.kernel.org; Sun, 26 Aug 2012 17:45:11 -0400 Received: from bosimpout02.eigbox.net ([10.20.55.2]) by bosmailscan04.eigbox.net with esmtp (Exim) id 1T5kdq-0001mE-8P; Sun, 26 Aug 2012 17:45:10 -0400 Received: from bosauthsmtp12.eigbox.net ([10.20.18.12]) by bosimpout02.eigbox.net with NO UCE id rZlA1j0020FdZ9W01ZlALl; Sun, 26 Aug 2012 17:45:10 -0400 X-Authority-Analysis: v=2.0 cv=AakG6QrG c=1 sm=1 a=OWwsRfqG41DA94+gJvZMBg==:17 a=bc2JKO6qiGsA:10 a=kfTud4QeKxsA:10 a=3-UKvDXXhM4A:10 a=8nJEP1OIZ-IA:10 a=WqMAmeBqeH0A:10 a=bJ0fqD8TFZgqkSadqForXVIPBlU=:19 a=hBfLXBz9pcIcUwb2wwoA:9 a=wPNLvfGTeEIA:10 a=wx0GOVZTcu8EuaXTIXj3VQ==:117 X-EN-OrigOutIP: 10.20.18.12 X-EN-IMPSID: rZlA1j0020FdZ9W01ZlALl Received: from [114.79.63.241] (helo=[10.253.148.240]) by bosauthsmtp12.eigbox.net with esmtpa (Exim) id 1T5kdp-0005H1-72; Sun, 26 Aug 2012 17:45:10 -0400 Message-ID: <503A852B.8010902@yahoo.es> Date: Mon, 27 Aug 2012 04:20:59 +0800 From: Hein Tibosch User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Nicolas Ferre , "ludovic.desroches" CC: egtvedt@samfundet.no, Havard Skinnemoen , "linux-mmc@vger.kernel.org" , linux-arm-kernel@lists.infradead.org, Chris Ball Subject: [PATCH 1/2] mmc: atmel-mci: DMA can be used with other controller X-EN-UserInfo: 3946c951b80c12a8be5482963a0b1232:e0ae43bc192b431f8b69f09a37527cbc X-EN-AuthUser: hein@htibosch.net X-EN-OrigIP: 114.79.63.241 X-EN-OrigHost: unknown Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org After the latest changes to atmel-mci, it could not be used with DMA on the AVR32 platform. This patch will allow to use DMA again and it will avoid access to MCI register ATMCI_DMA. Signed-off-by: Hein Tibosch --- drivers/mmc/host/atmel-mci.c | 21 +++++++++------------ 1 files changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index f2c115e..66e9fdc 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -71,7 +71,7 @@ enum atmci_pdc_buf { }; struct atmel_mci_caps { - bool has_dma; + bool has_dma_conf_reg; bool has_pdc; bool has_cfg_reg; bool has_cstor_reg; @@ -411,7 +411,7 @@ static int atmci_regs_show(struct seq_file *s, void *v) atmci_show_status_reg(s, "SR", buf[ATMCI_SR / 4]); atmci_show_status_reg(s, "IMR", buf[ATMCI_IMR / 4]); - if (host->caps.has_dma) { + if (host->caps.has_dma_conf_reg) { u32 val; val = buf[ATMCI_DMA / 4]; @@ -767,7 +767,7 @@ static void atmci_dma_complete(void *arg) dev_vdbg(&host->pdev->dev, "DMA complete\n"); - if (host->caps.has_dma) + if (host->caps.has_dma_conf_reg) /* Disable DMA hardware handshaking on MCI */ atmci_writel(host, ATMCI_DMA, atmci_readl(host, ATMCI_DMA) & ~ATMCI_DMAEN); @@ -954,7 +954,9 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) maxburst = atmci_convert_chksize(host->dma_conf.dst_maxburst); } - atmci_writel(host, ATMCI_DMA, ATMCI_DMA_CHKSIZE(maxburst) | ATMCI_DMAEN); + if (host->caps.has_dma_conf_reg) + atmci_writel(host, ATMCI_DMA, ATMCI_DMA_CHKSIZE(maxburst) | + ATMCI_DMAEN); sglen = dma_map_sg(chan->device->dev, data->sg, data->sg_len, direction); @@ -2202,7 +2204,7 @@ static void __init atmci_get_cap(struct atmel_mci *host) dev_info(&host->pdev->dev, "version: 0x%x\n", version); - host->caps.has_dma = 0; + host->caps.has_dma_conf_reg = 0; host->caps.has_pdc = 1; host->caps.has_cfg_reg = 0; host->caps.has_cstor_reg = 0; @@ -2219,12 +2221,7 @@ static void __init atmci_get_cap(struct atmel_mci *host) host->caps.has_odd_clk_div = 1; case 0x400: case 0x300: -#ifdef CONFIG_AT_HDMAC - host->caps.has_dma = 1; -#else - dev_info(&host->pdev->dev, - "has dma capability but dma engine is not selected, then use pio\n"); -#endif + host->caps.has_dma_conf_reg = 1; host->caps.has_pdc = 0; host->caps.has_cfg_reg = 1; host->caps.has_cstor_reg = 1; @@ -2298,7 +2295,7 @@ static int __init atmci_probe(struct platform_device *pdev) /* Get MCI capabilities and set operations according to it */ atmci_get_cap(host); - if (host->caps.has_dma && atmci_configure_dma(host)) { + if (atmci_configure_dma(host)) { host->prepare_data = &atmci_prepare_data_dma; host->submit_data = &atmci_submit_data_dma; host->stop_transfer = &atmci_stop_transfer_dma;