From patchwork Tue Aug 3 03:11:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zang Roy-R61911 X-Patchwork-Id: 176242 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Tue, 03 Aug 2010 04:41:46 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1Og8Nu-0000mv-B7 for chris@printf.net; Tue, 03 Aug 2010 04:41:46 +0100 Received: by mail.laptop.org (Postfix) id EEF462388C; Mon, 2 Aug 2010 23:41:28 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id E1BC723886 for ; Mon, 2 Aug 2010 23:41:28 -0400 (EDT) X-ASG-Debug-ID: 1280806904-356333980001-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id VWIPEhAZ6ScSWK7A for ; Mon, 02 Aug 2010 23:41:44 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754029Ab0HCDlo (ORCPT ); Mon, 2 Aug 2010 23:41:44 -0400 Received: from db3ehsobe004.messaging.microsoft.com ([213.199.154.142]:50958 "EHLO DB3EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753533Ab0HCDln (ORCPT ); Mon, 2 Aug 2010 23:41:43 -0400 X-Greylist: delayed 904 seconds by postgrey-1.27 at vger.kernel.org; Mon, 02 Aug 2010 23:41:43 EDT Received: from mail6-db3-R.bigfish.com (10.3.81.244) by DB3EHSOBE004.bigfish.com (10.3.84.24) with Microsoft SMTP Server id 8.1.436.0; Tue, 3 Aug 2010 03:26:37 +0000 Received: from mail6-db3 (localhost.localdomain [127.0.0.1]) by mail6-db3-R.bigfish.com (Postfix) with ESMTP id 7DC4512980DB; Tue, 3 Aug 2010 03:26:37 +0000 (UTC) X-SpamScore: 1 X-BigFish: VS1(zzzz1202hzz1497iz2dh2a8h62h) Received: from mail6-db3 (localhost.localdomain [127.0.0.1]) by mail6-db3 (MessageSwitch) id 12808059974482_2955; Tue, 3 Aug 2010 03:26:37 +0000 (UTC) Received: from DB3EHSMHS001.bigfish.com (unknown [10.3.81.243]) by mail6-db3.bigfish.com (Postfix) with ESMTP id F296B15C004E; Tue, 3 Aug 2010 03:26:36 +0000 (UTC) Received: from az33egw02.freescale.net (192.88.158.103) by DB3EHSMHS001.bigfish.com (10.3.87.101) with Microsoft SMTP Server (TLS) id 14.0.482.44; Tue, 3 Aug 2010 03:26:36 +0000 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by az33egw02.freescale.net (8.14.3/8.14.3) with ESMTP id o733QOqD029674; Mon, 2 Aug 2010 20:26:24 -0700 (MST) Received: from localhost.localdomain (rock.ap.freescale.net [10.193.20.106]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id o733bdZZ013858; Mon, 2 Aug 2010 22:37:40 -0500 (CDT) From: Roy Zang To: linux-mmc@vger.kernel.org CC: linuxppc-dev@ozlabs.org, akpm@linux-foundation.org X-ASG-Orig-Subj: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver Subject: [PATCH 1/3 v2] sdhci: Add auto CMD12 support for eSDHC driver Date: Tue, 3 Aug 2010 11:11:10 +0800 Message-ID: <1280805072-26112-1-git-send-email-tie-fei.zang@freescale.com> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 X-Reverse-DNS: az33egw02.freescale.net Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1280806904 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.36875 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c index a2e9820..dd1bdd1 100644 --- a/drivers/mmc/host/sdhci-of-core.c +++ b/drivers/mmc/host/sdhci-of-core.c @@ -154,6 +154,10 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev, host->ops = &sdhci_of_data->ops; } + if (of_get_property(np, "sdhci,auto-cmd12", NULL)) + host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12; + + if (of_get_property(np, "sdhci,1-bit-only", NULL)) host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA; diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index c6d1bd8..a92566e 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -817,8 +817,12 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, WARN_ON(!host->data); mode = SDHCI_TRNS_BLK_CNT_EN; - if (data->blocks > 1) - mode |= SDHCI_TRNS_MULTI; + if (data->blocks > 1) { + if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) + mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12; + else + mode |= SDHCI_TRNS_MULTI; + } if (data->flags & MMC_DATA_READ) mode |= SDHCI_TRNS_READ; if (host->flags & SDHCI_REQ_USE_DMA) @@ -1108,6 +1112,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) #ifndef SDHCI_USE_LEDS_CLASS sdhci_activate_led(host); #endif + if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) { + if (mrq->stop) { + mrq->data->stop = NULL; + mrq->stop = NULL; + } + } host->mrq = mrq; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index c846813..8fb088c 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -240,6 +240,8 @@ struct sdhci_host { #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25) /* Controller cannot support End Attribute in NOP ADMA descriptor */ #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26) +/* Controller uses Auto CMD12 command to stop the transfer */ +#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<27) int irq; /* Device IRQ */ void __iomem * ioaddr; /* Mapped address */