From patchwork Thu Nov 29 11:05:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Davide Bonfanti X-Patchwork-Id: 202708 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 87A062C008E for ; Thu, 29 Nov 2012 22:20:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61F604A02F; Thu, 29 Nov 2012 12:20:31 +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 m8eGbaz01cAz; Thu, 29 Nov 2012 12:20:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D1F554A036; Thu, 29 Nov 2012 12:20:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41BD44A0FC for ; Thu, 29 Nov 2012 12:04:54 +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 wqVSgi2caA2Q for ; Thu, 29 Nov 2012 12:04:53 +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 0DE2D4A0F4 for ; Thu, 29 Nov 2012 12:04:51 +0100 (CET) Received: from ([10.31.15.91]) by smtp1.bticino.it with ESMTP id 5RSHRF1.84626235; Thu, 29 Nov 2012 12:04:45 +0100 Received: from localhost ([10.39.10.63]) by notes-mta.srvnts.grpleg.com (Lotus Domino Release 8.5.3FP1) with ESMTP id 2012112912044096-515 ; Thu, 29 Nov 2012 12:04:40 +0100 Date: Thu, 29 Nov 2012 12:05:45 +0100 From: Davide Bonfanti To: u-boot@lists.denx.de Message-ID: <20121129110532.GA19980@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:04:40, Serialize by Router on IT-VAR-HUB-01/SRV/GRPLEG(Release 8.5.3FP1|March 07, 2012) at 29/11/2012 12.04.45, Serialize complete at 29/11/2012 12.04.45 Content-Disposition: inline X-Mailman-Approved-At: Thu, 29 Nov 2012 12:20:27 +0100 Cc: afleming@gmail.com Subject: [U-Boot] [PATCH v0] mmc: forced sector mode when accessing OCR 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 Some eMMC require this setting to work properly. Tested on: - Toshiba THGBM2G8D8FBAIB (the one giving the problem) - Toshiba THGBM4G4D1HBAR - Micron MTFC4GMVEA - Hynix H26M64002BNR - SanDisk SDIN5E1-32G Signed-off-by: Davide Bonfanti --- drivers/mmc/mmc.c | 3 ++- include/mmc.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 5ffd8c5..cf66811 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -530,7 +530,8 @@ static int mmc_send_op_cond(struct mmc *mmc) cmd.cmdarg = (mmc_host_is_spi(mmc) ? 0 : (mmc->voltages & (cmd.response[0] & OCR_VOLTAGE_MASK)) | - (cmd.response[0] & OCR_ACCESS_MODE)); + (cmd.response[0] & OCR_ACCESS_MODE)) | + OCR_ACCESS_SECTOR_MODE; if (mmc->host_caps & MMC_MODE_HC) cmd.cmdarg |= OCR_HCS; diff --git a/include/mmc.h b/include/mmc.h index a13e2bd..f1314d8 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -108,6 +108,7 @@ #define OCR_HCS 0x40000000 #define OCR_VOLTAGE_MASK 0x007FFF80 #define OCR_ACCESS_MODE 0x60000000 +#define OCR_ACCESS_SECTOR_MODE (1 << 30) #define SECURE_ERASE 0x80000000