From patchwork Mon Jul 8 07:16:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Haijun.Zhang" X-Patchwork-Id: 257493 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 857EB2C0451 for ; Mon, 8 Jul 2013 18:06:59 +1000 (EST) Received: from va3outboundpool.messaging.microsoft.com (va3ehsobe003.messaging.microsoft.com [216.32.180.13]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "MSIT Machine Auth CA 2" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 4EB2F2C02FB for ; Mon, 8 Jul 2013 18:06:02 +1000 (EST) Received: from mail69-va3-R.bigfish.com (10.7.14.239) by VA3EHSOBE014.bigfish.com (10.7.40.64) with Microsoft SMTP Server id 14.1.225.22; Mon, 8 Jul 2013 08:05:57 +0000 Received: from mail69-va3 (localhost [127.0.0.1]) by mail69-va3-R.bigfish.com (Postfix) with ESMTP id 95E292E0170; Mon, 8 Jul 2013 08:05:57 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e23h1155h) Received: from mail69-va3 (localhost.localdomain [127.0.0.1]) by mail69-va3 (MessageSwitch) id 1373270756694535_24210; Mon, 8 Jul 2013 08:05:56 +0000 (UTC) Received: from VA3EHSMHS013.bigfish.com (unknown [10.7.14.237]) by mail69-va3.bigfish.com (Postfix) with ESMTP id 9B91E2C0069; Mon, 8 Jul 2013 08:05:56 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS013.bigfish.com (10.7.99.23) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 8 Jul 2013 08:05:53 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.3.136.1; Mon, 8 Jul 2013 08:08:01 +0000 Received: from rock.am.freescale.net (rock.ap.freescale.net [10.193.20.106]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r6885hHL026035; Mon, 8 Jul 2013 01:05:49 -0700 From: Haijun Zhang To: , Subject: [PATCH 3/4 V2] mmc: esdhc: Add quirks to support T4240QDS board Date: Mon, 8 Jul 2013 15:16:04 +0800 Message-ID: <1373267764-6364-2-git-send-email-Haijun.Zhang@freescale.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1373267764-6364-1-git-send-email-Haijun.Zhang@freescale.com> References: <1373267764-6364-1-git-send-email-Haijun.Zhang@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: r39252@freescale.com, AFLEMING@freescale.com, cbouatmailru@gmail.com, scottwood@freescale.com, cjb@laptop.org, Haijun Zhang X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On T4240QDS board controllers has an unusable ADMA engine, so use SDMA instead. Also 3.0v is support on T4240QDS board even if the capacity detailed only 1.8v support. Without this quirk SD card will declare voltage not support and Signed-off-by: Haijun Zhang --- changes for v2: - Change the compatible for t4240qds board drivers/mmc/host/sdhci-pltfm.c | 7 ++++++- drivers/mmc/host/sdhci.c | 3 +++ include/linux/mmc/sdhci.h | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index e2065a4..800e82f 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -92,9 +92,14 @@ void sdhci_get_of_property(struct platform_device *pdev) if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc")) host->quirks |= SDHCI_QUIRK_BROKEN_DMA; + if (of_device_is_compatible(np, "fsl,t4240qds-esdhc")) { + host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; + host->quirks2 |= SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS30; + } + if (of_device_is_compatible(np, "fsl,p2020-esdhc") || of_device_is_compatible(np, "fsl,p1010-esdhc") || - of_device_is_compatible(np, "fsl,t4240-esdhc") || + of_device_is_compatible(np, "fsl,t4240qds-esdhc") || of_device_is_compatible(np, "fsl,mpc8536-esdhc")) host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a78bd4f..de7fa81 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2797,6 +2797,9 @@ int sdhci_add_host(struct sdhci_host *host) host->caps1 : sdhci_readl(host, SDHCI_CAPABILITIES_1); + if (host->quirks2 & SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS30) + caps[0] = caps[0] | SDHCI_CAN_VDD_300; + if (host->quirks & SDHCI_QUIRK_FORCE_DMA) host->flags |= SDHCI_USE_SDMA; else if (!(caps[0] & SDHCI_CAN_DO_SDMA)) diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index e3c6a74..dc608d7 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -98,6 +98,8 @@ struct sdhci_host { #define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON (1<<4) /* Controller has a non-standard host control register */ #define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5) +/* The host support VS300 even if the capacity detailed not */ +#define SDHCI_QUIRK2_CIRCUIT_SUPPORT_VS30 (1<<6) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */