From: Faiz Abbas <faiz_abbas@ti.com>
To: Chunyan Zhang <zhang.chunyan@linaro.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>, Mark Brown <broonie@kernel.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
Sekhar Nori <nsekhar@ti.com>,
Chunyan Zhang <zhang.lyra@gmail.com>
Subject: Re: [PATCH V3 1/3] mmc: sdhci: add support for using external DMA devices
Date: Tue, 4 Dec 2018 16:11:14 +0530 [thread overview]
Message-ID: <5167ffb5-77f8-ab66-2eca-602df5f4e3e8@ti.com> (raw)
In-Reply-To: <1543908270-13953-2-git-send-email-zhang.chunyan@linaro.org>
Hi,
On 04/12/18 12:54 PM, Chunyan Zhang wrote:
> Some standard SD host controllers can support both external dma
> controllers as well as ADMA/SDMA in which the SD host controller
> acts as DMA master. TI's omap controller is the case as an example.
>
> Currently the generic SDHCI code supports ADMA/SDMA integrated in
> 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 an external DMA controller with SDHCI.
>
...
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index b001cf4..8e50a97 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -475,6 +475,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 +525,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_external_dma;
>
> struct mmc_request *mrqs_done[SDHCI_MAX_MRQS]; /* Requests done */
> struct mmc_command *cmd; /* Current command */
> @@ -552,6 +554,11 @@ 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_EXTERNAL_DMA)
> + struct dma_chan *rx_chan;
> + struct dma_chan *tx_chan;
> +#endif
> +
> u32 caps; /* CAPABILITY_0 */
> u32 caps1; /* CAPABILITY_1 */
> bool read_caps; /* Capability flags have been read */
> @@ -785,5 +792,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_external_dma(struct sdhci_host *host, bool en);
>
Can you also add a new attribute in sdhci_host->flags for external dma
in this file? The log still shows
[ 3.675028] mmc2: SDHCI controller on 4809c000.mmc [4809c000.mmc]
using ADMA
when using external dma.
Thanks,
Faiz
next prev parent reply other threads:[~2018-12-04 10:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-04 7:24 [PATCH V3 0/3] Add support for using external dma in SDHCI Chunyan Zhang
2018-12-04 7:24 ` [PATCH V3 1/3] mmc: sdhci: add support for using external DMA devices Chunyan Zhang
2018-12-04 10:41 ` Faiz Abbas [this message]
2018-12-06 6:18 ` Chunyan Zhang
2018-12-04 7:24 ` [PATCH V3 2/3] mmc: sdhci-omap: Add using external dma Chunyan Zhang
2018-12-04 7:24 ` [PATCH V3 3/3] dt-bindings: sdhci-omap: Add example for " Chunyan Zhang
2018-12-04 10:36 ` [PATCH V3 0/3] Add support for using external dma in SDHCI Faiz Abbas
-- strict thread matches above, loose matches on Subject: below --
2018-11-12 7:26 [PATCH v2 1/3] mmc: sdhci: add support for using external DMA devices Chunyan Zhang
2018-11-29 6:07 ` [PATCH V3 " Chunyan Zhang
2018-11-29 9:23 ` Adrian Hunter
2018-11-29 9:44 ` Chunyan Zhang
2018-11-29 10:39 ` Adrian Hunter
2018-11-29 10:46 ` Chunyan Zhang
2018-12-03 9:03 ` Faiz Abbas
2018-12-03 10:46 ` Chunyan Zhang
2018-12-03 12:15 ` Faiz Abbas
2018-12-03 13:58 ` Faiz Abbas
2018-12-04 3:11 ` Chunyan Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5167ffb5-77f8-ab66-2eca-602df5f4e3e8@ti.com \
--to=faiz_abbas@ti.com \
--cc=adrian.hunter@intel.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=ulf.hansson@linaro.org \
--cc=zhang.chunyan@linaro.org \
--cc=zhang.lyra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®