From patchwork Fri Apr 15 17:29:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8854401 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 CC8519F3A0 for ; Fri, 15 Apr 2016 17:53:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2F4020218 for ; Fri, 15 Apr 2016 17:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFB5F20211 for ; Fri, 15 Apr 2016 17:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751142AbcDORxg (ORCPT ); Fri, 15 Apr 2016 13:53:36 -0400 Received: from mail-bn1on0070.outbound.protection.outlook.com ([157.56.110.70]:6992 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750776AbcDORxf (ORCPT ); Fri, 15 Apr 2016 13:53:35 -0400 Received: from BLUPR03CA003.namprd03.prod.outlook.com (10.255.124.20) by CY1PR0301MB0713.namprd03.prod.outlook.com (10.160.159.143) with Microsoft SMTP Server (TLS) id 15.1.453.26; Fri, 15 Apr 2016 17:38:03 +0000 Received: from BN1BFFO11FD024.protection.gbl (10.255.124.4) by BLUPR03CA003.outlook.office365.com (10.255.124.20) with Microsoft SMTP Server (TLS) id 15.1.453.26 via Frontend Transport; Fri, 15 Apr 2016 17:38:02 +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 BN1BFFO11FD024.mail.protection.outlook.com (10.58.144.87) with Microsoft SMTP Server (TLS) id 15.1.453.6 via Frontend Transport; Fri, 15 Apr 2016 17:38:00 +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 u3FHb2HT019919; Fri, 15 Apr 2016 10:37:56 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH 18/23] mmc: sdhci-esdhc-imx: enable hw auto retuning for STD_TUNING Date: Sat, 16 Apr 2016 01:29:42 +0800 Message-ID: <1460741387-23815-19-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: 131052154828464686; (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)(189002)(199003)(5008740100001)(47776003)(104016004)(586003)(189998001)(50226001)(230783001)(2950100001)(86362001)(19580405001)(77096005)(6806005)(2351001)(229853001)(110136002)(87936001)(106466001)(33646002)(92566002)(105606002)(81166005)(48376002)(5003940100001)(50986999)(19580395003)(76176999)(2906002)(50466002)(1220700001)(85426001)(1096002)(36756003)(4326007)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0713; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD024; 1:RxR0Ed3WlQ3X4QubjBGR8j77xmY6B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h5DGeWYxjhqnypS2eJScJMX8yK32WpQzbUaPJBTVNe7m0UHPLDtIT6ZiQnRGM/clnuM27lOPBP5Y=; 25:ilcK9EV8Q7nE6kQivjrKLuWR+OX7380WE6SUney1qcFe/ULYk9uQkmvgzz7yBwJTQiqzX6FKzYsAHtVnvQVI1HqLIjhyTcIU9yTh4Q0wehva1gNoUiuj0VgtKx6cyft8KUApaDlcL4p8MKIbVJXGqX0SwTBAMgrQP+b8RroLAME7CqzgZR/LXtIGntBiirjNeD3ZxIwL6skMzNqN/rPiShq56rmQ50VSV0ygJjvQjvo/sKLUtiaBNBgH7MObZIDB5e+V/F73lW2XYiwMzYsIL2uMvgYYs91VY7a9Syaxo2xSvoGNDVhOIVPW26DA7Vr3GDpvEWts61aRVzJ12aHgfA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0713; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(8121501046)(13023025)(13017025)(5005006)(13015025)(13018025)(10201501046)(3002001)(6055026); SRVR:CY1PR0301MB0713; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0713; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0713; 4:O1XIrgN0UNtHDBoJxn01x6s9084bjjykKtBEd6aCewIvfTnSbH5fyR6onQ6bKuibmbegTiEw4rBGLe+649VApnm4bqpJ/qx/9TOC8tMexucCondlViYSk8UVMJIcUloA3Nj6h4Pywqoazbg7YqlNYPpIPWQ9WrEiTKfeaciseEqIw/83+GxJkWz/t0coMz2zH4zZMhyVsH8l8Y8WUfntY+cAm2366kDxEtIdKW1xu6vprYXoDXQmEHo5KG+cG0lYgXQJTYrsbSDElXJcvfneBiIEA+MKCfZ4D4CNjbmQoz7e+nOzzTanv9nPf7vvZK9pg7suwz5RIhxrkwjuHR7XT6hadlJVQGMB1O97yThq4sjp9tYZl/tgP9RtVe6BLIbHcdyYI3FQztjU4IG3uZFpg88Tgi+opb8I17Bd0urlHOy5XY/oFAPM3CUc/vin8eSbcGHlFF2Jp8SE06DF0z7ZJ3LVAICHPgSaIHS84gzhbf8= X-Forefront-PRVS: 0913EA1D60 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0713; 23:1EmobZqLE/tWz1cuWjqHmIMp4q19z/BoHMh2sJF?= =?us-ascii?Q?AeJvtx5OIvoWrUGh2rr8BGimQ6PWx72dW8p3WO28Xdi3lgoXsweU0/7h6PCL?= =?us-ascii?Q?mkvNSbnZq2s4ZxekuzIL+gVWpQ2sluRcIZljIjc+daLWiz2Pm4hqIcTOfNje?= =?us-ascii?Q?r7aod4WNdApF1f9wEDQ/9bQgxwEP6DlQmdryWfejwAzY2C1A1VWtzSEId0vh?= =?us-ascii?Q?IL9QOMy8tPOw4sfQ8kAYU0tXHnRqQB2JqJmpnwB8MONeMd/fBs40wOdVLxFq?= =?us-ascii?Q?4NnIJ3bxDgEOo7q0iUrMH1E2uzlmjfGfYQO/VPQjZgogTnEml9oHCRuis+yj?= =?us-ascii?Q?eJHHc7vpGTZAAoYUwM19dR7iCTvcTmW3ORI/rrD7qHVIBkPDrguifn9EYHWU?= =?us-ascii?Q?Ymc+cwozY4HhC12WlALH7UFm5ihgzzI7qhHqy9HP0CU+ulmz+5v+SbdIC3HM?= =?us-ascii?Q?cdSOOe0fyWUw6AEo1B0LkhyLuj+D3wjkgBO5kE2Mo7xh3Czfy48X4isZ1V2A?= =?us-ascii?Q?LCgeWVgWuYuCO/npr8brnUZK5gr67xSKEG9cq6XEQUzTheOs+CIMuYuqLFx2?= =?us-ascii?Q?c8KqceCLyYn7OHcSfqQrMGVsxots0hKZ/rLHel9x150txl8UuFcKJ0JEnzz8?= =?us-ascii?Q?1z0+4N8OAUXsDZy7K17jEJVnZc8jNhhMkixNji3KXK73hoM47UuPm+cgFQf4?= =?us-ascii?Q?sNreCEK4ku3ossjlXBPUP1uGRpPGCB4YQkw4nq09GhBxrik33D+01qesqyGp?= =?us-ascii?Q?OhE1nh95dOAIsYrGB6PQnsZre72tlsiebdR4kzJ7ck451ObiD06jk6m0i9KV?= =?us-ascii?Q?ibkZFmhsmOeQ+tqc1Q9qLVjctWG8ZP1YI96sp2hmQl7C56mPDTABY6A+HqzF?= =?us-ascii?Q?YQ8rTYOJdE+MQCKT9P1TsYYrlUYBifdiZTcNzeECIQubg9Tm45mhEwrJp8He?= =?us-ascii?Q?YSRs+kgxSwWFyMoC2/1efcKjwstgJCn56P5iYPd016BGxgFgXkRP/OnGoD17?= =?us-ascii?Q?+2S8WWdMOS5ltffYDvfGlCCQXeYHZNO6F/1qUiMV7R/Z/2fH9nl3OINpKyvC?= =?us-ascii?Q?R5Rb1/BE=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0713; 5:bnCT1qxVHBrJFqd1WY3h6DKL2UNoYYCu15dmbL0gmbkszGneZrW2T0BSgQ2TkgQFFKrYAK9pezhMfQrkOUc94DhXwNak2pfUTFq7DHqVXmL1TfQFEl8yEiEfoiUIv7PMxA42ONIwzFnQ+U8oMqpfbz1a/JoQGuAVQAjDvRfSMTQ=; 24:14dDkVPL4IemyPNnd3xy2yQWmeEvt6EjNPjcVMRCxgfoovrBGxqXDXP78BjxaKjnLJiNOMtSpXjO6ulg4HVwLwU2P1jn6ZLZaSvwnp2tphQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2016 17:38:00.3192 (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: CY1PR0301MB0713 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=ham 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 Enable HW auto retuning when set SDHCI_CTRL_EXEC_TUNING and clear it when clear SDHCI_CTRL_TUNED_CLK. Signed-off-by: Dong Aisheng Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 9f9be3f..a582a83 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -44,6 +44,7 @@ #define ESDHC_MIX_CTRL_AC23EN (1 << 7) #define ESDHC_MIX_CTRL_EXE_TUNE (1 << 22) #define ESDHC_MIX_CTRL_SMPCLK_SEL (1 << 23) +#define ESDHC_MIX_CTRL_AUTO_TUNE_EN (1 << 24) #define ESDHC_MIX_CTRL_FBCLK_SEL (1 << 25) #define ESDHC_MIX_CTRL_HS400_EN (1 << 26) /* Bits 3 and 6 are not SDHCI standard definitions */ @@ -484,11 +485,13 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) } else { v &= ~ESDHC_MIX_CTRL_SMPCLK_SEL; m &= ~ESDHC_MIX_CTRL_FBCLK_SEL; + m &= ~ESDHC_MIX_CTRL_AUTO_TUNE_EN; } if (val & SDHCI_CTRL_EXEC_TUNING) { v |= ESDHC_MIX_CTRL_EXE_TUNE; m |= ESDHC_MIX_CTRL_FBCLK_SEL; + m |= ESDHC_MIX_CTRL_AUTO_TUNE_EN; tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL); tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP_DEFAULT; if (imx_data->boarddata.tuning_start_tap) {