All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davide Bonfanti <davide.bonfanti@bticino.it>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v0] davinci, mmc: Added a delay reading ext CSD register
Date: Thu, 29 Nov 2012 12:06:53 +0100	[thread overview]
Message-ID: <20121129110641.GA20110@BT22081> (raw)

Without this additional delay, some eMMC don't negotiate properly bus width
Tested on:
 - Toshiba THGBM2G8D8FBAIB
 - Toshiba THGBM4G4D1HBAR
 - Micron MTFC4GMVEA (the one giving the problem)
 - Hynix H26M64002BNR
 - SanDisk SDIN5E1-32G

Signed-off-by: Davide Bonfanti <davide.bonfanti@bticino.it>
---
 drivers/mmc/davinci_mmc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c
index ee8f261..d5a38a7 100644
--- a/drivers/mmc/davinci_mmc.c
+++ b/drivers/mmc/davinci_mmc.c
@@ -285,8 +285,11 @@ dmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
     */
    if (bytes_left > fifo_bytes)
     dmmc_wait_fifo_status(regs, 0x4a);
-   else if (bytes_left == fifo_bytes)
+   else if (bytes_left == fifo_bytes) {
     dmmc_wait_fifo_status(regs, 0x40);
+    if (cmd->cmdidx == MMC_CMD_SEND_EXT_CSD)
+     udelay(600);
+   }
 
    for (i = 0; bytes_left && (i < fifo_words); i++) {
     cmddata = get_val(&regs->mmcdrr);
-- 
1.7.9.5



Ce message, ainsi que tous les fichiers joints ? ce message,
peuvent contenir des informations sensibles et/ ou confidentielles
ne devant pas ?tre divulgu?es. Si vous n'?tes pas le destinataire
de ce message (ou que vous recevez ce message par erreur), nous
vous remercions de le notifier imm?diatement ? son exp?diteur, et
de d?truire ce message. Toute copie, divulgation, modification,
utilisation ou diffusion, non autoris?e, directe ou indirecte, de
tout ou partie de ce message, est strictement interdite.

This e-mail, and any document attached hereby, may contain
confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any
unauthorized, direct or indirect, copying, disclosure, distribution
or other use of the material or parts thereof is strictly
forbidden.

             reply	other threads:[~2012-11-29 11:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 11:06 Davide Bonfanti [this message]
2012-11-29 17:36 ` [U-Boot] [PATCH v0] davinci, mmc: Added a delay reading ext CSD register Tom Rini
2013-05-06 21:25 ` Andy Fleming

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=20121129110641.GA20110@BT22081 \
    --to=davide.bonfanti@bticino.it \
    --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.