Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753232AbbHCNXj (ORCPT ); Mon, 3 Aug 2015 09:23:39 -0400 Received: from regular1.263xmail.com ([211.150.99.131]:47932 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288AbbHCNXh (ORCPT ); Mon, 3 Aug 2015 09:23:37 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: jdelvare@suse.de X-SENDER-IP: 220.200.5.169 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v2] mmc: dw_mmc: Add external dma interface support To: =?UTF-8?Q?Heiko_St=c3=bcbner?= , linux-rockchip@lists.infradead.org References: <1438572439-654-1-git-send-email-shawn.lin@rock-chips.com> <2599339.pPeKCdCNNQ@diego> Cc: shawn.lin@rock-chips.com, Ulf Hansson , Jaehoon Chung , Seungwon Jeon , addy ke , Weijun Yang , Kevin Hao , Scott Branden , Andrew Bresticker , Vincent Yang , Stephen Boyd , dianders@chromium.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , Alim Akhtar , linux-mmc@vger.kernel.org, Jean Delvare From: Shawn Lin Message-ID: <55BF6B43.1050105@rock-chips.com> Date: Mon, 3 Aug 2015 21:23:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <2599339.pPeKCdCNNQ@diego> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3250 Lines: 102 On 2015/8/3 19:17, Heiko St?bner wrote: > Hi Shawn, > > Am Montag, 3. August 2015, 11:27:19 schrieb Shawn Lin: >> DesignWare MMC Controller can support two types of DMA >> mode: external dma and internal dma. We get a RK312x platform >> integrated dw_mmc and ARM pl330 dma controller. This patch add >> edmac ops to suuport these platforms. I've tested it on RK312x >> platform with edmac mode and RK3288 platform with idmac mode. >> >> Patch is based on next of git://git.linaro.org/people/ulf.hansson/mmc >> >> Signed-off-by: Shawn Lin >> >> --- >> >> Changes in v2: >> - Fix typo of dev_info msg >> - remove unused dmach from declaration of dw_mci_dma_slave >> >> drivers/mmc/host/Kconfig | 24 +++++- >> drivers/mmc/host/dw_mmc-pltfm.c | 4 + >> drivers/mmc/host/dw_mmc.c | 169 >> ++++++++++++++++++++++++++++++++++++++-- include/linux/mmc/dw_mmc.h | >> 18 ++++- >> 4 files changed, 205 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig >> index 6a0f9c7..2a66b08 100644 >> --- a/drivers/mmc/host/Kconfig >> +++ b/drivers/mmc/host/Kconfig >> @@ -607,16 +607,36 @@ config MMC_DW >> help >> This selects support for the Synopsys DesignWare Mobile Storage IP >> block, this provides host support for SD and MMC interfaces, in both >> - PIO and external DMA modes. >> + PIO, internal DMA mode and external DMA modes. >> + >> +choice >> + prompt "DesignWare MMC transfer mode" >> + depends on MMC_DW >> + >> +config MMC_DW_PIO >> + bool "Use PIO transfers only" >> + help >> + Use PIO to transfer data between memory and the hardware. >> + PIO is slower than DMA as it requires CPU instructions to >> + move the data. This has been the traditional default for >> + the DW MCI driver. >> >> config MMC_DW_IDMAC >> bool "Internal DMAC interface" >> - depends on MMC_DW >> help >> This selects support for the internal DMAC block within the Synopsys >> Designware Mobile Storage IP block. This disables the external DMA >> interface. >> >> +config MMC_DW_EDMAC >> + bool "External DMAC interface" >> + help >> + This selects support for the external DMAC block outside the Synopsys >> + Designware Mobile Storage IP block. This disables the internal DMA >> + interface. >> + >> +endchoice >> + > more a drive-by comment: > > This should definitly not be a "choice". We're in multiplatform times, where > you can have support for a multitude of socs using dw_mmc in one kernel. And > one might want to use pio, one might want to use the internal dma while > another one might want to use the external dma. > > So which dma to use should definitly be decided at runtime and not at compile- > time. Thanks for comment, Heiko. Definitly it should be decided at runtime. So more DT-bindings' patches should be ACKed as well if we want to remove all the compile-time transfer mode. Hi, Jaehoon Chung Any suggestion? > > Heiko > > > > -- Shawn Lin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/