From patchwork Thu Jun 30 11:50:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Majewski?= X-Patchwork-Id: 102747 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 4A758B6F57 for ; Thu, 30 Jun 2011 22:00:36 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 462912818D; Thu, 30 Jun 2011 14:00:34 +0200 (CEST) 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 kd1C6bOdAM60; Thu, 30 Jun 2011 14:00:34 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B26E2818E; Thu, 30 Jun 2011 14:00:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C8C1F2818E for ; Thu, 30 Jun 2011 14:00:29 +0200 (CEST) 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 34UKP07qHQ4L for ; Thu, 30 Jun 2011 14:00:28 +0200 (CEST) X-Greylist: delayed 602 seconds by postgrey-1.27 at theia; Thu, 30 Jun 2011 14:00:26 CEST 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 mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by theia.denx.de (Postfix) with ESMTP id 4DC372818D for ; Thu, 30 Jun 2011 14:00:26 +0200 (CEST) Received: from eu_spt1 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0LNL00GQ9Q7XP7@mailout1.w1.samsung.com> for u-boot@lists.denx.de; Thu, 30 Jun 2011 12:50:21 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LNL00F81Q7WJ2@spt1.w1.samsung.com> for u-boot@lists.denx.de; Thu, 30 Jun 2011 12:50:20 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id CE7A727004B; Thu, 30 Jun 2011 13:50:38 +0200 (CEST) Date: Thu, 30 Jun 2011 13:50:12 +0200 From: Lukasz Majewski To: u-boot@lists.denx.de Message-id: <1309434612-1659-1-git-send-email-l.majewski@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.2.5 Cc: afleming@gmail.com, Minkyu Kang , kyungmin.park@samsung.com, m.szyprowski@samsung.com Subject: [U-Boot] [PATCH] [RFC] Access mode validation for eMMC cards > 2 GiB 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 This patch provides handling of the two way handshake when SEND_OP_COND (CMD1) is send to mmc card. It is necessary to inform eMMC card if the host can work with high capacity cards (Jedec JESD84-A441, point 7.4.3). The extra flag MMC_MODE_HC (high capacity) is added to indicate if the host is capable of handling the high capacity eMMC cards. Since this change is added to the generic mmc framework, then it requires other boards to indicate if their mmc controllers can handle high capacity cards. As it is now - the old behaviour of the framework is preserved. Signed-off-by: Lukasz Majewski --- drivers/mmc/mmc.c | 4 ++++ drivers/mmc/s5p_mmc.c | 2 +- include/mmc.h | 1 + 3 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 21aedba..ac05536 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -449,6 +449,10 @@ int mmc_send_op_cond(struct mmc *mmc) (mmc->voltages & (cmd.response[0] & OCR_VOLTAGE_MASK)) | (cmd.response[0] & OCR_ACCESS_MODE)); + + if (mmc->host_caps & MMC_MODE_HC) + cmd.cmdarg |= OCR_HCS; + cmd.flags = 0; err = mmc_send_cmd(mmc, &cmd, NULL); diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c index 280738f..f136813 100644 --- a/drivers/mmc/s5p_mmc.c +++ b/drivers/mmc/s5p_mmc.c @@ -462,7 +462,7 @@ static int s5p_mmc_initialize(int dev_index, int bus_width) mmc->host_caps = MMC_MODE_8BIT; else mmc->host_caps = MMC_MODE_4BIT; - mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS; + mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_HC; mmc->f_min = 400000; mmc->f_max = 52000000; diff --git a/include/mmc.h b/include/mmc.h index aeacdee..aaf75d1 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -45,6 +45,7 @@ #define MMC_MODE_4BIT 0x100 #define MMC_MODE_8BIT 0x200 #define MMC_MODE_SPI 0x400 +#define MMC_MODE_HC 0x800 #define SD_DATA_4BIT 0x00040000