From patchwork Mon Mar 21 06:03:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Terry Lv X-Patchwork-Id: 87689 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 4E642B6F7E for ; Mon, 21 Mar 2011 16:59:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC9962808B; Mon, 21 Mar 2011 06:59:49 +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 YbyJ8U7FH-Ek; Mon, 21 Mar 2011 06:59:49 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9047128082; Mon, 21 Mar 2011 06:59:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6879A28082 for ; Mon, 21 Mar 2011 06:59:44 +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 1XYBv2hBA3xn for ; Mon, 21 Mar 2011 06:59:43 +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 ch1outboundpool.messaging.microsoft.com (ch1outboundpool.messaging.microsoft.com [216.32.181.182]) by theia.denx.de (Postfix) with ESMTPS id 066CC28080 for ; Mon, 21 Mar 2011 06:59:40 +0100 (CET) Received: from mail132-ch1-R.bigfish.com (216.32.181.172) by CH1EHSOBE012.bigfish.com (10.43.70.62) with Microsoft SMTP Server id 14.1.225.8; Mon, 21 Mar 2011 05:59:39 +0000 Received: from mail132-ch1 (localhost.localdomain [127.0.0.1]) by mail132-ch1-R.bigfish.com (Postfix) with ESMTP id 34CFF1590355 for ; Mon, 21 Mar 2011 05:59:39 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzbb2cKzz1202hzz8275bhz2dh2a8h668h80ak61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail132-ch1 (localhost.localdomain [127.0.0.1]) by mail132-ch1 (MessageSwitch) id 1300687169974697_27100; Mon, 21 Mar 2011 05:59:29 +0000 (UTC) Received: from CH1EHSMHS011.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.240]) by mail132-ch1.bigfish.com (Postfix) with ESMTP id A02BD258078 for ; Mon, 21 Mar 2011 05:58:59 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS011.bigfish.com (10.43.70.11) with Microsoft SMTP Server (TLS) id 14.1.225.8; Mon, 21 Mar 2011 05:58:59 +0000 Received: from de01smr01.freescale.net (10.208.0.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.270.2; Mon, 21 Mar 2011 00:58:51 -0500 Received: from shlinux3.ap.freescale.net (udp145918uds.ap.freescale.net [10.192.225.200]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p2L5wo47009972 for ; Mon, 21 Mar 2011 00:58:51 -0500 (CDT) Received: by shlinux3.ap.freescale.net (Postfix, from userid 1001) id 997013A04A9; Mon, 21 Mar 2011 14:03:40 +0800 (CST) From: Terry Lv To: Date: Mon, 21 Mar 2011 14:03:25 +0800 Message-ID: <1300687405-4078-1-git-send-email-r65388@freescale.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-OriginatorOrg: freescale.net Subject: [U-Boot] [PATCH] MMC may wrongly regconize 2GB eMMC as high capacity 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de MMC driver may wrongly regconize some 2GB eMMC as high capacity card. This patch is based on the patch picked from community. fc8a0985c2846292312556cba10b8a4182f55967 From: Hanumath Prasad Date: Tue, 10 Aug 2010 18:01:45 -0700 Subject: [PATCH] mmc: only set blockaddressed for > 2GiB cards A non-zero value of SEC_COUNT does not indicate that the card is sector addressed. According to the MMC specification, cards with a densitygreater than 2GiB are sector addressed. Signed-off-by: Terry Lv --- drivers/mmc/mmc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 6805b33..6f97911 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -399,7 +399,9 @@ int mmc_change_freq(struct mmc *mmc) if (err) return err; - if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215]) + /* Cards with density > 2GiB are sector addressed */ + if ((ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215]) && + (mmc->capacity > (2u * 1024 * 1024 * 1024) / 512)) mmc->high_capacity = 1; cardtype = ext_csd[196] & 0xf;