All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/4] MX28: Fix up the MMC driver DMA mode
Date: Wed, 1 Aug 2012 15:11:28 +0200	[thread overview]
Message-ID: <201208011511.29010.marex@denx.de> (raw)
In-Reply-To: <1341645957-28368-1-git-send-email-marex@denx.de>

Bump?

> The DMA mode didn't properly configure the DMA_ENABLE bit in CTRL1
> Also, it was using SSP0 DMA channel for all SSP devices.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Wolfgang Denk <wd@denx.de>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Fabio Estevam <festevam@freescale.com>
> Cc: Andy Fleming <afleming@freescale.com>
> ---
>  drivers/mmc/mxsmmc.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> NOTE: This series is for -next!
> 
> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> index 4187a94..a637db3 100644
> --- a/drivers/mmc/mxsmmc.c
> +++ b/drivers/mmc/mxsmmc.c
> @@ -79,6 +79,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) uint32_t *data_ptr;
>  #else
>  	uint32_t cache_data_count;
> +	int dmach;
>  #endif
> 
>  	debug("MMC%d: CMD%d\n", mmc->block_dev.dev, cmd->cmdidx);
> @@ -201,6 +202,8 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) timeout = MXSMMC_MAX_TIMEOUT;
> 
>  #ifdef CONFIG_MXS_MMC_DMA
> +	writel(SSP_CTRL1_DMA_ENABLE, &ssp_regs->hw_ssp_ctrl1_set);
> +
>  	if (data_count % ARCH_DMA_MINALIGN)
>  		cache_data_count = roundup(data_count, ARCH_DMA_MINALIGN);
>  	else
> @@ -222,8 +225,9 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) (data_count << MXS_DMA_DESC_BYTES_OFFSET);
> 
> 
> -	mxs_dma_desc_append(MXS_DMA_CHANNEL_AHB_APBH_SSP0, priv->desc);
> -	if (mxs_dma_go(MXS_DMA_CHANNEL_AHB_APBH_SSP0)) {
> +	dmach = MXS_DMA_CHANNEL_AHB_APBH_SSP0 + priv->id;
> +	mxs_dma_desc_append(dmach, priv->desc);
> +	if (mxs_dma_go(dmach)) {
>  		printf("MMC%d: DMA transfer failed\n", mmc->block_dev.dev);
>  		return COMM_ERR;
>  	}
> @@ -234,6 +238,8 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) (uint32_t)(priv->desc->cmd.address +
> cache_data_count));
>  	}
>  #else
> +	writel(SSP_CTRL1_DMA_ENABLE, &ssp_regs->hw_ssp_ctrl1_clr);
> +
>  	if (data->flags & MMC_DATA_READ) {
>  		data_ptr = (uint32_t *)data->dest;
>  		while (data_count && --timeout) {

Best regards,
Marek Vasut

  parent reply	other threads:[~2012-08-01 13:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-07  7:25 [U-Boot] [PATCH 1/4] MX28: Fix up the MMC driver DMA mode Marek Vasut
2012-07-07  7:25 ` [U-Boot] [PATCH 2/4] MX28: Split out the PIO and DMA transfer functions Marek Vasut
2012-07-07  7:25 ` [U-Boot] [PATCH 3/4] MX28: Transfer small blocks via PIO in MXS MMC Marek Vasut
2012-07-07  7:25 ` [U-Boot] [PATCH 4/4] MX28: Fix MXS MMC DMA issues Marek Vasut
2012-08-01 13:11 ` Marek Vasut [this message]
2012-08-06 21:23 ` [U-Boot] [PATCH 1/4] MX28: Fix up the MMC driver DMA mode Marek Vasut
2012-08-07  7:33   ` Stefano Babic
2012-08-07 10:03     ` Marek Vasut
2012-08-07  9:32 ` Stefano Babic

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=201208011511.29010.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.