From patchwork Thu Nov 29 11:06:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Bonfanti X-Patchwork-Id: 202709 X-Patchwork-Delegate: afleming@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DD1B62C008E for ; Thu, 29 Nov 2012 22:20:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B5BD24A0BF; Thu, 29 Nov 2012 12:20:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g2Vd7Dnychnq; Thu, 29 Nov 2012 12:20:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CD6104A0F0; Thu, 29 Nov 2012 12:20:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BE1E94A0FC for ; Thu, 29 Nov 2012 12:05:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oNGthqtvgIbN for ; Thu, 29 Nov 2012 12:05:58 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from bticino.it (mx1.bticino.it [91.208.195.90]) by theia.denx.de (Postfix) with ESMTPS id E4F274A0F4 for ; Thu, 29 Nov 2012 12:05:57 +0100 (CET) Received: from ([10.31.15.91]) by smtp1.bticino.it with ESMTP id 5RSHRF1.84626326; Thu, 29 Nov 2012 12:05:53 +0100 Received: from localhost ([10.39.10.63]) by notes-mta.srvnts.grpleg.com (Lotus Domino Release 8.5.3FP1) with ESMTP id 2012112912054894-516 ; Thu, 29 Nov 2012 12:05:48 +0100 Date: Thu, 29 Nov 2012 12:06:53 +0100 From: Davide Bonfanti To: u-boot@lists.denx.de Message-ID: <20121129110641.GA20110@BT22081> MIME-Version: 1.0 X-attached: none User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on NOTES-MTA/BTICINO/IT(Release 8.5.3FP1|March 07, 2012) at 29/11/2012 12:05:49, Serialize by Router on IT-VAR-HUB-01/SRV/GRPLEG(Release 8.5.3FP1|March 07, 2012) at 29/11/2012 12.05.53, Serialize complete at 29/11/2012 12.05.53 Content-Disposition: inline X-Mailman-Approved-At: Thu, 29 Nov 2012 12:20:27 +0100 Cc: trini@ti.com Subject: [U-Boot] [PATCH v0] davinci, mmc: Added a delay reading ext CSD register X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Acked-by: Tom Rini --- 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(®s->mmcdrr);