From patchwork Tue Apr 11 05:10:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangbo Lu X-Patchwork-Id: 9674565 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DEB2760381 for ; Tue, 11 Apr 2017 05:25:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D02FE28450 for ; Tue, 11 Apr 2017 05:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4EE4284D9; Tue, 11 Apr 2017 05:25:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CA8728450 for ; Tue, 11 Apr 2017 05:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753439AbdDKFZS (ORCPT ); Tue, 11 Apr 2017 01:25:18 -0400 Received: from mail-sn1nam02on0058.outbound.protection.outlook.com ([104.47.36.58]:4992 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752179AbdDKFZR (ORCPT ); Tue, 11 Apr 2017 01:25:17 -0400 Received: from BN6PR03CA0075.namprd03.prod.outlook.com (10.164.122.141) by CY1PR0301MB1291.namprd03.prod.outlook.com (10.161.213.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17; Tue, 11 Apr 2017 05:25:15 +0000 Received: from BN1AFFO11FD023.protection.gbl (2a01:111:f400:7c10::179) by BN6PR03CA0075.outlook.office365.com (2603:10b6:405:6f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.17 via Frontend Transport; Tue, 11 Apr 2017 05:25:15 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD023.mail.protection.outlook.com (10.58.52.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1019.14 via Frontend Transport; Tue, 11 Apr 2017 05:25:15 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v3B5P7p9017167; Mon, 10 Apr 2017 22:25:12 -0700 From: Yangbo Lu To: , , Adrian Hunter CC: Xiaobo Xie , Yangbo Lu Subject: [v4, 2/5] mmc: sdhci-of-esdhc: add support for signal voltage switch Date: Tue, 11 Apr 2017 13:10:28 +0800 Message-ID: <1491887431-31894-3-git-send-email-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1491887431-31894-1-git-send-email-yangbo.lu@nxp.com> References: <1491887431-31894-1-git-send-email-yangbo.lu@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131363619152408713; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39380400002)(39850400002)(39400400002)(39410400002)(39860400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(77096006)(104016004)(5003940100001)(47776003)(85426001)(2906002)(4326008)(8656002)(6666003)(54906002)(230783001)(5660300001)(76176999)(33646002)(86362001)(305945005)(356003)(50466002)(48376002)(8936002)(105606002)(50226002)(106466001)(53936002)(2950100002)(81166006)(189998001)(8676002)(36756003)(38730400002)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB1291; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD023; 1:/VLYpVVhNT6twhsz7gJYtwlB0AXct+hw7mizpNZiFoRS1UW7CyNpr0aUN20C+fZyWSvxEVJ/9klv/41/CcldaNMNIX1xOxWskOD/q+Xi53tOkHqJj5iBoihXDtb6c8AkXQ6cDCvW0gaCtG6hotoP4i5kEFbuUAA2D4SzrCshzHjMsbUjyi4yywITNhTNBboJh824tuRt+ah3r0YKoE5y0acERl9at9cLH9q0JuLk25hkQgt9aw3Obvd6tjFYkk+wn2DSsEGyLmSwVsnnpcmDlxwPsRcDIsHO+H3g0SJWU/6LAnB4ltbHEQRA/3TifrkopoyykCG+QN8PvjEqz5sN5OD5SI3UqK7+C0IWrqzUWiyGOQ+sDlXSxP4oUMlj/t6TNRYhvxZbGBrp6FBFqq1kq71KTVk4RVbSkc8N+RJSh3P/WLOkemsniGF/yfig+r65qSNvWbQ0sCDFEXV02VeQHSRb+d0H0nQFRvdhnWYuOKaejv9EP0TN5Lq/vr76rZaAgKO9N3vooN03RCBhzZRe3oa8m9pJa2qkho5gVf2VeAOmcRMrAyXiLBDL59AQcSSmgLEGm3keHO1igc7Mj9Fp444uThVYncdWQW4Kw/c+UBMvh6r+6Cc37ENAgSVBM5qYfDadq5SUsSZt5x4Daf+bpE2m2x+ADYztzglliqw1ALtm1RfiJodV9vRtOzpGMc94y+pFzXxW7zybCcQ9/hfxuLPGRO024sOHsfBeQwyRrBkquU05e0TY9ExT17sDSKlhPw8yU500y06SgrXuNA91Dg== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c54ae92b-58b9-4af1-cf28-08d4809b2271 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:CY1PR0301MB1291; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1291; 3:PrGcDimBufB2Oxn3SMeHOtXujIJcqhc3gNcxRz7kILWZmhZKfxWjudXSEBpidBNzDrX+h1c+rEXGn6vM57B0bqUjgEBfYiuiP34TP5HyS8C+rV+o8lSGBq3TGOStCUSDt54GpS0ORL2GYDzRoqJjK1uCAKRlYRngLPkifrVqX7VExy6IhI6uEwt0MoE4t7MPMH6p+fmrk2RonJ5DHOy0OY74jZM2tX/+sow25BH3IdPgWY2s8atgPA+q9vuMwYQb03maLJk0lLIR0lSyh3ONvwiUnKjcpf2uv7VSlgDKrY28dF6dqTFuZ7380g+cqQrsNJ2dI/s3XomryuWHBGOclZZNQIvtxxRRf3Hi3NDXESQwLUYoLBtJIhup8FB7f3cqT61s1BLEzHpUiQ9gObJ4x3HeBCtOqOVWKXDC3fQ/Sclb4DQDP1Bc5z1cp1TRFfn5; 25:6orB0M3MxnEpsHoUs5His84iTbucZSoFcIqEr53Nct2/cHGsmmew8zye0uo6bCWezaAN9QLyvImk3WSJW+geHegD5aJbsPIPL4LPPQ3jAZaMQD4nqfT3nO/OYoa23/kTWxqIPqHMqR4lhjeK1zxIizQuyfDKZI1MtLPQY1AKgavVKXQVWA1REPyuRis+iPf4lz+r2+tv32wGlextF6jZg4mLAJnsWIrRVuQDJHfihHMkGdI/WnZR8Iymj0KhRYfwl1E1P8ZnxqFKOt5RvNfjY/XqkJ2RovzF/kBUC99xmM0nIpT/TPWSrXN0nfowJNnhXcLTxtegMvfBouwRVUT5sUgA5gxQcllcJ9aGZzOcW8PezHGZu7JQxA3ItzMXd9pNJyO67HZQzqMkSRvLNHNJ9ivrZPKzWejsxOP0/COWZYlgiZ5rl9Cnerqrz8tOBpuaCgc3thN4xsm9pMp8sYHCoQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1291; 31:Yb+xu5Ng512Hl3ZJKvZCmmu55RITesgsNNFKVFzz15Zr3GRYKVzpXV2EIElK6C+PgUcgBeCIjeyAigM5Bq43I5wy/6DwjHLJPpRA+doLxXn/442UOC5TChKCc6qaL7mCLH/fs3VpycKtuPybrho64rVGl99mD7tq7VlakOtoYyQdbDEOpn+hJ3v/+J0V8nfFK/keT1SggbpWZNIg3Z1hBF88CXcOrJg9xJbTnbxsHCHK29j903bD+OKPW++458dFA9MkB44KG+bnD2ywaxRIPw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13017025)(13024025)(13023025)(13018025)(8121501046)(13015025)(5005006)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259075)(20161123556025)(20161123565025)(20161123561025)(20161123563025); SRVR:CY1PR0301MB1291; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB1291; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1291; 4:o6WZfepmzbf5xH6oJOjVMy4axPrkU4QO7v9ApA4Pe/S7LCXmpqRlRlH38jEH5vJ+9ZT5MGi4RWlJ1eGB1WsoNAUe/iY56qgqSzC8mbKizkejSf9Px5iwYTUa8vXfTnUVIVOu7JAmFftszXPYGYUr6+P4xnZ7FrhZbH1ybHXnc6Y7GgWyXgsl/4AJZ9F/WpKseVfIBrcKkvX0YM9Y86LrfB1UhVz7tvPhzMl7KGD4JTrN6ht2CGNHJuC02qayDawGFc8aZA9HlXOXwqxvIi1x/9soov8GzhGcENmpfCMLaY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Q?BadBHcr8uashyCbY=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1291; 6:EsK9fbImQXt4BdceF7YLBGPW4ufO7RNdKd47/B4TeSCquQm8dy0C//tjMUybpmW1XkuqZa/ayEBpj6/vd5tVkOT6YODO70upYJm3BUJG5r9oI+8Liap6oTLn5eDqoFPCF9bl7cvD1oNouHW+ZCGblpzKjyQJtiBDbs1HuiZFU20BD8Dyel5RljWIPuuEQ4bJ63W14OmIHWYLrolRoacIcWmSoCaelIVY6tOwqj2LdboP39s0GkvJ/FqlI5wOFqs/MaFMt3sSmT1J3yUT9FfFk9Qj/CEhkVMHUTiqBdgqQq3gAXVX0r1q/LTEduwDARxq2LSuhiilKLOUQ90CvairgcRI6iUjZ3P9j98S54F1M7LpCMz3ZOZpqJlBqffUokGyOAcGbVDkp9beWzzzNDOqSooakpD6jgNaLZcexcd7bLycae9J/VigKGQC2/dCtmAx5EYnJAJnkAexHA0ln6/COFnuo1xgSOPKhM0GiKvXsMCkCwqVLWxpTf5cUolRAM05; 5:HJHX41fbsbcSRwXRqEqidg7xy9IDEkXS+e/cssTAOpPQZw+qSKUM2Zld4KWMPrHff+JLBrQz7kXAWOFLzWcBpVH2obOxSjWHUGieoJXkGUpxIbJGGDCi7ph/Bkaq0I54UIipEgrluYO3CNEfrvEnKSbfEtc2yrdkNsskKpnWvzmZEJDcqpsBR7EXaKHeNvNv; 24:MAuTYQBh1DniO3wSArKCLKHhJZybN8BhvNx3JrrlfVo13Z2MDD5YhAoIpGf58qGZp55423wOGUNmmO9MTU3mmF/OoNSlew0QEHQZp1lspSs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1291; 7:tJHAm9bkRd8b5SOm0d0gwkMhRGDN+8acXXxReYgchd8fElZfgO1tBZt4oaPDFBAUKQm9/F32e3mjqcz4vabq+xd6S7YO55QVZArd1ST+ISsJmtlXSKA9vTqA9vicrtpa/PMusMPuGg4bk4Mp2W3z1NYQJWF4G57TRHWYnKI9u74P6YIAE0+M6C7inOjCg2OxaBL4W4uxYtBYuQZDmuYPZbHXAnOde3A0NLjxiKIEK5iqv+396Qw+PuESwmiG8Znh0VHP+NUCWGnA8bj9iy2mJHzhQx/m9IBuWZK/flN0fWIc7sRK+BYeRgHN2f6FymYe5H7hZHVWY9TWb8LG6po5qg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2017 05:25:15.0536 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1291 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP eSDHC supports signal voltage switch from 3.3v to 1.8v by eSDHC_PROCTL[VOLT_SEL] bit. This bit changes the value of output signal SDHC_VS, and there must be a control circuit out of eSDHC to change the signal voltage according to SDHC_VS output signal. Signed-off-by: Yangbo Lu Acked-by: Adrian Hunter --- Changes for v2: - Used Adrain's method to support voltage switching: host->mmc_host_ops.start_signal_voltage_switch = esdhc_signal_voltage_switch; Changes for v3: - Put .start_signal_voltage_switch assigning after IS_ERR(host) check. Changes for v4: - None --- drivers/mmc/host/sdhci-esdhc.h | 1 + drivers/mmc/host/sdhci-of-esdhc.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index 5343fc0..6869567 100644 --- a/drivers/mmc/host/sdhci-esdhc.h +++ b/drivers/mmc/host/sdhci-esdhc.h @@ -37,6 +37,7 @@ /* Protocol Control Register */ #define ESDHC_PROCTL 0x28 +#define ESDHC_VOLT_SEL 0x00000400 #define ESDHC_CTRL_4BITBUS (0x1 << 1) #define ESDHC_CTRL_8BITBUS (0x2 << 1) #define ESDHC_CTRL_BUSWIDTH_MASK (0x3 << 1) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 6d024b6..4dd28c3 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -559,6 +560,76 @@ static void esdhc_reset(struct sdhci_host *host, u8 mask) sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); } +/* The SCFG, Supplemental Configuration Unit, provides SoC specific + * configuration and status registers for the device. There is a + * SDHC IO VSEL control register on SCFG for some platforms. It's + * used to support SDHC IO voltage switching. + */ +static const struct of_device_id scfg_device_ids[] = { + { .compatible = "fsl,t1040-scfg", }, + { .compatible = "fsl,ls1012a-scfg", }, + { .compatible = "fsl,ls1046a-scfg", }, + {} +}; + +/* SDHC IO VSEL control register definition */ +#define SCFG_SDHCIOVSELCR 0x408 +#define SDHCIOVSELCR_TGLEN 0x80000000 +#define SDHCIOVSELCR_VSELVAL 0x60000000 +#define SDHCIOVSELCR_SDHC_VS 0x00000001 + +static int esdhc_signal_voltage_switch(struct mmc_host *mmc, + struct mmc_ios *ios) +{ + struct sdhci_host *host = mmc_priv(mmc); + struct device_node *scfg_node; + void __iomem *scfg_base = NULL; + u32 sdhciovselcr; + u32 val; + + /* + * Signal Voltage Switching is only applicable for Host Controllers + * v3.00 and above. + */ + if (host->version < SDHCI_SPEC_300) + return 0; + + val = sdhci_readl(host, ESDHC_PROCTL); + + switch (ios->signal_voltage) { + case MMC_SIGNAL_VOLTAGE_330: + val &= ~ESDHC_VOLT_SEL; + sdhci_writel(host, val, ESDHC_PROCTL); + return 0; + case MMC_SIGNAL_VOLTAGE_180: + scfg_node = of_find_matching_node(NULL, scfg_device_ids); + if (scfg_node) + scfg_base = of_iomap(scfg_node, 0); + if (scfg_base) { + sdhciovselcr = SDHCIOVSELCR_TGLEN | + SDHCIOVSELCR_VSELVAL; + iowrite32be(sdhciovselcr, + scfg_base + SCFG_SDHCIOVSELCR); + + val |= ESDHC_VOLT_SEL; + sdhci_writel(host, val, ESDHC_PROCTL); + mdelay(5); + + sdhciovselcr = SDHCIOVSELCR_TGLEN | + SDHCIOVSELCR_SDHC_VS; + iowrite32be(sdhciovselcr, + scfg_base + SCFG_SDHCIOVSELCR); + iounmap(scfg_base); + } else { + val |= ESDHC_VOLT_SEL; + sdhci_writel(host, val, ESDHC_PROCTL); + } + return 0; + default: + return 0; + } +} + #ifdef CONFIG_PM_SLEEP static u32 esdhc_proctl; static int esdhc_of_suspend(struct device *dev) @@ -716,6 +787,9 @@ static int sdhci_esdhc_probe(struct platform_device *pdev) if (IS_ERR(host)) return PTR_ERR(host); + host->mmc_host_ops.start_signal_voltage_switch = + esdhc_signal_voltage_switch; + esdhc_init(pdev, host); sdhci_get_of_property(pdev);