From patchwork Tue Nov 15 09:35:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Macpaul Lin X-Patchwork-Id: 125717 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 C0EA1B6F76 for ; Tue, 15 Nov 2011 20:35:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 337C1285F1; Tue, 15 Nov 2011 10:35:57 +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 zkUZYiAQukGj; Tue, 15 Nov 2011 10:35:57 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A17E12859F; Tue, 15 Nov 2011 10:35:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6AFEE2859F for ; Tue, 15 Nov 2011 10:35:52 +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 oEdV3prf4wAE for ; Tue, 15 Nov 2011 10:35:51 +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 atces.andestech.com (59-124-160-118.HINET-IP.hinet.net [59.124.160.118]) by theia.denx.de (Postfix) with ESMTP id E91172856C for ; Tue, 15 Nov 2011 10:35:48 +0100 (CET) Received: from ATCPCS06.andestech.com (atcpcs06.andestech.com [10.0.1.236]) by atces.andestech.com (Postfix) with ESMTP id 08ED22E2007D; Tue, 15 Nov 2011 17:35:44 +0800 (CST) Received: from app01.andestech.com ([10.0.4.31]) by ATCPCS06.andestech.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 15 Nov 2011 17:35:43 +0800 From: Macpaul Lin To: adrian.wenl@gmail.com, afleming@freescale.com, afleming@gmail.com, pali.rohar@gmail.com, leiwen@marvell.com, u-boot@lists.denx.de, wd@denx.de Date: Tue, 15 Nov 2011 17:35:39 +0800 Message-Id: <1321349739-15212-1-git-send-email-macpaul@andestech.com> X-Mailer: git-send-email 1.7.3.5 In-Reply-To: References: X-OriginalArrivalTime: 15 Nov 2011 09:35:43.0784 (UTC) FILETIME=[F2446280:01CCA379] Cc: Macpaul Lin Subject: [U-Boot] [PATCH] Revert "mmc: retry the cmd8 to meet 74 clocks requirement in the spec" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This reverts commit 02f3029f1810b99869254d0cf0a71946a008a728. This patch add 3 times retry to CMD8 because the Marvell mmc controller doesn't obey the power ramp up process in the SD specification 6.4.1. (Please refer to figure 6.1 and 6.2 in the specification.) The CMD0 should be send after power ramp up has been finished. However, the Marvell mmc contorller must do power ramp up after the first CMD0 command has been send. This patch also affect existing platforms like Nokia N900 and other platforms. Signed-off-by: Macpaul Lin Acked-by: Lei Wen Acked-by: Stephen Warren Tested-by: Stephen Warren --- drivers/mmc/mmc.c | 16 ++-------------- 1 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 37ce6e8..21665ec 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1190,7 +1190,7 @@ block_dev_desc_t *mmc_get_dev(int dev) int mmc_init(struct mmc *mmc) { - int err, retry = 3; + int err; if (mmc->has_init) return 0; @@ -1213,19 +1213,7 @@ int mmc_init(struct mmc *mmc) mmc->part_num = 0; /* Test for SD version 2 */ - /* - * retry here for 3 times, as for some controller it has dynamic - * clock gating, and only toggle out clk when the first cmd0 send - * out, while some card strictly obey the 74 clocks rule, the interval - * may not be sufficient between the cmd0 and this cmd8, retry to - * fulfil the clock requirement - */ - do { - err = mmc_send_if_cond(mmc); - } while (--retry > 0 && err); - - if (err) - return err; + err = mmc_send_if_cond(mmc); /* Now try to get the SD card's operating condition */ err = sd_send_op_cond(mmc);