From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 05 Aug 2015 10:49:50 +0200 (CEST) Received: from gloria.sntech.de ([95.129.55.99]:37743 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27008877AbbHEItrsDdZu (ORCPT ); Wed, 5 Aug 2015 10:49:47 +0200 Received: from [95.91.148.129] (helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ZMuO7-0007ZV-5D; Wed, 05 Aug 2015 10:49:27 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Shawn Lin Cc: Ulf Hansson , Jaehoon Chung , Seungwon Jeon , dianders@chromium.org, linux-mips@linux-mips.org, Arnd Bergmann , Alexandre Belloni , Alexey Brodkin , Stefan Agner , Zhou Wang , Kumar Gala , Alim Akhtar , Ian Campbell , Wang Long , Rob Herring , Chaotian Jing , Lukasz Majewski , Jun Nie , Catalin Marinas , Kevin Hao , Olof Johansson , Ray Jui , Govindraj Raja , linux-samsung-soc@vger.kernel.org, "Rafael J. Wysocki" , Geert Uytterhoeven , Vineet Gupta , Scott Branden , Anand Moon , linux-rockchip@lists.infradead.org, Krzysztof Kozlowski , Tushar Behera , Pawel Moll , Will Deacon , Mischa Jonker , Ralf Baechle , Javier Martinez Canillas , Vincent Yang , Stephen Warren , devicetree@vger.kernel.org, Kukjin Kim , Tomeu Vizoso , Stephen Boyd , Russell King , Joachim Eastwood , Sjoerd Simons , Weijun Yang , Peter Griffin , linux-arm-kernel@lists.infradead.org, addy ke , Uwe Kleine-K?nig , Jean Delvare , Kevin Hilman , Andrew Bresticker , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Zhangfei Gao , Wei Xu , Andreas Faerber , Mark Rutland , Srinivas Kandagatla Subject: Re: [RFC PATCH v3 1/5] mmc: dw_mmc: Add external dma interface support Date: Wed, 05 Aug 2015 10:49:26 +0200 Message-ID: <8177347.dLpRuMxaEU@diego> User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) In-Reply-To: <1438762648-22202-1-git-send-email-shawn.lin@rock-chips.com> References: <1438762614-22154-1-git-send-email-shawn.lin@rock-chips.com> <1438762648-22202-1-git-send-email-shawn.lin@rock-chips.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 48588 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: heiko@sntech.de Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips Am Mittwoch, 5. August 2015, 16:17:28 schrieb Shawn Lin: > DesignWare MMC Controller can supports 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 support these platforms. I've tested it on RK312x > platform with edmac mode and RK3288 platform with idmac mode. > > Signed-off-by: Shawn Lin > > --- [...] > diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h > index 5be9767..6c1c7ea 100644 > --- a/include/linux/mmc/dw_mmc.h > +++ b/include/linux/mmc/dw_mmc.h > @@ -16,6 +16,7 @@ > > #include > #include > +#include > > #define MAX_MCI_SLOTS 2 > > @@ -40,6 +41,17 @@ enum { > > struct mmc_data; > > +enum { > + TRANS_MODE_PIO = 0, > + TRANS_MODE_IDMAC, > + TRANS_MODE_EDMAC > +}; > + > +struct dw_mci_dma_slave { > + struct dma_chan *ch; > + enum dma_transfer_direction direction; > +}; > + > /** > * struct dw_mci - MMC controller state shared between all slots > * @lock: Spinlock protecting the queue and associated data. > @@ -147,17 +159,23 @@ struct dw_mci { > > /* DMA interface members*/ > int use_dma; > + int trans_mode; you're introducing this new trans_mode, but we have "use_dma" already. So you could just define enum { TRANS_DMA_PIO = 0, TRANS_DMA_IDMAC, TRANS_DMA_EDMAC }; and fill use_dma appropriately. "0" is meaning PIO already, which I also did fix up some days ago in "[PATCH] mmc: dw_mmc: fix pio mode when internal dmac is enabled" [0]. Heiko [0] https://lkml.org/lkml/2015/8/3/407 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko =?ISO-8859-1?Q?St=FCbner?= Subject: Re: [RFC PATCH v3 1/5] mmc: dw_mmc: Add external dma interface support Date: Wed, 05 Aug 2015 10:49:26 +0200 Message-ID: <8177347.dLpRuMxaEU@diego> References: <1438762614-22154-1-git-send-email-shawn.lin@rock-chips.com> <1438762648-22202-1-git-send-email-shawn.lin@rock-chips.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <1438762648-22202-1-git-send-email-shawn.lin@rock-chips.com> Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: Shawn Lin Cc: Ulf Hansson , Jaehoon Chung , Seungwon Jeon , dianders@chromium.org, linux-mips@linux-mips.org, Arnd Bergmann , Alexandre Belloni , Alexey Brodkin , Stefan Agner , Zhou Wang , Kumar Gala , Alim Akhtar , Ian Campbell , Wang Long , Rob Herring , Chaotian Jing , Lukasz Majewski , Jun Nie , Catalin Marinas , Kevin Hao , Olof List-Id: linux-mmc@vger.kernel.org Am Mittwoch, 5. August 2015, 16:17:28 schrieb Shawn Lin: > DesignWare MMC Controller can supports 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 support these platforms. I've tested it on RK312x > platform with edmac mode and RK3288 platform with idmac mode. > > Signed-off-by: Shawn Lin > > --- [...] > diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h > index 5be9767..6c1c7ea 100644 > --- a/include/linux/mmc/dw_mmc.h > +++ b/include/linux/mmc/dw_mmc.h > @@ -16,6 +16,7 @@ > > #include > #include > +#include > > #define MAX_MCI_SLOTS 2 > > @@ -40,6 +41,17 @@ enum { > > struct mmc_data; > > +enum { > + TRANS_MODE_PIO = 0, > + TRANS_MODE_IDMAC, > + TRANS_MODE_EDMAC > +}; > + > +struct dw_mci_dma_slave { > + struct dma_chan *ch; > + enum dma_transfer_direction direction; > +}; > + > /** > * struct dw_mci - MMC controller state shared between all slots > * @lock: Spinlock protecting the queue and associated data. > @@ -147,17 +159,23 @@ struct dw_mci { > > /* DMA interface members*/ > int use_dma; > + int trans_mode; you're introducing this new trans_mode, but we have "use_dma" already. So you could just define enum { TRANS_DMA_PIO = 0, TRANS_DMA_IDMAC, TRANS_DMA_EDMAC }; and fill use_dma appropriately. "0" is meaning PIO already, which I also did fix up some days ago in "[PATCH] mmc: dw_mmc: fix pio mode when internal dmac is enabled" [0]. Heiko [0] https://lkml.org/lkml/2015/8/3/407