From patchwork Wed Sep 1 09:48:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 177722 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: Wed, 01 Sep 2010 11:01:13 +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 1Oqk80-00073K-Qh for chris@printf.net; Wed, 01 Sep 2010 11:01:13 +0100 Received: by mail.laptop.org (Postfix) id DAD3724567; Wed, 1 Sep 2010 06:00:44 -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 381FC24595 for ; Wed, 1 Sep 2010 06:00:31 -0400 (EDT) X-ASG-Debug-ID: 1283335243-0b74ca440002-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id EZlTHgnVCGx8BIsu for ; Wed, 01 Sep 2010 06:00:46 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754055Ab0IAKAq (ORCPT ); Wed, 1 Sep 2010 06:00:46 -0400 Received: from db3ehsobe004.messaging.microsoft.com ([213.199.154.142]:38695 "EHLO DB3EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870Ab0IAKAp (ORCPT ); Wed, 1 Sep 2010 06:00:45 -0400 Received: from mail65-db3-R.bigfish.com (10.3.81.240) by DB3EHSOBE004.bigfish.com (10.3.84.24) with Microsoft SMTP Server id 8.1.436.0; Wed, 1 Sep 2010 09:45:43 +0000 Received: from mail65-db3 (localhost.localdomain [127.0.0.1]) by mail65-db3-R.bigfish.com (Postfix) with ESMTP id C28AD16D8455 for ; Wed, 1 Sep 2010 09:45:42 +0000 (UTC) X-SpamScore: -2 X-BigFish: VS-2(zzbb2cKzz1202hzz8275bh1497iz2dh87h2a8h61h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail65-db3 (localhost.localdomain [127.0.0.1]) by mail65-db3 (MessageSwitch) id 1283334342427453_5348; Wed, 1 Sep 2010 09:45:42 +0000 (UTC) Received: from DB3EHSMHS012.bigfish.com (unknown [10.3.81.250]) by mail65-db3.bigfish.com (Postfix) with ESMTP id 65785113004B for ; Wed, 1 Sep 2010 09:45:42 +0000 (UTC) Received: from az33egw02.freescale.net (192.88.158.103) by DB3EHSMHS012.bigfish.com (10.3.87.112) with Microsoft SMTP Server (TLS) id 14.0.482.44; Wed, 1 Sep 2010 09:45:41 +0000 Received: from de01smr02.am.mot.com (de01smr02.freescale.net [10.208.0.151]) by az33egw02.freescale.net (8.14.3/8.14.3) with ESMTP id o819jdLE002412 for ; Wed, 1 Sep 2010 02:45:39 -0700 (MST) Received: from shlinux1.ap.freescale.net ([10.192.225.216]) by de01smr02.am.mot.com (8.13.1/8.13.0) with ESMTP id o81A0HZX004064 for ; Wed, 1 Sep 2010 05:00:18 -0500 (CDT) Received: by shlinux1.ap.freescale.net (Postfix, from userid 1003) id 1B9AC4D6001; Wed, 1 Sep 2010 17:48:15 +0800 (CST) From: Richard Zhu To: linux-mmc@vger.kernel.org CC: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Richard Zhu X-ASG-Orig-Subj: [PATCH 5/9] sdhci-5:add the 32BIT_CMD_TRANS_COMBINATION quirk to support FSl eSDHC Subject: [PATCH 5/9] sdhci-5:add the 32BIT_CMD_TRANS_COMBINATION quirk to support FSl eSDHC Date: Wed, 1 Sep 2010 17:48:14 +0800 Message-ID: <1283334494-12678-1-git-send-email-r65037@freescale.com> X-Mailer: git-send-email 1.6.3.3 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: 1283335243 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=MAILTO_TO_SPAM_ADDR X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.39600 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index e58939a..70b7f9d 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -932,7 +932,22 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) sdhci_writel(host, cmd->arg, SDHCI_ARGUMENT); - sdhci_set_transfer_mode(host, cmd->data); + if (host->quirks & SDHCI_QUIRK_32BIT_CMD_TRANS_COMBINATION) { + /* Set up the transfer mode */ + if (cmd->data != NULL) { + mask = SDHCI_TRNS_BLK_CNT_EN; + if (cmd->data->blocks > 1) + mask |= SDHCI_TRNS_MULTI; + if (cmd->data->flags & MMC_DATA_READ) + mask |= SDHCI_TRNS_READ; + else + mask &= ~SDHCI_TRNS_READ; + if (host->flags & SDHCI_REQ_USE_DMA) + mask |= SDHCI_TRNS_DMA; + } + + } else + sdhci_set_transfer_mode(host, cmd->data); if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) { printk(KERN_ERR "%s: Unsupported response type!\n", @@ -958,7 +973,13 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) if (cmd->data) flags |= SDHCI_CMD_DATA; - sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND); + if (host->quirks & SDHCI_QUIRK_32BIT_CMD_TRANS_COMBINATION) { + mask |= SDHCI_MAKE_CMD(cmd->opcode, flags) << 16; + + sdhci_writel(host, mask, SDHCI_TRANSFER_MODE); + } else + sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), + SDHCI_COMMAND); } static void sdhci_finish_command(struct sdhci_host *host) diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 37e9e3e..bb98378 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -247,6 +247,8 @@ struct sdhci_host { #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) /* Controller doesn't have the standard Host Control registor */ #define SDHCI_QUIRK_NONSTANDARD_HOST_CTL (1<<29) +/* Controller has the CMD and TRANS MODE combination */ +#define SDHCI_QUIRK_32BIT_CMD_TRANS_COMBINATION (1<<30) int irq; /* Device IRQ */ void __iomem * ioaddr; /* Mapped address */