From patchwork Fri Mar 3 08:18:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangbo Lu X-Patchwork-Id: 9602183 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 E845D60453 for ; Fri, 3 Mar 2017 08:34:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB7EC2862C for ; Fri, 3 Mar 2017 08:34:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF65628631; Fri, 3 Mar 2017 08:34:16 +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=unavailable 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 690A72862C for ; Fri, 3 Mar 2017 08:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751598AbdCCIeO (ORCPT ); Fri, 3 Mar 2017 03:34:14 -0500 Received: from mail-sn1nam02on0076.outbound.protection.outlook.com ([104.47.36.76]:60896 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751445AbdCCIeK (ORCPT ); Fri, 3 Mar 2017 03:34:10 -0500 Received: from BN6PR03CA0015.namprd03.prod.outlook.com (10.168.230.153) by DM2PR0301MB0735.namprd03.prod.outlook.com (10.160.97.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Fri, 3 Mar 2017 08:32:57 +0000 Received: from BN1AFFO11FD038.protection.gbl (2a01:111:f400:7c10::177) by BN6PR03CA0015.outlook.office365.com (2603:10b6:404:23::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12 via Frontend Transport; Fri, 3 Mar 2017 08:32:56 +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 BN1AFFO11FD038.mail.protection.outlook.com (10.58.52.242) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.933.11 via Frontend Transport; Fri, 3 Mar 2017 08:32:57 +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 v238WhMm019793; Fri, 3 Mar 2017 01:32:53 -0700 From: Yangbo Lu To: , , Adrian Hunter , Rob Herring , Mark Rutland , Catalin Marinas , "Will Deacon" CC: , , Xiaobo Xie , Yangbo Lu Subject: [v2, 2/7] mmc: sdhci-of-esdhc: add support for signal voltage switch Date: Fri, 3 Mar 2017 16:18:44 +0800 Message-ID: <1488529129-23560-3-git-send-email-yangbo.lu@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1488529129-23560-1-git-send-email-yangbo.lu@nxp.com> References: <1488529129-23560-1-git-send-email-yangbo.lu@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131330035772124506; (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)(7916002)(336005)(39400400002)(39840400002)(39380400002)(39410400002)(39450400003)(39850400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(33646002)(4326008)(626004)(2950100002)(2906002)(38730400002)(104016004)(36756003)(47776003)(7416002)(189998001)(305945005)(230783001)(106466001)(105606002)(356003)(81166006)(5660300001)(8676002)(54906002)(8656002)(86362001)(53936002)(6666003)(5003940100001)(92566002)(50226002)(8936002)(50986999)(50466002)(48376002)(77096006)(76176999)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0735; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD038; 1:/h97Et+eu5I3s1vqbXpciE61lssKCIh4A5xs5efwdNaf6V9ouHZm8fteLa7vzZP0LTiOvEYzNpjwx3m17DuSMKzWgOC80XDIg4KKOTcuyEtCJ0mOLyjN8hCB2aBWU0G43XU1/+2UcwVwhK35t55MAVOdsyxZOkIVQOBnkz7rH+yVn9QRahk/icXWQcgFNuM1Aq0QS+MpX5KMFDfuGdQgjviIn1bgmY4SMnANtX3ViVJ7txcYNOuPf13eLBJK8XVCBHd9/xyjaP6cKnXE4Uk67CMbnVPw51kFwRgIkJSwQe2sMzgu2XhzyWhkB2r4pjW4BLz8A5ijwo5ePH2VavT/3KQNsX2SodFWOnOHEUz1ZGhTnZFx8Fb2YfoEzpMOfpXX7AevQPFIy1yeWEz4wDurLQtiH8O7FGdbjJOhofqdv5o+COcwy3f1765+zv8EQ8bfFDrhm7O1DKwxqD9uejBXshM5RoQioHquBWzbgvFxE9dA2XvRK5vHtEnM0+qJarRrsv8yM2RbfYLzDZOS2ElnxP9s6vT+jowYFxmkpRqkwWYjne1mmvcW2lGImOCLG05d4imULhfbwBlC/lXYQP46S2AlTkYC3OiQy7rCvBBaCG4lgCdoKdOQpoA8rXHQhab37Jtg3iQwzCMr0zl4fvYqEiPdqoVeqGt803zNRZ489GY8Fo3aZEsVRL+vniNc+cYJyHGzo8GUYX5o4WbBoV/zjCr5UQonGzFlvFbDKDC/cithYMrSCx0Bgf8MEbevKE69 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 6e06943b-ee99-4f2a-0bf9-08d4620fe4fe X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0735; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0735; 3:VjPr07RmS5VR6MbMbqc2Zcmam76g96umLlKP8gMOm2nA12RD5tL7zRKsPBgEBA1QOgObfWzzIc7bpiXFdywlllMQwwlyFQCe0EARYrin7MZipCbxQOhvixmE6fQ1kZhmFzp8DKlG1nE38O3nzfk7w+c9CPVqaSw4VqMTrJjAhUsU4UvuSec09LSxJaQn7CRhDk3cxBuBObVpnHc6jXBhszKmrK3RgiwxKDkdI03Ier9rlHkC3QvT2gePvexh7aZTJCQ5D9f9SbGJWunpSTatsfRGkLfo6E4GhiKxY7bF8j8E0YhzEklZC3WgVUtvq7Ah8CsNkyFQbq1Jhve8eGkVngWnuH5rTrMCCp4ystbaa+XBufr8SmTtgsrxr/+yMDZf; 25:vuqfJUuQv8L5/OjUORjC9YxPhMp7tOK+xA0UDynMQcalKkXfhiBqlYtzoFq0Rc0XAszpGB8ZNUA4XR7H43cUKVT5pRK1xhtwm2RYhuidA/n3pVH2zj7+K5xf5KR8QaplRrPmmBBl13Adrsxs7lhLdmYt3Ui0pepB++YULuZl3R75u0AN94Y38nSYzrcNYSxdY4K0qpLMr5BmTdYtd34z7eTImWaJy1DaPqSoWzezFoEmPm/jzdQvqqYY5DCHkliXFj938kdxEX6HnSY+fZjAtFQXhGEsp+EegsmpYxbUJdh2iAiZjORc/2J1ydIO1Jq4K4aibCxeRT8YEHJEkik9sYKrYW1SwI5sr417c+fgBBkCrh3poBkEcD5jeSkgzUdDErviyCuTGRW1xomvki/OwI/RNcgUXIC6s1nPE/7Wk+ocXU4Qghx2IhXE1qfH2f4PWBZb2xrW7ZpmAT2Cddsphw== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0735; 31:VLEcPGs44wE7LBwiAjPdV+g6Lu4y6Pt3JjBpzPbwxD+wlpjBjoGkyo3oD3j16gshp4C8YTZB2SmHlX23obBTd52xindaE90B+4Y0rSTAafZjO2HH68U7UV/HVrNkqSdD/22uD/E5WOAAcBVctdNZzla23J19fHlROJC6pwkiCLieza5McKbK2i/t0Pl+OgG+EBPNpOGxhmO2oKNWxwroCrWXnqfuF1/Zhbr8sohFqPukRJixPVeAGYaGHRuc31lVyrvvKDcgzlIhQlo4Z4IvLg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13024025)(13018025)(5005006)(8121501046)(13015025)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123565025)(20161123559025)(20161123561025)(20161123556025); SRVR:DM2PR0301MB0735; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0735; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0735; 4:9GBZ0c6XIftMGGD7vuJSkBSWucZ/6Gfp1uJiYxizbiHmnjKBHKyogeG+1VxeZbTrY0yqN0LGchmYMTti7CLX7+9QAsx0D4U72u4OjVAxQFpRyY/tsfc+MLPz4v5PwjTeay+KXvwIHlV1onTZxBIyh8jfi2KalpdWCxjtInIeGGo1W/QnOCzuVG801SAq/aE4xlb1Db6DxKExiDVCvp4MfR4mMqjibe78yakQryVabPh1TneomCp9gW/38ULsSDqr9g8OIVKh5RgcrOT13nUCISrLNu+n1ywEJDvTwsIFQv9HXSaccnxx61T1pOGuNaytW+rHvWGCpBmoWNmAqqiNkdGOp0xfEAoIrYXUYr6NGx1WOG31GM2Rxa0tRuCcy0j0bN1v0zRss3FZ9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bRekc7K5Y5t151XTIK/CxKAqgJ5i6zYFe+sOPPDdViRD6kb3jy3PCHisLfIaExO7ul1fXzq4E7Hhf9Zs0GjxFqEvJcQ5gt/dvdsM6DImqEScolvcEcKVpkkQrkhvnzCyb5/InNTUPdpjrLQoP7EH+P4Io1qqkK7EWQklk68d2iXGTIEVFu4dsuQoPdxVt+/XL4xRa6yFe9MNqoIX9gp8xIwy760KxKoGZ3c78LGsxyh03JxqJeh5aE8ycY5O20PaCow2Ar+CFpLPytY7AUE0bJVlml2m6du5G/2J3DDilfPEmFSuj0jXJ8nP7TdXXfM=; 5:C8SU14R+NEE2u5A1H46h5jl7TyO0tMqtnGwNqokvBYXoep+Nggd3DaYSLGkUdTd58KTOjxsU8WqM5zPiT0brgz9HMkooLYQKrefeI1siSf2QsCTd8BX0o3x3vuZXyswMToJAk/gwKBR6QhIH1W5NOvstQC9+gPL9rWxTi71gHS+q+hOzGSHaM2/+P/XZesql; 24:LjCmG5Dr+zj7e1tRcMjS+QDPT1X6PgHHxG0roXRggStdhQSNe4+cHvSt50GAzsc98zZtE6eXIof3+0gK58D0i43wjQnL70BmzNKKcnt00Ig= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0735; 7:aZv62Ylm3A9qSnGs5+Ooh9fYGzUlEJ0Rha890wAtYZIUwSYaNGCbs9yu7pnCZSrxg25ej2SWd+MbGpv8qNdqnKM7WtdIr89wTcc1cRycC1lDX8tp2XDo8MW4XmZ6Y2kFdan4Y5U1C/M7bVVFfRlchSyiYCBzLQgneMXTSi26ZphbThElofXDlXVV4+PHlm5UE79gEWfSZIvuGf7CjPvXFk+0vj0UV6t/LPsfU37KMopgDten7zhldG80RoDUgdyNjpP+1EDgbQTvUf0cZWdUea908K7iiVT1IeFOfTCfZjNTx+WScGqmCZ8laR8MOpyASkYsWmyyzbscIqlGROC0FA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 08:32:57.0096 (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: DM2PR0301MB0735 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 --- Changes for v2: - Used Adrain's method to support voltage switching: host->mmc_host_ops.start_signal_voltage_switch = esdhc_signal_voltage_switch; --- 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 84865b0..9ab6943 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) @@ -708,6 +779,9 @@ static int sdhci_esdhc_probe(struct platform_device *pdev) host = sdhci_pltfm_init(pdev, &sdhci_esdhc_be_pdata, sizeof(struct sdhci_esdhc)); + host->mmc_host_ops.start_signal_voltage_switch = + esdhc_signal_voltage_switch; + if (IS_ERR(host)) return PTR_ERR(host);