From patchwork Mon Dec 1 12:59:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabbasov, Andrew" X-Patchwork-Id: 416447 X-Patchwork-Delegate: panto@antoniou-consulting.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 BDEE11400E9 for ; Tue, 2 Dec 2014 00:28:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 37AFE4B6DD; Mon, 1 Dec 2014 14:28:42 +0100 (CET) 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 v+7xVIZGNkcb; Mon, 1 Dec 2014 14:28:41 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 57DDF4B627; Mon, 1 Dec 2014 14:28:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 753664B627 for ; Mon, 1 Dec 2014 14:28:37 +0100 (CET) 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 9kPGMAxhVxMi for ; Mon, 1 Dec 2014 14:28:37 +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 relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) by theia.denx.de (Postfix) with ESMTP id 37FCB4B622 for ; Mon, 1 Dec 2014 14:28:32 +0100 (CET) Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XvQZI-00027L-KO from Andrew_Gabbasov@mentor.com for u-boot@lists.denx.de; Mon, 01 Dec 2014 04:59:08 -0800 Received: from sb-u1010-ivi.alm.mentorg.com (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.181.6; Mon, 1 Dec 2014 12:59:07 +0000 From: Andrew Gabbasov To: Date: Mon, 1 Dec 2014 06:59:11 -0600 Message-ID: <1417438752-18931-4-git-send-email-andrew_gabbasov@mentor.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1417438752-18931-1-git-send-email-andrew_gabbasov@mentor.com> References: <1417438752-18931-1-git-send-email-andrew_gabbasov@mentor.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 3/4] mmc: Fix block length for DDR mode X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 Block length for write and read commands is fixed to 512 bytes when the card is in Dual Data Rate mode. If block length read from CSD is different, make sure the driver will use correct length in all further calculations and settings. Signed-off-by: Andrew Gabbasov --- drivers/mmc/mmc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index d878c1e..9918597 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1170,6 +1170,12 @@ static int mmc_startup(struct mmc *mmc) mmc_set_clock(mmc, mmc->tran_speed); + /* Fix the block length for DDR mode */ + if (mmc->ddr_mode) { + mmc->read_bl_len = MMC_MAX_BLOCK_LEN; + mmc->write_bl_len = MMC_MAX_BLOCK_LEN; + } + /* fill in device description */ mmc->block_dev.lun = 0; mmc->block_dev.type = 0;