From patchwork Fri Apr 15 17:29:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8854371 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5BE629F3D1 for ; Fri, 15 Apr 2016 17:53:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8532A20211 for ; Fri, 15 Apr 2016 17:53:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88F892037E for ; Fri, 15 Apr 2016 17:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751100AbcDORxQ (ORCPT ); Fri, 15 Apr 2016 13:53:16 -0400 Received: from mail-by2on0058.outbound.protection.outlook.com ([207.46.100.58]:40393 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750776AbcDORxP (ORCPT ); Fri, 15 Apr 2016 13:53:15 -0400 Received: from BN3PR0301CA0023.namprd03.prod.outlook.com (10.160.180.161) by BN1PR0301MB0705.namprd03.prod.outlook.com (10.160.78.12) with Microsoft SMTP Server (TLS) id 15.1.453.26; Fri, 15 Apr 2016 17:38:03 +0000 Received: from BN1BFFO11FD002.protection.gbl (2a01:111:f400:7c10::1:181) by BN3PR0301CA0023.outlook.office365.com (2a01:111:e400:4000::33) with Microsoft SMTP Server (TLS) id 15.1.453.26 via Frontend Transport; Fri, 15 Apr 2016 17:38:04 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD002.mail.protection.outlook.com (10.58.144.65) with Microsoft SMTP Server (TLS) id 15.1.472.8 via Frontend Transport; Fri, 15 Apr 2016 17:38:03 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u3FHb2HU019919; Fri, 15 Apr 2016 10:37:59 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH 19/23] mmc: sdhci-esdhc-imx: enable hw auto retuning for MAN_TUNING Date: Sat, 16 Apr 2016 01:29:43 +0800 Message-ID: <1460741387-23815-20-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> References: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131052154835952043; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(586003)(33646002)(47776003)(19580395003)(19580405001)(229853001)(106466001)(85426001)(77096005)(230783001)(5008740100001)(6806005)(81166005)(87936001)(2351001)(4326007)(48376002)(104016004)(189998001)(92566002)(50466002)(36756003)(5003940100001)(2906002)(1096002)(1220700001)(76176999)(50986999)(50226001)(86362001)(105606002)(110136002)(2950100001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0705; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD002; 1:ly5PuitYLuyQ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IxY3Sm5BLzGNVHBRiHrSQX3BevIRBW/zc/qnTH6PeVIezlJflq8YoHRin05O8DV4rhPrS/OBF2GX6suKBwMWjEjuB7DrY=; 25:C58m5rqMbjwZmPDs7CVsM4bUbTJlbVIjJWb5rRB0d4Ha6J9OLExhYCDGHmUWzuT+U4vRG/4JzMTzx35vNMcbtS9qUGlgg9/DeHTvPNtlg7HYcs70Rcv6DH0Fx83N2qzd1RLLBcDzt4Tgbajn3cKVk8c0E8SYFlgiI+v2wxbMlpdeHofn+X8/R+ugwQ8YrhsafaIoniQ5KG88W0LsS0rQDVPTmXnzSCfWw8NFdoCvZzFR77nrVJglUaIst+Z9Zjb4fgv8tFXfflPOFWzl7A72hYiuy26BS1jVjD1I40CYTYpwyBqof6kg5kpSyBPmqn6rONkYl4FPeFS9wX7tCKOwYA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0705; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(13018025)(13024025)(5005006)(13015025)(13017025)(13023025)(3002001)(10201501046)(6055026); SRVR:BN1PR0301MB0705; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0705; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0705; 4:fgs+Yg0FKMropIeH5Ed/wRN6z7YnmXfjBtnEHHxswkbqxctBI4Etalx/qfk6qqKklNQVk+t9sL+v1RyJlap9tedU++InPjTakM98+Rr5h93fYipL1jlJI8heBZqVwJHthZcHz7fy+WwG3+O7YGemHCxJh0XX+36iCYUOmBc+uul6KbpoH5D4Q9NARlCHQXZYm4n2zBne95I4oNMDFYXcBz92of9LO9/JvCjuFALMSZ2n924CAUqdfQ94DKVgulEYe5NLGDixfCaNxdBNg6Tg3hmfTeQ+tQzbJJuwhmp2JOIVnAe8PQRZA5bC3RYV6AU3X0Kc1ZnlRL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GHCGRZVvrXF?= =?us-ascii?Q?HENMVBtbX148fy5FpY6v4eU5di30oy8voE0c50mksreh0OBN5v1Wafr85Na/?= =?us-ascii?Q?WFxWmxosd/exoHExXdC1ZhJwUL1AUusqpaanMzEnvLlTyjPza844EG1XIUQa?= =?us-ascii?Q?bpe9JfXpxo8fSomHKVaSUmmj+Mj0e34Hw971FLvtq/9xeO1aq2wNweLUGuiQ?= =?us-ascii?Q?5I1ax39Ye2LSSlux8CIiumhj/CaOQMbA+b6EJnYjWlvlpv6ctQkptwX4ldFa?= =?us-ascii?Q?2WMcfMf63WVzBfrSSrufODF5qmRujSCjzJzVImVOT6zxjBv4mZBninypUT5f?= =?us-ascii?Q?K6aJkCUORkAf8PcoMsfN/Er4qHLgQxTLi95sOjcvtnrXf1oEOdPcXrjxiJzQ?= =?us-ascii?Q?udSa9X1Q=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0705; 5:WKf7MdPD7InqDTq0uHizUJ4EOduynozC9GFlkEwvimMqreZnWUIcfbPRHkPI6MmgznyWBg8nSSDlhREqAsMxU/J3oHzXuGD2pPbNm6YFsBcniZhgbp50kFiNVjUhzuL+RQPubFYllhPQD+LKp6Pw5zhy87w6+UV4UZjb2ps51es=; 24:r09mH78vVFRnp4iBnxCrT+IaIzNrQmHJLdM8n1htyNril01EYU+/ZeVe45OFyna/29bHLmDwrOF5soupg7ar5nctOfrkTDFEF+A1BU9v6sY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2016 17:38:03.3456 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0705 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Indicating hw auto retuning support for mx6qdl in the fake caps_1 register and enable auto retuning in post_tuning process after tuning completes. Signed-off-by: Dong Aisheng Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-esdhc-imx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index a582a83..07b1144 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -301,7 +301,8 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg) /* imx6q/dl does not have cap_1 register, fake one */ val = SDHCI_SUPPORT_DDR50 | SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 - | SDHCI_USE_SDR50_TUNING; + | SDHCI_USE_SDR50_TUNING + | (SDHCI_TUNING_MODE_3 << SDHCI_RETUNING_MODE_SHIFT); if (imx_data->socdata->flags & ESDHC_FLAG_HS400) val |= SDHCI_SUPPORT_HS400; @@ -471,10 +472,13 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) writel(new_val, host->ioaddr + ESDHC_VENDOR_SPEC); if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) { new_val = readl(host->ioaddr + ESDHC_MIX_CTRL); - if (val & SDHCI_CTRL_TUNED_CLK) + if (val & SDHCI_CTRL_TUNED_CLK) { new_val |= ESDHC_MIX_CTRL_SMPCLK_SEL; - else + new_val |= ESDHC_MIX_CTRL_AUTO_TUNE_EN; + } else { new_val &= ~ESDHC_MIX_CTRL_SMPCLK_SEL; + new_val &= ~ESDHC_MIX_CTRL_AUTO_TUNE_EN; + } writel(new_val , host->ioaddr + ESDHC_MIX_CTRL); } else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { u32 v = readl(host->ioaddr + SDHCI_ACMD12_ERR); @@ -760,6 +764,7 @@ static void esdhc_post_tuning(struct sdhci_host *host) reg = readl(host->ioaddr + ESDHC_MIX_CTRL); reg &= ~ESDHC_MIX_CTRL_EXE_TUNE; + reg |= ESDHC_MIX_CTRL_AUTO_TUNE_EN; writel(reg, host->ioaddr + ESDHC_MIX_CTRL); }