From patchwork Fri Sep 21 06:31:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 185593 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 6FF942C0084 for ; Fri, 21 Sep 2012 16:32:56 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DFB8128093; Fri, 21 Sep 2012 08:32:52 +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 R-iOLiHqBOi9; Fri, 21 Sep 2012 08:32:52 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F0E252809C; Fri, 21 Sep 2012 08:32:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 474E528081 for ; Fri, 21 Sep 2012 08:32:26 +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 0RWtzl0SREHM for ; Fri, 21 Sep 2012 08:32:25 +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 mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by theia.denx.de (Postfix) with ESMTP id 36F5728084 for ; Fri, 21 Sep 2012 08:32:22 +0200 (CEST) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MAO000BRSTO1V10@mailout3.samsung.com> for u-boot@lists.denx.de; Fri, 21 Sep 2012 15:32:20 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-f2-505c09f4a394 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 58.D9.03783.4F90C505; Fri, 21 Sep 2012 15:32:20 +0900 (KST) Received: from [10.90.51.55] by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MAO003SNSTVKG60@mmp1.samsung.com> for u-boot@lists.denx.de; Fri, 21 Sep 2012 15:32:20 +0900 (KST) Message-id: <505C09DD.2010402@samsung.com> Date: Fri, 21 Sep 2012 15:31:57 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-version: 1.0 To: "u-boot@lists.denx.de" X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMLMWRmVeSWpSXmKPExsVy+t9jAd0vnDEBBj8ecFu83dvJ7sDocfbO DsYAxigum5TUnMyy1CJ9uwSujHPPupkKTglWzDxg18B4ja+LkZNDQsBEYtuhHlYIW0ziwr31 bF2MXBxCAosYJeae38UO4TQxSbQd2cEMUsUroCXxbNF3FhCbRUBVom1KCyOIzSagI7H923Em EFtUIERiydyv7BD1ghI/Jt8DqxcRMJT4u3s3C8hQZoGLjBLdTyGKhAUSJM4eWA3WzAw0aH/r NDYIW15i85q3zBMY+WYhmTULSdksJGULGJlXMYqmFiQXFCel5xrqFSfmFpfmpesl5+duYgQH 1TOpHYwrGywOMQpwMCrx8K74Fh0gxJpYVlyZe4hRgoNZSYT3UQxQiDclsbIqtSg/vqg0J7X4 EKM0B4uSOK/wp8AAIYH0xJLU7NTUgtQimCwTB6dUA2MBVzXbe+22B2ccLFe67BWQUX3q7vL0 clrgI+ljK8vVXsWfZHA8fP9z3SPdfTb7JRWana64LRTZml93OXzD++/iJ74fYG3KPuzf8obJ go+FTzG++8xqm6cZ11e8it8Yc7dPpGhSY2WJwkFO7ZgCt++CE94uSVOP4/Pkqkj3dz7GWRuT ztQnqsRSnJFoqMVcVJwIABWIt8smAgAA Cc: Lei Wen , Kyungmin Park , Andy Fleming Subject: [U-Boot] [PATCH 3/3] mmc: sdhci: Add a quirk to add delay during completion of sdhci_send_cmd 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: Tushar Behera MMC host controller requires a delay between every sdhci_send_cmd() execution. In s5p_mmc driver (s5p_sdhci replaces this driver), a delay of 1000us was provided after every mmc_send_cmd() call. Adding a quirk in current sdhci driver to replicate the behaviour. Without this delay, MMC initialization on Origen board fails with following error messages. Timeout for status update! mmc fail to send stop cmd Signed-off-by: Tushar Behera Signed-off-by: Jaehoon Chung --- drivers/mmc/s5p_sdhci.c | 3 ++- drivers/mmc/sdhci.c | 3 +++ include/sdhci.h | 1 + 3 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c index b978236..dc49d37 100644 --- a/drivers/mmc/s5p_sdhci.c +++ b/drivers/mmc/s5p_sdhci.c @@ -83,7 +83,8 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width) host->ioaddr = (void *)regbase; host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE | - SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR; + SDHCI_QUIRK_BROKEN_R1B | SDHCI_QUIRK_32BIT_DMA_ADDR | + SDHCI_QUIRK_WAIT_SEND_CMD; host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; host->version = sdhci_readw(host, SDHCI_HOST_VERSION); diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 15b4686..7845f87 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -240,6 +240,9 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, if (!ret && data) ret = sdhci_transfer_data(host, data, start_addr); + if (host->quirks & SDHCI_QUIRK_WAIT_SEND_CMD) + udelay(1000); + stat = sdhci_readl(host, SDHCI_INT_STATUS); sdhci_writel(host, SDHCI_INT_ALL_MASK, SDHCI_INT_STATUS); if (!ret) { diff --git a/include/sdhci.h b/include/sdhci.h index c0345ed..c44793d 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -224,6 +224,7 @@ #define SDHCI_QUIRK_NO_HISPD_BIT (1 << 3) #define SDHCI_QUIRK_BROKEN_VOLTAGE (1 << 4) #define SDHCI_QUIRK_NO_CD (1 << 5) +#define SDHCI_QUIRK_WAIT_SEND_CMD (1 << 6) /* to make gcc happy */ struct sdhci_host;