From patchwork Wed Aug 6 10:14:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sonic Zhang X-Patchwork-Id: 376976 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 7E6E914009B for ; Wed, 6 Aug 2014 20:14:43 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C5816A752D; Wed, 6 Aug 2014 12:14:41 +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 OoEkfIU7ZwRT; Wed, 6 Aug 2014 12:14:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 15CE0A750E; Wed, 6 Aug 2014 12:14:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A480A750E for ; Wed, 6 Aug 2014 12:14: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 r7EgWOH5UKQu for ; Wed, 6 Aug 2014 12:14:32 +0200 (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 na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0189.outbound.protection.outlook.com [207.46.163.189]) by theia.denx.de (Postfix) with ESMTPS id A7CE5A74FF for ; Wed, 6 Aug 2014 12:14:28 +0200 (CEST) Received: from BN3PR0301CA0022.namprd03.prod.outlook.com (25.160.180.160) by BL2PR03MB356.namprd03.prod.outlook.com (10.141.89.27) with Microsoft SMTP Server (TLS) id 15.0.995.14; Wed, 6 Aug 2014 10:14:26 +0000 Received: from BL2FFO11FD043.protection.gbl (2a01:111:f400:7c09::110) by BN3PR0301CA0022.outlook.office365.com (2a01:111:e400:4000::32) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Wed, 6 Aug 2014 10:14:26 +0000 Received: from nwd2mta2.analog.com (137.71.25.57) by BL2FFO11FD043.mail.protection.outlook.com (10.173.161.139) with Microsoft SMTP Server (TLS) id 15.0.990.10 via Frontend Transport; Wed, 6 Aug 2014 10:14:25 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.72.140]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id s76CnOKp014677 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 6 Aug 2014 08:49:25 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS7.ad.analog.com (10.64.72.140) with Microsoft SMTP Server id 14.3.158.1; Wed, 6 Aug 2014 06:13:41 -0400 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id s76ADdrs027305; Wed, 6 Aug 2014 06:13:40 -0400 Received: from nine.ad.analog.com (unknown [10.99.24.98]) by linux.site (Postfix) with ESMTP id 6078935ABB25; Tue, 5 Aug 2014 20:12:07 -0600 (MDT) From: Sonic Zhang To: Pantelis Antoniou , Date: Wed, 6 Aug 2014 18:14:35 +0800 Message-ID: <1407320075-2177-1-git-send-email-sonic.adi@gmail.com> X-Mailer: git-send-email 1.8.2.3 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130517936658314444; (52f37747-95c3-483a-bd05-08d153b03fac); () X-Forefront-Antispam-Report: CIP:137.71.25.57; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009003)(6009001)(189002)(199002)(87936001)(105596002)(106466001)(87286001)(36756003)(31966008)(19580395003)(19580405001)(99396002)(6806004)(83072002)(88136002)(77156001)(44976005)(229853001)(89996001)(74502001)(62966002)(50226001)(85306004)(74662001)(92566001)(92726001)(50466002)(4396001)(77982001)(73392001)(79102001)(73972005)(107046002)(81442001)(86362001)(81542001)(46102001)(93916002)(104166001)(50986999)(61266001)(87572001)(81342001)(33646002)(48376002)(82202001)(47776003)(21056001)(20776003)(80022001)(64706001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB356; H:nwd2mta2.analog.com; FPR:; MLV:sfv; PTR:nwd2mail11.analog.com; MX:1; A:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 02951C14DC Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 137.71.25.57 as permitted sender) Authentication-Results: spf=softfail (sender IP is 137.71.25.57) smtp.mailfrom=sonic.adi@gmail.com; Cc: Sonic Zhang , adi-u-boot-devel@lists.sourceforge.net Subject: [U-Boot] [PATCH] mmc: set correct block size value in bfin sdh driver 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 From: Sonic Zhang Wait data transfer till the data end bit other than the data block end bit is set. Signed-off-by: Sonic Zhang --- drivers/mmc/bfin_sdh.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/bfin_sdh.c b/drivers/mmc/bfin_sdh.c index bcd6a3e..9bdfbbc 100644 --- a/drivers/mmc/bfin_sdh.c +++ b/drivers/mmc/bfin_sdh.c @@ -138,9 +138,9 @@ static int sdh_setup_data(struct mmc *mmc, struct mmc_data *data) if (data->flags & MMC_DATA_WRITE) return UNUSABLE_ERR; #ifndef RSI_BLKSZ - data_ctl |= ((ffs(data_size) - 1) << 4); + data_ctl |= ((ffs(data->blocksize) - 1) << 4); #else - bfin_write_SDH_BLK_SIZE(data_size); + bfin_write_SDH_BLK_SIZE(data->blocksize); #endif data_ctl |= DTX_DIR; bfin_write_SDH_DATA_CTL(data_ctl); @@ -189,7 +189,8 @@ static int bfin_sdh_request(struct mmc *mmc, struct mmc_cmd *cmd, do { udelay(1); status = bfin_read_SDH_STATUS(); - } while (!(status & (DAT_BLK_END | DAT_END | DAT_TIME_OUT | DAT_CRC_FAIL | RX_OVERRUN))); + } while (!(status & (DAT_END | DAT_TIME_OUT | DAT_CRC_FAIL | + RX_OVERRUN))); if (status & DAT_TIME_OUT) { bfin_write_SDH_STATUS_CLR(DAT_TIMEOUT_STAT);