public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mmc: atmel: Properly fix clock configuration
Date: Thu, 5 Nov 2015 17:38:45 +0100	[thread overview]
Message-ID: <201511051738.45738.marex@denx.de> (raw)
In-Reply-To: <1446735196-23171-2-git-send-email-gregory.clement@free-electrons.com>

On Thursday, November 05, 2015 at 03:53:16 PM, Gregory CLEMENT wrote:
> Timing issue occurs on eMMC not only when modifying the frequency but
> also for all the switch command(CMD6). According to the MMC spec waiting
> 8 clocks after a switch command would be the thing to do.
> 
> This patch allows fixing CPU hang observed when trying to changing the
> bus width on a eMMC on SAMA5D4.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

On DENX MA5D4EVK:

Tested-by: Marek Vasut <marex@denx.de>

[...]

> @@ -284,8 +286,10 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) {
>  				u32 cnt = word_count * 4;
>  				printf("Read Data:\n");
> +				/*
>  				print_buffer(0, data->dest + cnt * block_count,
>  					     1, cnt, 0);
> +				*/

This bit shouldn't be in the patch I guess ;-)

>  			}
>  #endif
>  #ifdef DEBUG
> @@ -323,6 +327,12 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) }
>  	}
> 
> +	/* After the switch command, wait for 8 clocks before the next
> +	 * command
> +	 */

The comment style should match the kernel one -- multilines go like this:
/*
 * foo
 * bar
 */

> +	if (cmd->cmdidx == MMC_CMD_SWITCH)
> +		udelay(8*1000000/ priv->curr_clk); /* 8 clk in us*/
> +
>  	return 0;
>  }

Best regards,
Marek Vasut

  reply	other threads:[~2015-11-05 16:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05 14:53 [U-Boot] [PATCH] Fixing timing issue with eMMC on atmel MCI Gregory CLEMENT
2015-11-05 14:53 ` [U-Boot] [PATCH] mmc: atmel: Properly fix clock configuration Gregory CLEMENT
2015-11-05 16:38   ` Marek Vasut [this message]
2015-11-05 19:56     ` Gregory CLEMENT

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=201511051738.45738.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox