From patchwork Mon Nov 5 03:16:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10667381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1777A18FD for ; Mon, 5 Nov 2018 03:17:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0515A295DE for ; Mon, 5 Nov 2018 03:17:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4D48295EF; Mon, 5 Nov 2018 03:17:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C89C295F9 for ; Mon, 5 Nov 2018 03:17:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727094AbeKEMec (ORCPT ); Mon, 5 Nov 2018 07:34:32 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38288 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728003AbeKEMeb (ORCPT ); Mon, 5 Nov 2018 07:34:31 -0500 Received: by mail-pg1-f193.google.com with SMTP id f8-v6so3537314pgq.5 for ; Sun, 04 Nov 2018 19:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/RyO1nhh4B8uT0hCEIyo5VG0Vz6UKIjRdhaBpX6QFyI=; b=i+Yf8mAQp2Xn6tGSU0Dgbwzd8052cMRAew3IUR/N8ygKcBHARtUgIoeIluN/kjWIP/ mKLr5tVZsVqKQ5bQcAjdcGtdXvJFXebRP6Potr1RQ2SpNEbBTfuy+tyWjhwBaKPIEf1N fyfcXuwtjUu1gSdxwmAFGsHDSCrBi2BmyOie4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/RyO1nhh4B8uT0hCEIyo5VG0Vz6UKIjRdhaBpX6QFyI=; b=HspM4tWbZYdBPuPYjN1dI3dPrOXAgeqPWR8M0iQc1nNTSfNnFa5bIv6xTGkvif4B4T QmFKOslDNV/aCKe1KHMs0B9m6+w+wNpWqHUQY2qy8wop7Vl0Zk2t7Qx6mrYasfEvv10j 2GsDA8ObUj8fSaB2/CM9m0KlR9N8zxbiXj9dzyS2OAT2NXH5LmTYzzmrU1iJ/CI2rSH0 3cRdFCEKZXKs9JRYJSCfLfD4r8xarfA6GBiR9LJX1waEbp0ziBR2xVfh3KmJgzB8FIZC RVU+zxw3zdFBMmeUKRx3taMlPbnuAWAHyTF+bz+MSOFuCKcKD5p2k/+6EWeitaFOyMFX Hg4A== X-Gm-Message-State: AGRZ1gJE5ylpv4SdnpCdvgv5oL+oh2OGth5gyNAsUegqgpXTLRZ83Sov AXvs+6vjcO96S5JLhITB/L6eEw== X-Google-Smtp-Source: AJdET5funqarLHOIHMzHLyixrZ8NcKPngSawdEoLO6bicAsulzwH6fLj0UCVofuctur4AszjY6sr1w== X-Received: by 2002:a63:2109:: with SMTP id h9mr18724326pgh.277.1541387823026; Sun, 04 Nov 2018 19:17:03 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id f10-v6sm40182773pgp.72.2018.11.04.19.16.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Nov 2018 19:17:02 -0800 (PST) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Mark Brown , Kishon Vijay Abraham I , Sekhar Nori , Chunyan Zhang Subject: [PATCH RFC 1/3] mmc: sdhci: add support for using external DMA devices Date: Mon, 5 Nov 2018 11:16:48 +0800 Message-Id: <1541387810-24867-2-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541387810-24867-1-git-send-email-zhang.chunyan@linaro.org> References: <1541387810-24867-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some standard SD host controller can support both external dma controllers as well as ADMA in which the controller acts as DMA master. Currently the generic SDHCI code supports ADMA/SDMA integrated into the host controller but does not have any support for external DMA controllers implemented using dmaengine meaning that custom code is needed for any systems that use a generic DMA controller with SDHCI. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/Kconfig | 13 +++++ drivers/mmc/host/sdhci.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++- drivers/mmc/host/sdhci.h | 12 +++++ 3 files changed, 161 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 1b58739..c4745d8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -977,3 +977,16 @@ config MMC_SDHCI_OMAP If you have a controller with this interface, say Y or M here. If unsure, say N. + +config MMC_SDHCI_EXTDMA + bool "Support external DMA in standard SD host controller" + depends on MMC_SDHCI + depends on DMA_ENGINE + help + This is an option for using external DMA device via dmaengine + framework. + + If you have a controller which supports using external DMA device + for data transfer, can say Y. + + If unsure, say N. diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 99bdae5..ffb1d2b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -1309,6 +1310,128 @@ static void sdhci_del_timer(struct sdhci_host *host, struct mmc_request *mrq) del_timer(&host->timer); } +#if IS_ENABLED(CONFIG_MMC_SDHCI_EXTDMA) +static int sdhci_extdma_init_chan(struct sdhci_host *host) +{ + int ret = 0; + struct mmc_host *mmc = host->mmc; + struct sdhci_extdma *dma = &host->extdma; + + dma->tx_chan = dma_request_chan(mmc->parent, "tx"); + if (IS_ERR(dma->tx_chan)) { + ret = PTR_ERR(dma->tx_chan); + dma->tx_chan = NULL; + pr_warn("Failed to request TX DMA channel.\n"); + return ret; + } + + dma->rx_chan = dma_request_chan(mmc->parent, "rx"); + if (IS_ERR(dma->rx_chan)) { + ret = PTR_ERR(dma->rx_chan); + if (ret == -EPROBE_DEFER && dma->tx_chan) + dma_release_channel(dma->tx_chan); + + dma->rx_chan = NULL; + pr_warn("Failed to request RX DMA channel.\n"); + } + + return ret; +} + +static inline struct dma_chan * +sdhci_extdma_get_chan(struct sdhci_extdma *dma, struct mmc_data *data) +{ + return data->flags & MMC_DATA_WRITE ? dma->tx_chan : dma->rx_chan; +} + +static int sdhci_extdma_setup(struct sdhci_host *host, struct mmc_command *cmd) +{ + int ret = 0, i; + struct dma_async_tx_descriptor *desc; + struct mmc_data *data = cmd->data; + struct dma_chan *chan; + struct dma_slave_config cfg; + + if (!host->mapbase) + return -EINVAL; + + cfg.src_addr = host->mapbase + SDHCI_BUFFER; + cfg.dst_addr = host->mapbase + SDHCI_BUFFER; + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; + cfg.src_maxburst = data->blksz / 4; + cfg.dst_maxburst = data->blksz / 4; + + /* Sanity check: all the SG entries must be aligned by block size. */ + for (i = 0; i < data->sg_len; i++) { + if ((data->sg + i)->length % data->blksz) + return -EINVAL; + } + + chan = sdhci_extdma_get_chan(&host->extdma, data); + + ret = dmaengine_slave_config(chan, &cfg); + if (ret) + return ret; + + desc = dmaengine_prep_slave_sg(chan, data->sg, data->sg_len, + mmc_get_dma_dir(data), + DMA_PREP_INTERRUPT | DMA_CTRL_ACK); + if (!desc) + return -EINVAL; + + desc->callback = NULL; + desc->callback_param = NULL; + + dmaengine_submit(desc); + + return 0; +} + +static void sdhci_extdma_prepare_data(struct sdhci_host *host, + struct mmc_command *cmd) +{ + host->flags |= SDHCI_REQ_USE_DMA; + sdhci_prepare_data(host, cmd); + + if (sdhci_extdma_setup(host, cmd)) + dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); +} + +static void sdhci_extdma_pre_transfer(struct sdhci_host *host, + struct mmc_command *cmd) +{ + struct dma_chan *chan = sdhci_extdma_get_chan(&host->extdma, cmd->data); + + if (cmd->opcode != MMC_SET_BLOCK_COUNT) { + sdhci_set_timeout(host, cmd); + dma_async_issue_pending(chan); + } +} +#else +static int sdhci_extdma_init_chan(struct sdhci_host *host) +{ + return 0; +} + +static void sdhci_extdma_prepare_data(struct sdhci_host *host, + struct mmc_command *cmd) +{ + /* If SDHCI_EXTDMA not supported, PIO will be used */ + sdhci_prepare_data(host, cmd); +} + +static void sdhci_extdma_pre_transfer(struct sdhci_host *host, + struct mmc_command *cmd) +{} +#endif + +void sdhci_switch_extdma(struct sdhci_host *host, bool en) +{ + host->use_extdma = en; +} +EXPORT_SYMBOL_GPL(sdhci_switch_extdma); + void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) { int flags; @@ -1355,7 +1478,10 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) host->data_cmd = cmd; } - sdhci_prepare_data(host, cmd); + if (host->use_extdma) + sdhci_extdma_prepare_data(host, cmd); + else + sdhci_prepare_data(host, cmd); sdhci_writel(host, cmd->arg, SDHCI_ARGUMENT); @@ -1397,6 +1523,9 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) timeout += 10 * HZ; sdhci_mod_timer(host, cmd->mrq, timeout); + if (host->use_extdma) + sdhci_extdma_pre_transfer(host, cmd); + sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND); } EXPORT_SYMBOL_GPL(sdhci_send_command); @@ -4133,6 +4262,12 @@ int sdhci_setup_host(struct sdhci_host *host) return ret; } + if (host->use_extdma) { + ret = sdhci_extdma_init_chan(host); + if (ret) + goto unreg; + } + return 0; unreg: diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index b001cf4..2d4a3ba 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -361,6 +361,12 @@ enum sdhci_cookie { COOKIE_MAPPED, /* mapped by sdhci_prepare_data() */ }; +struct sdhci_extdma { + struct sdhci_host *host; + struct dma_chan *rx_chan; + struct dma_chan *tx_chan; +}; + struct sdhci_host { /* Data set by hardware interface driver */ const char *hw_name; /* Hardware bus name */ @@ -475,6 +481,7 @@ struct sdhci_host { int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ + phys_addr_t mapbase; /* physical address base */ char *bounce_buffer; /* For packing SDMA reads/writes */ dma_addr_t bounce_addr; unsigned int bounce_buffer_size; @@ -524,6 +531,7 @@ struct sdhci_host { bool pending_reset; /* Cmd/data reset is pending */ bool irq_wake_enabled; /* IRQ wakeup is enabled */ bool v4_mode; /* Host Version 4 Enable */ + bool use_extdma; struct mmc_request *mrqs_done[SDHCI_MAX_MRQS]; /* Requests done */ struct mmc_command *cmd; /* Current command */ @@ -551,6 +559,9 @@ struct sdhci_host { struct timer_list timer; /* Timer for timeouts */ struct timer_list data_timer; /* Timer for data timeouts */ +#if IS_ENABLED(CONFIG_MMC_SDHCI_EXTDMA) + struct sdhci_extdma extdma; /* support external DMA */ +#endif u32 caps; /* CAPABILITY_0 */ u32 caps1; /* CAPABILITY_1 */ @@ -785,5 +796,6 @@ void sdhci_start_tuning(struct sdhci_host *host); void sdhci_end_tuning(struct sdhci_host *host); void sdhci_reset_tuning(struct sdhci_host *host); void sdhci_send_tuning(struct sdhci_host *host, u32 opcode); +void sdhci_switch_extdma(struct sdhci_host *host, bool en); #endif /* __SDHCI_HW_H */ From patchwork Mon Nov 5 03:16:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10667379 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8047175A for ; Mon, 5 Nov 2018 03:17:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B69B7295DE for ; Mon, 5 Nov 2018 03:17:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6EA2296F7; Mon, 5 Nov 2018 03:17:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F086295FA for ; Mon, 5 Nov 2018 03:17:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbeKEMeg (ORCPT ); Mon, 5 Nov 2018 07:34:36 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:37758 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728003AbeKEMef (ORCPT ); Mon, 5 Nov 2018 07:34:35 -0500 Received: by mail-pl1-f196.google.com with SMTP id p6-v6so3707164pll.4 for ; Sun, 04 Nov 2018 19:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yzwsoUSsA6n9GhAeRE9xmA2fjMci+vdbes/fUzU0UCs=; b=B3ljs4mch/YbPLxq6teeIIcfZpElrfsxLw96UNC8Yrr6yFsKCFzHANFw3fbsTCePIL b+KJCbQP5bUz2g2FCwCZH4NEHBujljf+5K4QpWA2ZHbCkBlm5YOisk/aS18LTOBveBjx f2sKFWhhmk/Xak51D5W4rG43ao222Mi59km9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=yzwsoUSsA6n9GhAeRE9xmA2fjMci+vdbes/fUzU0UCs=; b=KcYnsZHHTEif+ouQn9C5Im84vwrbHJ1SqfsFnZobLfUD6QPhqHHfqg8Tnr2DOXL0rW +r8pZoAyCArJpC3Nq/urAzzu0GYWSTI0+MUqOt8BLePEBEZ7Me4V3DapwG5dlBApPeqx 8vqrcevB6oAIv81A9XLFmCj5KOHXd9y6iTuZ0/RG4ZaiMOrd8yXuSRsX/+wf15IBVDzZ eZZo3FVWpcSr5FeBmySkCPuTNUK30YBKM0+hWrxXwrRF3Uf0RfhhSm3iXk4GEqMawscf nOqhvTsAA2BwdL888xa5y+8cOu9K9cw3oupskKYqyhObDv+0CRozRGUA6jVbVErQA+cl 7r+Q== X-Gm-Message-State: AGRZ1gKRaIhqs8+9Hej2q0LFIYvsxk5fCqYRG4lI8pLlcCHVFMrKySCa nWYm+cwPK1zG8BDE5sc2jBL5eQ== X-Google-Smtp-Source: AJdET5cCA6lFFFVVmeBKuzXK1pCh33eOYofvuGw1nvLRkCowWy+vaMHTge+68zOWD2uvl0vqA4El3w== X-Received: by 2002:a17:902:8d94:: with SMTP id v20-v6mr20757455plo.109.1541387827813; Sun, 04 Nov 2018 19:17:07 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id f10-v6sm40182773pgp.72.2018.11.04.19.17.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Nov 2018 19:17:06 -0800 (PST) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Mark Brown , Kishon Vijay Abraham I , Sekhar Nori , Chunyan Zhang Subject: [PATCH RFC 2/3] mmc: sdhci-omap: Add using external dma Date: Mon, 5 Nov 2018 11:16:49 +0800 Message-Id: <1541387810-24867-3-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541387810-24867-1-git-send-email-zhang.chunyan@linaro.org> References: <1541387810-24867-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sdhci-omap can support both external dma controllers via dmaengine framework as well as ADMA in which the controller acts as DMA master. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci-omap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 88347ce..0a8162c 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -896,6 +896,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) const struct of_device_id *match; struct sdhci_omap_data *data; const struct soc_device_attribute *soc; + struct resource *regs; match = of_match_device(omap_sdhci_match, dev); if (!match) @@ -908,6 +909,10 @@ static int sdhci_omap_probe(struct platform_device *pdev) } offset = data->offset; + regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!regs) + return -ENXIO; + host = sdhci_pltfm_init(pdev, &sdhci_omap_pdata, sizeof(*omap_host)); if (IS_ERR(host)) { @@ -924,6 +929,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) omap_host->timing = MMC_TIMING_LEGACY; omap_host->flags = data->flags; host->ioaddr += offset; + host->mapbase = regs->start; mmc = host->mmc; sdhci_get_of_property(pdev); @@ -991,6 +997,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning; host->mmc_host_ops.enable_sdio_irq = sdhci_omap_enable_sdio_irq; + sdhci_switch_extdma(host, true); ret = sdhci_setup_host(host); if (ret) goto err_put_sync; From patchwork Mon Nov 5 03:16:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10667383 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD8BD175A for ; Mon, 5 Nov 2018 03:17:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB494292E8 for ; Mon, 5 Nov 2018 03:17:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC9EB295EF; Mon, 5 Nov 2018 03:17:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AD97292E8 for ; Mon, 5 Nov 2018 03:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729193AbeKEMek (ORCPT ); Mon, 5 Nov 2018 07:34:40 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41611 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728283AbeKEMej (ORCPT ); Mon, 5 Nov 2018 07:34:39 -0500 Received: by mail-pg1-f196.google.com with SMTP id k13so3531247pga.8 for ; Sun, 04 Nov 2018 19:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MHt2HL1hPxLUZSU8tjk/yq874I7NV4UEGg3K2dqYbuQ=; b=juK4sSuciGH3p7UyCKmk/sHoO1J/IiWYZbwQfBYDWg/eZVH3viQ6O6QnMJ3R+jKcpG vH4ZqO4q0mrMlhqiDAy1JaLbeC9AISX9kQAjKe/pp7WB/CaqQCgS6PngvtcOYLNWLacp QVEUg2kzbiRD/QSTdF8bSFtvq/AGe16kdLzuU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MHt2HL1hPxLUZSU8tjk/yq874I7NV4UEGg3K2dqYbuQ=; b=p5bEmWM3GdlAd2BkOo1HOi1CrHWe76r8tf7e0vu5X18asS6+cikvKZqStxEVleqPrh p0EeusfjM+BbIfwBlo4DoZsRwsi94PKLQugvnYScaaQkFMnhLhc0X0LwWdZzVIigLgJu 9Hk1U2igpoMPhHO6jt0yRp6tUlLOHlkUVM1kZM1aIQmz5Gzo0tJ2GFyDaHsiOMHlN12q bsVJ1dZAGJzWDuTRjieATd7EX28FDEX5qg82IujFMZcHSHd+LUX2NtxwabyXP+rYQxAz bCdbrGHYt4I+aofoFyRb3vYv+z3ygu0rOyvLGRSjuVMdwWEuEIOR8PxyMWZ3dfaKm44f D35A== X-Gm-Message-State: AGRZ1gKAmc0R46jVYdNyATmTBd6zcU8XkngrjN/Sk7ZdfXD30dnBZaKR tZPjFxdpbHx+7VMnKTMKG+/loQ== X-Google-Smtp-Source: AJdET5dlRsdvkPkjUWj6YEWtrhlqOU6vbQaVvURWfABWwImtHKSrnG9Ub3j//hH5sX+bNj/g6ZYjaw== X-Received: by 2002:a65:610e:: with SMTP id z14-v6mr18683200pgu.138.1541387831678; Sun, 04 Nov 2018 19:17:11 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id f10-v6sm40182773pgp.72.2018.11.04.19.17.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Nov 2018 19:17:10 -0800 (PST) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Mark Brown , Kishon Vijay Abraham I , Sekhar Nori , Chunyan Zhang Subject: [PATCH RFC 3/3] dt-bindings: sdhci-omap: Add example for using dmaengine Date: Mon, 5 Nov 2018 11:16:50 +0800 Message-Id: <1541387810-24867-4-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541387810-24867-1-git-send-email-zhang.chunyan@linaro.org> References: <1541387810-24867-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sdhci-omap can support both external dma controllers via dmaengine framework as well as ADMA in which the controller acts as DMA master. Signed-off-by: Chunyan Zhang --- Documentation/devicetree/bindings/mmc/sdhci-omap.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/sdhci-omap.txt b/Documentation/devicetree/bindings/mmc/sdhci-omap.txt index 393848c..c73fd47 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-omap.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-omap.txt @@ -12,6 +12,11 @@ Required properties: "ddr_1_8v-rev11", "ddr_1_8v" or "ddr_3_3v", "hs200_1_8v-rev11", "hs200_1_8v", - pinctrl- : Pinctrl states as described in bindings/pinctrl/pinctrl-bindings.txt +- dmas: List of DMA specifiers with the controller specific format as described + in the generic DMA client binding. A tx and rx specifier is required. +- dma-names: List of DMA request names. These strings correspond 1:1 with the + DMA specifiers listed in dmas. The string naming is to be "rx" + and "tx" for RX and TX DMA requests, respectively. Example: mmc1: mmc@4809c000 { @@ -20,4 +25,6 @@ Example: ti,hwmods = "mmc1"; bus-width = <4>; vmmc-supply = <&vmmc>; /* phandle to regulator node */ + dmas = <&sdma 61 &sdma 62>; + dma-names = "tx", "rx"; };