[PATCH v2] mmc: dw_mmc: Add external dma interface support

Heiko Stübner heiko at sntech.de
Mon Aug 3 04:17:25 PDT 2015


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 <shawn.lin at rock-chips.com>
> 
> ---
> 
> 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.


Heiko




More information about the Linux-rockchip mailing list