From patchwork Wed Mar 23 14:06:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Raffaele Recalcati X-Patchwork-Id: 88083 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 2760DB6F7F for ; Thu, 24 Mar 2011 01:07:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EECA0280C8; Wed, 23 Mar 2011 15:07:02 +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 vEcVNlhan0gY; Wed, 23 Mar 2011 15:07:02 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 37BE7280C0; Wed, 23 Mar 2011 15:07:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B1BA6280C0 for ; Wed, 23 Mar 2011 15:06: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 2LJSCdEU6y99 for ; Wed, 23 Mar 2011 15:06:55 +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 mail-qw0-f44.google.com (mail-qw0-f44.google.com [209.85.216.44]) by theia.denx.de (Postfix) with ESMTPS id 0A3D4280B5 for ; Wed, 23 Mar 2011 15:06:53 +0100 (CET) Received: by qwg5 with SMTP id 5so5576402qwg.3 for ; Wed, 23 Mar 2011 07:06:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.206.42 with SMTP id fs42mr5844770qcb.150.1300889211102; Wed, 23 Mar 2011 07:06:51 -0700 (PDT) Received: by 10.229.99.200 with HTTP; Wed, 23 Mar 2011 07:06:50 -0700 (PDT) In-Reply-To: References: <1300687405-4078-1-git-send-email-r65388@freescale.com> Date: Wed, 23 Mar 2011 15:06:50 +0100 Message-ID: From: Raffaele Recalcati To: Terry Lv Cc: u-boot@lists.denx.de Subject: Re: [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 Hi Terry, > So I guess: > mmc_init calls mmc_send_op_cond  that set  high_capacity, > than it calls mmc_startup, that, with MMC_CMD_SEND_CSD  command, set > the capacity, using values in CSD register. > So I guess that mmc_change_freq should not recalculate high_capacity. > > It seems better, isn't it? > > Regards, > Raffaele > Finally I think that it is enough to apply the following patch in order to fix the issue. Regards, Raffaele diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 3819fcf..1dfbab9 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -538,9 +538,6 @@ int mmc_change_freq(struct mmc *mmc) if (err) return err; - if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215]) - mmc->high_capacity = 1; - cardtype = ext_csd[196] & 0xf; err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);