From patchwork Fri Apr 15 17:29:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8854241 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42521BF29F for ; Fri, 15 Apr 2016 17:52:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F59920218 for ; Fri, 15 Apr 2016 17:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21E7C2021A for ; Fri, 15 Apr 2016 17:52:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750862AbcDORwl (ORCPT ); Fri, 15 Apr 2016 13:52:41 -0400 Received: from mail-by2on0071.outbound.protection.outlook.com ([207.46.100.71]:52544 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750880AbcDORwk (ORCPT ); Fri, 15 Apr 2016 13:52:40 -0400 Received: from BLUPR03CA011.namprd03.prod.outlook.com (10.255.124.28) by DM2PR0301MB1229.namprd03.prod.outlook.com (10.160.219.18) with Microsoft SMTP Server (TLS) id 15.1.453.26; Fri, 15 Apr 2016 17:38:06 +0000 Received: from BN1AFFO11FD051.protection.gbl (10.255.124.4) by BLUPR03CA011.outlook.office365.com (10.255.124.28) with Microsoft SMTP Server (TLS) id 15.1.453.26 via Frontend Transport; Fri, 15 Apr 2016 17:38:05 +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 BN1AFFO11FD051.mail.protection.outlook.com (10.58.53.66) with Microsoft SMTP Server (TLS) id 15.1.453.6 via Frontend Transport; Fri, 15 Apr 2016 17:38:05 +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 u3FHb2HV019919; Fri, 15 Apr 2016 10:38:02 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH 20/23] mmc: sdhci-esdhc-imx: fix strobe DLL lock wrong clock issue Date: Sat, 16 Apr 2016 01:29:44 +0800 Message-ID: <1460741387-23815-21-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: 131052154861098106; (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)(105606002)(5003940100001)(47776003)(48376002)(2906002)(77096005)(110136002)(36756003)(33646002)(76176999)(189998001)(230783001)(50986999)(106466001)(50466002)(87936001)(2950100001)(2351001)(229853001)(19580395003)(19580405001)(50226001)(1220700001)(1096002)(81166005)(85426001)(6806005)(586003)(5008740100001)(4326007)(11100500001)(86362001)(92566002)(104016004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB1229; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD051; 1:1K9L/V/cBNmkNX//kI0ZSLnqQ2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J50cpbREBOPvOwkDVa+2gLJc07kcGEiMt+nYP9E5AMBcsdhKIl5Ymq0jkmrLp7kxspRUwam26YzUWxqK50hTB9zg=; 25:UjiF37S4KJWfBL2R5u9wSYuNtrw0CGvGuk6S8Vhi5ASPgH45JAG0xnHylE1LKIwgpeFIrEbDjY5FMwgtQKSREIIM91twR/itKMNZXWw0wW4rjgWs5nIDbNa6RapueKPgeP/opzlfREsIYlnySfCr/hF6FVUaRckdEigcJ4FoaHG0544/DtAQ4e9x4/MMm6A1W5PwFkAslx7rLJf3XImZsAHDwC+blabIHxIVht0dsdrS9Thi4Yd+2WB76symchSRhu7/1TP+152JX4tsE1zHzqGW7OGxiHGhTLKxcsoJg+2hoUzBn8PTSTObecBoJKSz9cq9ZuTrwJIyFuLEI0N+lA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1229; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13024025)(13017025)(13018025)(8121501046)(13023025)(5005006)(3002001)(10201501046)(6055026); SRVR:DM2PR0301MB1229; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB1229; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1229; 4:o8N/I/vYpaPDofU/+orz0yybEY3vLIhGBGNvqiqcXHkCMXilN0AgejBKnzGCZHYtaE6eaPzFzsKvzihhzGZY32RRSfVp+zYzrwg2kaj0Qgg3TD0L1fTdaHZiQ+WRfgGC2jvICgzVlszklV1J1a8E1ANkdClm73K7cOmLs0f9jtRK1tkwp/Xb/8Si5AeX0tJLwXMQgS0nX+D35ZSyrV/WX1uBc4iKMZHRTPRaSbEtlqgrWEPAos+XlO0odB+eHZTtKfgAs8sF7wjQqhGPHmJqhTjQVBdE8HgOmReiNMmasmxHGIpMZJFWw8cuW8vMFNaIMCiv5mbDWQ1fw6XWb6/iy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Be?= =?us-ascii?Q?F6ztqpnBLVU3GcUNL+Q3avv3CWVhZDpl33rXq6QaLCOroDyRbpVTuGOtyW6K?= =?us-ascii?Q?ej7ltvidAYPZ4FMRAlIl6PadrDnk+x17MORC37dati6Wd6SMwdHxbLp7GHG0?= =?us-ascii?Q?xDPyYdGmEgigLEBqDA5CiShEjw068jAJs2olSDyRXW2h7CjZ9dHaspXn9PPa?= =?us-ascii?Q?a/lSMHoxaCkP32qgIR1K1Z+1D8okMRiOzdnvFuihwgO/XJH0oRB+MxvsbnOg?= =?us-ascii?Q?lxixeRNKrpP6BR/TgCCP/S75Ziq9Ypz9iXhnBxKgJOPjA17O4JFY8TFwJ5Ru?= =?us-ascii?Q?p4JM0faNxksn+wdkDe5jR0d5IMzJycf8CjmN/6PUj5y1Ezr4JwVHWvU/DpnQ?= =?us-ascii?Q?+ZkYr4RgbnoZMpFC2i5Nq2pMBia5F?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1229; 5:yZWje20lhErlaPZMz9Z5V2Z9j85Lg2FKnbr9t6uI8HcJ3oa4y4XPf/AkHUbeCbl1XvEeAgxSt20p/JZWXCvwjz8lyFfAwselvuxu0nxB9PT+HdBqseVnImGzAfAGMf+6XS9tEPl49tDReww+ae87CUKLNgaQqpm19UFl9kHJ7+c=; 24:pP75mRqd0r9iU+IEWzuEbk4IVTTC0sepDiMMdYe2dV2Ctotjsx5yL1aZKOAK9wA6Plzww4Ur0pAUY0kW0P9Lm/yQCFyqo+eTfYE70QpwMYA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2016 17:38:05.8758 (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: DM2PR0301MB1229 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 When enable DDR, the clock factor definition is changed. e.g. original 200Mhz will become 100Mhz one MIX_CTRL_DDREN bit is set So we need to update the clock setting then the strobe dll can lock the correct clock rate. Additionally we also need disable the clock before locking strobe dll. Signed-off-by: Dong Aisheng Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-esdhc-imx.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 07b1144..3ff213f 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -852,6 +852,11 @@ static void esdhc_set_strobe_dll(struct sdhci_host *host) u32 v; if (host->mmc->actual_clock > ESDHC_STROBE_DLL_CLK_FREQ) { + /* disable clock before enabling strobe dll */ + writel(readl(host->ioaddr + ESDHC_VENDOR_SPEC) & + (~ESDHC_VENDOR_SPEC_FRC_SDCLK_ON), + host->ioaddr + ESDHC_VENDOR_SPEC); + /* force a reset on strobe dll */ writel(ESDHC_STROBE_DLL_CTRL_RESET, host->ioaddr + ESDHC_STROBE_DLL_CTRL); @@ -913,6 +918,8 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing) m |= ESDHC_MIX_CTRL_DDREN | ESDHC_MIX_CTRL_HS400_EN; writel(m, host->ioaddr + ESDHC_MIX_CTRL); imx_data->is_ddr = 1; + /* update clock after enable DDR for strobe DLL lock */ + host->ops->set_clock(host, host->clock); esdhc_set_strobe_dll(host); break; }